diff options
author | Masami Hiramatsu (Google) <[email protected]> | 2022-11-01 22:48:30 +0900 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2022-11-03 09:24:46 -0300 |
commit | 98e4c68ddcaf3721df9bef809775a8e3562cb6f9 (patch) | |
tree | ad08eef840c71feef1c18d539195608750392930 /lib/string_helpers.c | |
parent | 940da138b03ecb5bca68ef51dc1141f115100eed (diff) |
perf probe: Fix to avoid crashing if DW_AT_decl_file is NULL
Since clang generates DWARF5 which sets DW_AT_decl_file as 0,
dwarf_decl_file() thinks that is invalid and returns NULL. In that case
'perf probe' SIGSEGVs because it doesn't expect a NULL decl_file.
This adds a dwarf_decl_file() return value check to avoid such SEGV with
clang generated DWARF5 info.
Without this, 'perf probe' crashes:
$ perf probe -k $BIN_PATH/vmlinux -s $SRC_PATH -L vfs_read:10
Segmentation fault
$
With this, it just warns about it:
$ perf probe -k $BIN_PATH/vmlinux -s $SRC_PATH -L vfs_read:10
Debuginfo analysis failed.
Error: Failed to show lines.
$
Signed-off-by: Masami Hiramatsu <[email protected]>
Acked-by: Namhyung Kim <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Steven Rostedt (VMware) <[email protected]>
Link: https://lore.kernel.org/r/166731051077.2100653.15626653369345128302.stgit@devnote3
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'lib/string_helpers.c')
0 files changed, 0 insertions, 0 deletions