lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b9915fb7-ad8c-40ff-b53a-fb6936c141b1@linux.intel.com>
Date: Wed, 12 Feb 2025 14:17:33 -0500
From: "Liang, Kan" <kan.liang@...ux.intel.com>
To: James Clark <james.clark@...aro.org>, linux-perf-users@...r.kernel.org
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
 Arnaldo Carvalho de Melo <acme@...nel.org>,
 Namhyung Kim <namhyung@...nel.org>, Mark Rutland <mark.rutland@....com>,
 Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
 Jiri Olsa <jolsa@...nel.org>, Ian Rogers <irogers@...gle.com>,
 Adrian Hunter <adrian.hunter@...el.com>,
 Athira Rajeev <atrajeev@...ux.vnet.ibm.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf tests: Fix Tool PMU test segfault



On 2025-02-12 11:38 a.m., James Clark wrote:
> tool_pmu__event_to_str() now handles skipped events by returning NULL,
> so it's wrong to re-check for a skip on the resulting string. Calling
> tool_pmu__skip_event() with a NULL string results in a segfault so
> remove the unnecessary skip to fix it:
> 
>   $ perf test -vv "parsing with PMU name"
> 
>   12.2: Parsing with PMU name:
>   ...
>   ---- unexpected signal (11) ----
>   12.2: Parsing with PMU name         : FAILED!
> 

Oops, right. Thanks for the fix.

Acked-by: Kan Liang <kan.liang@...ux.intel.com>

Thanks,
Kan

> Fixes: ee8aef2d2321 ("perf tools: Add skip check in tool_pmu__event_to_str()")
> Signed-off-by: James Clark <james.clark@...aro.org>
> --->  tools/perf/tests/tool_pmu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/tests/tool_pmu.c b/tools/perf/tests/tool_pmu.c
> index 187942b749b7..1e900ef92e37 100644
> --- a/tools/perf/tests/tool_pmu.c
> +++ b/tools/perf/tests/tool_pmu.c
> @@ -27,7 +27,7 @@ static int do_test(enum tool_pmu_event ev, bool with_pmu)
>  	parse_events_error__init(&err);
>  	ret = parse_events(evlist, str, &err);
>  	if (ret) {
> -		if (tool_pmu__skip_event(tool_pmu__event_to_str(ev))) {
> +		if (!tool_pmu__event_to_str(ev)) {
>  			ret = TEST_OK;
>  			goto out;
>  		}
> @@ -59,7 +59,7 @@ static int do_test(enum tool_pmu_event ev, bool with_pmu)
>  		}
>  	}
>  
> -	if (!found && !tool_pmu__skip_event(tool_pmu__event_to_str(ev))) {
> +	if (!found && tool_pmu__event_to_str(ev)) {
>  		pr_debug("FAILED %s:%d Didn't find tool event '%s' in parsed evsels\n",
>  			 __FILE__, __LINE__, str);
>  		ret = TEST_FAIL;


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ