From: sashiko-bot@kernel.org
To: "Athira Rajeev" <atrajeev@linux.ibm.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf bench breakpoint: Isolate watched variable to prevent SIGTRAP in active_thread
Date: Wed, 02 Dec 2026 09:26:25 +0000 [thread overview]
Message-ID: <sashiko-outbox-245301@kernel.org> (raw)
In-Reply-To: <20261202092048.62028-1-atrajeev@linux.ibm.com>
> While running the new 'perf bench tests' suite introduced in the series
> "perf tests: Add coverage for the untested perf subcommands", a SIGTRAP
> core dump was observed on powerpc (ppc64le) when running:
>
> # ./perf bench breakpoint enable -p 1 -a 1
> # Running 'breakpoint/enable' benchmark:
> Trace/breakpoint trap (core dumped)
>
> In bench_breakpoint_enable(), 'done' (flag passed to active_thread)
> and 'watched' (the target of the hardware read/write watchpoint) are both
> allocated as adjacent local stack variables:
>
> &watched = stack_base + 3 (1 byte)
> &done = stack_base + 4 (4 bytes)
>
> On powerpc, hardware watchpoint match ranges are always 8-byte doubleword
> aligned (HW_BREAKPOINT_SIZE = 8). As a result, 'watched' and 'done' fall
> within the exact same 8-byte aligned doubleword window
> [stack_base ... stack_base + 7].
>
> When active_thread actively spins loading 'done', every atomic load
> instruction hits the hardware watchpoint set on 'watched', triggering
> an unhandled SIGTRAP and terminating the benchmark.
>
> Fix this by dynamically allocating 'watched' on the heap so it does
> not share an aligned doubleword with stack variables.
>
> Fixes: 68a6772f11dbb ("perf bench: Add breakpoint benchmarks")
> Signed-off-by: Athira Rajeev <atrajeev@linux.ibm.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261202092048.62028-1-atrajeev@linux.ibm.com?part=1
prev parent reply other threads:[~2026-12-02 9:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 9:20 [PATCH] perf bench breakpoint: Isolate watched variable to prevent SIGTRAP in active_thread Athira Rajeev
2026-12-02 9:26 ` 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-245301@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=atrajeev@linux.ibm.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