The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Yao Zhao <dragonlinux@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	James Clark <james.clark@linaro.org>,
	Jin Yao <yao.jin@linux.intel.com>,
	Ravi Bangoria <ravi.bangoria@amd.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 RESEND] perf annotate: fix annotate crash for fused instructions
Date: Tue, 24 Nov 2026 13:03:07 -0800	[thread overview]
Message-ID: <awX7ix4V3NZocdTp@google.com> (raw)
In-Reply-To: <20261116165438.694835-1-dragonlinux@gmail.com>

On Mon, Nov 16, 2026 at 11:54:36AM -0500, Yao Zhao wrote:
> Function is_fused tries to find the previous fused instruction with the
> current conditional jump instruction in the annotate_line list.
> disasm_line is the container of annotate_line.
> The annotate_line list uses list_head and the head is in annotated_source:
> notes->src which is not an annotate_line, so it couldn't walk without
> checking the list_head. If so it will read annoted_source neighbour memory
> mistakenly and most likely cause crash.
> 
> Fix the case where current instruction is a conditional jump and it is
> the first instruction in the disassembled list, the original code will
> walk to the head and treats it as disasm_line which is not.
> 
>     -------- backtrace --------
>     #0 0x564dd8d5d5cd in ui__signal_backtrace setup.c:0
>     #1 0x7f1737e3e6f0 libc.so.6[3e6f0]
>     #2 0x7f1737ec10b1 strstr-sse2-unaligned.S:41
>     #3 0x564dd8d625ef in intel__ins_is_fused annotate-x86.c:0
>     #4 0x564dd8d4bcde in annotate_browser__refresh annotate.c:0
>     #5 0x564dd8d49bd6 in __ui_browser__refresh.isra.0 browser.c:0
>     #6 0x564dd8d4a960 in ui_browser__run ??:0
>     #7 0x564dd8d4cbcf in __hist_entry__tui_annotate ??:0
>     #8 0x564dd8d50a91 in do_annotate hists.c:0
>     #9 0x564dd8d58bb1 in evsel__hists_browse hists.c:0
>     #10 0x564dd8d5a7fa in evlist__tui_browse_hists ??:0
>     #11 0x564dd8bf7a98 in cmd_report help.c:109
>     #12 0x564dd8c713e4 in handle_internal_command help.c:109
>     #13 0x564dd8bd6ac2 in main ??:0
>     #14 0x7f1737e27781 libc_start_call_main.h:83
>     #15 0x7f1737e278b9 in __libc_start_main libc-start.c:127
>     #16 0x564dd8bd7095 in _start help.c:109
> 
> Fixes: 7efbcc8c075c ("perf annotate: Fix fused instr logic for assembly functions")
> 
> Signed-off-by: Yao Zhao <dragonlinux@gmail.com>

Applied to perf-tools-next, thanks!

Best regards
Namhyung

      reply	other threads:[~2026-11-24 21:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <sashiko-outbox-214904@kernel.org>
2026-11-16 16:54 ` [PATCH v2 RESEND] perf annotate: fix annotate crash for fused instructions Yao Zhao
2026-11-24 21:03   ` Namhyung Kim [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=awX7ix4V3NZocdTp@google.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=dragonlinux@gmail.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --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=peterz@infradead.org \
    --cc=ravi.bangoria@amd.com \
    --cc=yao.jin@linux.intel.com \
    /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