From: sashiko-bot@kernel.org
To: "Ian Rogers" <irogers@google.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 3/3] perf annotate: Fix block_range symbol loss on split and leaks on exit
Date: Sat, 31 Oct 2026 06:47:56 +0000 [thread overview]
Message-ID: <sashiko-outbox-191788@kernel.org> (raw)
In-Reply-To: <20261031063549.1281324-4-irogers@google.com>
> When block_range__create() splits an existing struct block_range entry
> into a leading head range (entry->start < start) or a trailing tail
> range (end < entry->end), it copies coverage and branch statistics from
> the original entry into head/tail, but omits .sym = entry->sym. Because
> the returned iterator only spans [start, end], process_basic_block()
> never revisits the split-off head or tail range, leaving its .sym NULL
> and causing block_range__coverage() to return -1 on instructions in that
> split range.
>
> Additionally, the global block_ranges rbtree is never freed on exit from
> cmd_annotate(), and process_branch_stack() frees the resolved
> branch_info array without calling addr_map_symbol__exit() on bi[i].to
> and bi[i].from, leaking thread and map references acquired by
> sample__resolve_bstack().
>
> Preserve .sym = entry->sym when splitting head and tail in
> block_range__create(), add block_ranges__exit() and call it from
> cmd_annotate(), and release bi[i].to and bi[i].from in
> process_branch_stack().
>
> Fixes: 70fbe0574558 ("perf annotate: Add branch stack / basic block")
> Fixes: bffb5b0c0976 ("perf map/maps/thread: Changes to reference counting")
> Suggested-by: Alireza Haghdoost <haghdoost@uber.com>
> Signed-off-by: Ian Rogers <irogers@google.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261031063549.1281324-1-irogers@google.com?part=3
prev parent reply other threads:[~2026-10-31 6:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-31 6:35 [PATCH 0/3] perf symbols/callchain/annotate: Bug fixes from symbol reference counting review Ian Rogers
2026-10-31 6:35 ` [PATCH 1/3] perf callchain: Fix loss of symbol in merge_chain_branch() Ian Rogers
2026-10-31 6:39 ` sashiko-bot
2026-10-31 6:35 ` [PATCH 2/3] perf symbol-elf: Fix zero-size symbol end calculation across .symtab and .dynsym Ian Rogers
2026-10-31 6:41 ` sashiko-bot
2026-10-31 6:35 ` [PATCH 3/3] perf annotate: Fix block_range symbol loss on split and leaks on exit Ian Rogers
2026-10-31 6:47 ` sashiko-bot [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=sashiko-outbox-191788@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.