Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf unwind-libdw: Fix invalid reference counts

The addition of addr_location__exit() causes use-after put on the maps
and map references in the unwind info. Add the gets and then add the
map_symbol__exit() calls.

Fixes: 0dd5041c9a0eaf8c ("perf addr_location: Add init/exit/copy functions")
Reviewed-by: James Clark <james.clark@linaro.org>
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Howard Chu <howardchu95@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephen Brennan <stephen.s.brennan@oracle.com>
Cc: Tony Jones <tonyj@suse.de>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
f815fc0c ef92c435

+5 -2
+5 -2
tools/perf/util/unwind-libdw.c
··· 136 136 } 137 137 138 138 e->ip = ip; 139 - e->ms.maps = al.maps; 140 - e->ms.map = al.map; 139 + e->ms.maps = maps__get(al.maps); 140 + e->ms.map = map__get(al.map); 141 141 e->ms.sym = al.sym; 142 142 143 143 pr_debug("unwind: %s:ip = 0x%" PRIx64 " (0x%" PRIx64 ")\n", ··· 324 324 out: 325 325 if (err) 326 326 pr_debug("unwind: failed with '%s'\n", dwfl_errmsg(-1)); 327 + 328 + for (i = 0; i < ui->idx; i++) 329 + map_symbol__exit(&ui->entries[i].ms); 327 330 328 331 dwfl_end(ui->dwfl); 329 332 free(ui);