[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <157544603366.21853.9385477064122064495.tip-bot2@tip-bot2>
Date: Wed, 04 Dec 2019 07:53:53 -0000
From: "tip-bot2 for Arnaldo Carvalho de Melo" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Jiri Olsa <jolsa@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Namhyung Kim <namhyung@...nel.org>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
x86 <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: [tip: perf/urgent] perf machine: Fill map_symbol->maps in
append_inlines() to fix segfault
The following commit has been merged into the perf/urgent branch of tip:
Commit-ID: 77b91c1a525d84cb560a4baef6f5f548b5c23f80
Gitweb: https://git.kernel.org/tip/77b91c1a525d84cb560a4baef6f5f548b5c23f80
Author: Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Fri, 29 Nov 2019 15:47:51 -03:00
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitterDate: Fri, 29 Nov 2019 16:11:06 -03:00
perf machine: Fill map_symbol->maps in append_inlines() to fix segfault
I forgot to fill in the map_symbol->maps field in append_inlines() which
then makes code down the line segfault when trying to deref it.
It doesn't make any sense to have an addr_location with its 'map' member
not NULL while its 'maps' is NULL, after all al->maps is where al->map
is in.
It is done that way so that we don't have to have in each 'struct map' a
pointer to the 'struct maps' it is in, as we had in the past when we
would have 'map->mg', before 'struct maps' was combined with 'struct
map_groups', because there was always a one-to-one relationship for
these structs.
This fixes a segfault when processing DWARF callgraphs in 'perf report'.
Reported-by: Jiri Olsa <jolsa@...nel.org>
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Fixes: 08f6680e627e ("perf tools: Add a 'struct map_groups' pointer to 'struct map_symbol'")
Link: http://lore.kernel.org/lkml/20191129160631.GD26963@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/machine.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 416d174..c8c5410 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -2446,6 +2446,7 @@ static int append_inlines(struct callchain_cursor *cursor, struct map_symbol *ms
list_for_each_entry(ilist, &inline_node->val, list) {
struct map_symbol ilist_ms = {
+ .maps = ms->maps,
.map = map,
.sym = ilist->symbol,
};
Powered by blists - more mailing lists