From: sashiko-bot@kernel.org
To: "Ian Rogers" <irogers@google.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v1 1/2] perf libdw: Fix Dwfl discovery with split files
Date: Mon, 14 Sep 2026 17:30:07 +0000 [thread overview]
Message-ID: <20260914173007.9DFD91F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260914170759.1992947-1-irogers@google.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Early error return in `cmd__addr2line` leaves the addr2line subprocess pipe in a dirty state, corrupting subsequent IPC queries.
--
commit 15f52b88a78ae8721f4ec48695f230d6450c86f6
Author: Ian Rogers <irogers@google.com>
perf libdw: Fix Dwfl discovery with split files
This patch dynamically frees the cached Dwfl object and alternative a2l
caches whenever a newly discovered split-debug file is assigned to a
dso, and scopes accessors behind a mutex.
> diff --git a/tools/perf/util/addr2line.c b/tools/perf/util/addr2line.c
> index 4b0d349ed334b..7c7eea3cc8dd2 100644
> --- a/tools/perf/util/addr2line.c
> +++ b/tools/perf/util/addr2line.c
[ ... ]
> @@ -414,12 +426,21 @@ int cmd__addr2line(const char *dso_name, u64 addr,
> }
>
> out:
> + mutex_lock(dso__lock(dso));
> free(record_function);
> free(record_filename);
> - if (io.eof) {
> - dso__set_a2l(dso, NULL);
> +
> + current_dso_name = dso__symsrc_filename(dso) ?: dso__long_name(dso);
> + if (!io.eof && dso__a2l(dso) == NULL && current_dso_name &&
> + !strcmp(current_dso_name, dso_name))
> + dso__set_a2l(dso, a2l);
[Severity: High]
This is a pre-existing issue, but an early error return in cmd__addr2line()
(such as a memory allocation failure when calling inline_list__append_record()
or a parsing failure in read_addr2line_record()) aborts the read loop and
jumps here without consuming the rest of the IPC stream.
Since EOF is not reached during an early abort, does this incorrectly
restore the dirty subprocess pipe back into the cache? It appears this
leaves unread output in the pipe, which could corrupt subsequent address
resolutions for this DSO when other threads query it and read the
leftover garbage data.
> + else
> addr2line_subprocess_cleanup(a2l);
> - }
> + mutex_unlock(dso__lock(dso));
> + return ret;
> +
> +out_unlock:
> + mutex_unlock(dso__lock(dso));
> return ret;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260914170759.1992947-1-irogers@google.com?part=1
next prev parent reply other threads:[~2026-09-14 17:30 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 17:07 [PATCH v1 1/2] perf libdw: Fix Dwfl discovery with split files Ian Rogers
2026-09-14 17:07 ` [PATCH v1 2/2] perf dso: Separate libbfd and cmd addr2line caches to fix confusion Ian Rogers
2026-09-14 17:24 ` sashiko-bot
2026-09-14 17:30 ` sashiko-bot [this message]
2026-09-16 6:35 ` [PATCH v2 0/3] perf srcline: Fix addr2line cache and fallback bugs Ian Rogers
2026-09-16 6:35 ` [PATCH v2 1/3] perf libdw: Fix Dwfl discovery with split files Ian Rogers
2026-09-16 6:52 ` sashiko-bot
2026-09-16 6:35 ` [PATCH v2 2/3] perf dso: Separate libbfd and cmd addr2line caches to fix confusion Ian Rogers
2026-09-16 6:47 ` sashiko-bot
2026-09-16 6:35 ` [PATCH v2 3/3] perf libbfd: Report success when an address is found Ian Rogers
2026-09-16 6:47 ` sashiko-bot
2026-09-16 23:43 ` [PATCH v3 0/3] perf srcline: Fix addr2line cache and fallback bugs Ian Rogers
2026-09-16 23:44 ` [PATCH v3 1/3] perf libdw: Fix Dwfl discovery with split files Ian Rogers
2026-09-17 0:03 ` sashiko-bot
2026-09-16 23:44 ` [PATCH v3 2/3] perf dso: Separate libbfd and cmd addr2line caches to fix confusion Ian Rogers
2026-09-16 23:54 ` sashiko-bot
2026-09-16 23:44 ` [PATCH v3 3/3] perf libbfd: Report success when an address is found Ian Rogers
2026-09-16 23:54 ` sashiko-bot
2026-09-17 5:04 ` [PATCH v4 0/3] perf srcline: Fix addr2line cache and fallback bugs Ian Rogers
2026-09-17 5:04 ` [PATCH v4 1/3] perf libdw: Fix Dwfl discovery with split files Ian Rogers
2026-09-17 5:20 ` sashiko-bot
2026-09-17 5:04 ` [PATCH v4 2/3] perf dso: Separate libbfd and cmd addr2line caches to fix confusion Ian Rogers
2026-09-17 5:12 ` sashiko-bot
2026-09-17 5:04 ` [PATCH v4 3/3] perf libbfd: Report success when an address is found Ian Rogers
2026-09-17 5:16 ` sashiko-bot
2026-09-18 20:25 ` [PATCH v3 0/3] perf srcline: Fix addr2line cache and fallback bugs Arnaldo Carvalho de Melo
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=20260914173007.9DFD91F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=irogers@google.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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