linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] tools/perf: Fix perf probe crash by broken DWARF file
@ 2022-11-01 13:14 Masami Hiramatsu (Google)
  2022-11-01 13:14 ` [PATCH 1/3] tools/perf: Fix to avoid crashing with a " Masami Hiramatsu (Google)
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Masami Hiramatsu (Google) @ 2022-11-01 13:14 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, linux-perf-users, linux-kernel,
	Masami Hiramatsu, Steven Rostedt

Hi,

Here is a series of patches for perf probe which improves the robustness
against broken DWARF file.

Since the Clang generates the out of standard DWARF5 file, the perf probe
crashes or failed to analyze it. There are actually fragile code against
it, so I fixed it ([1/3]) to avoid crash by SEGV. And make it accepts
Clang's DWARF5 file ([2/3],[3/3]).

Without this series, the perf probe crashes with the DWARF5 file
which generated by clang as below;
 
  $ ./perf probe -k $BIN_PATH/vmlinux -s $SRC_PATH -L vfs_read:10
  Segmentation fault

This series fixes it to handle such file correctly;

  $ ./perf probe -k $BIN_PATH/vmlinux -s $SRC_PATH -L vfs_read:10
  <vfs_read@$SRC_PATH/fs/read_write.c:10>
 
       11         ret = rw_verify_area(READ, file, pos, count);
       12         if (ret)
                           return ret;

This issue is reported on LLVM ML;
https://www.mail-archive.com/dwarf-discuss@lists.dwarfstd.org/msg00884.html

Thank you,

---

Masami Hiramatsu (Google) (3):
      tools/perf: Fix to avoid crashing with a broken DWARF file
      tools/perf: Fix to use dwarf_attr_integrate for generic attr accessor
      tools/perf: Fix to get declared file name from broken DWARF5


 tools/perf/util/dwarf-aux.c    |   58 ++++++++++++++++++++++++++++------------
 tools/perf/util/dwarf-aux.h    |    3 ++
 tools/perf/util/probe-finder.c |   37 +++++++++++++++++---------
 3 files changed, 68 insertions(+), 30 deletions(-)

--
Masami Hiramatsu (Google) <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-11-01 13:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-01 13:14 [PATCH 0/3] tools/perf: Fix perf probe crash by broken DWARF file Masami Hiramatsu (Google)
2022-11-01 13:14 ` [PATCH 1/3] tools/perf: Fix to avoid crashing with a " Masami Hiramatsu (Google)
2022-11-01 13:14 ` [PATCH 2/3] tools/perf: Fix to use dwarf_attr_integrate for generic attr accessor Masami Hiramatsu (Google)
2022-11-01 13:14 ` [PATCH 3/3] tools/perf: Fix to get declared file name from broken DWARF5 Masami Hiramatsu (Google)
2022-11-01 13:29 ` [PATCH 0/3] tools/perf: Fix perf probe crash by broken DWARF file Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).