[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200402151643.GB8736@kernel.org>
Date: Thu, 2 Apr 2020 12:16:43 -0300
From: Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
To: Andreas Gerstmayr <agerstmayr@...hat.com>
Cc: linux-perf-users@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
"Steven Rostedt (VMware)" <rostedt@...dmis.org>,
Kan Liang <kan.liang@...ux.intel.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf script report: fix segfault when using DWARF mode
Em Thu, Apr 02, 2020 at 02:54:16PM +0200, Andreas Gerstmayr escreveu:
> When running perf script report with a Python script and a callgraph in
> DWARF mode, intr_regs->regs can be 0 and therefore crashing the regs_map
> function.
>
> Added a check for this condition (same check as in builtin-script.c:595).
Thanks, applied to perf/urgent.
- Arnaldo
> Signed-off-by: Andreas Gerstmayr <agerstmayr@...hat.com>
> ---
> tools/perf/util/scripting-engines/trace-event-python.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
> index 8c1b27cd8b99..2c372cf5495e 100644
> --- a/tools/perf/util/scripting-engines/trace-event-python.c
> +++ b/tools/perf/util/scripting-engines/trace-event-python.c
> @@ -694,6 +694,9 @@ static int regs_map(struct regs_dump *regs, uint64_t mask, char *bf, int size)
>
> bf[0] = 0;
>
> + if (!regs || !regs->regs)
> + return 0;
> +
> for_each_set_bit(r, (unsigned long *) &mask, sizeof(mask) * 8) {
> u64 val = regs->regs[i++];
>
> --
> 2.25.1
>
--
- Arnaldo
Powered by blists - more mailing lists