From: sashiko-bot@kernel.org
To: "Namhyung Kim" <namhyung@kernel.org>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v3 3/4] perf symbol: Set dso symtab type for libbfd
Date: Tue, 13 Oct 2026 00:08:01 +0000 [thread overview]
Message-ID: <sashiko-outbox-168776@kernel.org> (raw)
In-Reply-To: <20261012235938.87912-3-namhyung@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] perf: missing dso__set_binary_type() initialization for libbfd bypass
--
commit 3d059164c2c17ae3b0ec344af1e8527af000eee5
Author: Namhyung Kim <namhyung@kernel.org>
perf symbol: Set dso symtab type for libbfd
It missed to set the dso symtab type when the symbols are loaded by
libbfd. When it happens both syms_ss and runtime_ss may not be set
and won't call dso__load_sym().
> diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
> index 4878d4292eb85..a90ce714b174b 100644
> --- a/tools/perf/util/symbol.c
> +++ b/tools/perf/util/symbol.c
> @@ -1925,6 +1925,7 @@ int dso__load(struct dso *dso, struct map *map)
> nsinfo__mountns_enter(dso__nsinfo(dso), &nsc);
>
> if (bfdrc > 0) {
> + dso__set_symtab_type(dso, symtab_type);
[Severity: Medium]
When dso__load_bfd_symbols() succeeds and we take this early return path, does
this code also need to set the DSO's binary_type and cross-platform
architecture flags?
By taking this goto out_destroy, the rest of the DSO initialization loop is
bypassed. This leaves the binary_type as DSO_BINARY_TYPE__NOT_FOUND. Later,
when dso__data_fd() attempts to read instruction bytes for perf annotate or
Intel PT decoding, try_to_open_dso() will restrict its search to only
BUILD_ID_CACHE and SYSTEM_PATH_DSO since the actual discovery path wasn't
recorded.
Additionally, bypassing dso__load_sym() means is_64_bit won't be set, which
causes it to incorrectly default to the host perf binary's pointer size. This
breaks cross-platform analysis of 32-bit files on 64-bit hosts.
> ret = 1;
> goto out_destroy;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261012235938.87912-1-namhyung@kernel.org?part=3
next prev parent reply other threads:[~2026-10-13 0:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 23:59 [PATCH v3 1/4] perf symbol: Fix symbol loading from libbfd Namhyung Kim
2026-10-12 23:59 ` [PATCH v3 2/4] iperf symbol: Add missing symsrc__destroy() for libbfd Namhyung Kim
2026-10-13 0:04 ` sashiko-bot
2026-10-12 23:59 ` [PATCH v3 3/4] perf symbol: Set dso symtab type " Namhyung Kim
2026-10-13 0:08 ` sashiko-bot [this message]
2026-10-13 6:23 ` Namhyung Kim
2026-10-12 23:59 ` [PATCH v3 4/4] perf test: Update PE file test for other locations Namhyung Kim
2026-10-13 0:08 ` sashiko-bot
2026-10-13 6:25 ` Namhyung Kim
2026-10-13 0:08 ` [PATCH v3 1/4] perf symbol: Fix symbol loading from libbfd sashiko-bot
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=sashiko-outbox-168776@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=namhyung@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