mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH 0/3] tools/perf: Fix perf probe crash by broken DWARF file
Date: Tue, 1 Nov 2022 22:29:59 +0900	[thread overview]
Message-ID: <20221101222959.0815521a31e45c1ddabad756@kernel.org> (raw)
In-Reply-To: <166730844138.2095228.4225918836201778608.stgit@devnote3>

On Tue,  1 Nov 2022 22:14:01 +0900
"Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:

> 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

Hmm, according to the discussion in this thread, this spec is under discussion
(still?). As far as I can see the "DWARF Debugging Information Format Version 5"
2.14, it says "The value 0 indicates that no source line has been specified."
But the description will be updated(?)
http://wiki.dwarfstd.org/index.php?title=DWARF5_Line_Table_File_Numbers

Let me update the series so that carefully remove the "broken". Maybe "clang"
DWARF5?

Thank you,

> 
> 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>


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

      parent reply	other threads:[~2022-11-01 13:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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)
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 ` Masami Hiramatsu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221101222959.0815521a31e45c1ddabad756@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®