From: Andrew Morton <akpm@linux-foundation.org>
To: Ting-Han Hou <ue081723@gmail.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
Kieran Bingham <kbingham@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scripts/gdb: Fix radix tree lookup pointer handling
Date: Sat, 10 Oct 2026 14:17:12 -0700 [thread overview]
Message-ID: <20261010141712.2db4491436e30110ccb5a25e@linux-foundation.org> (raw)
In-Reply-To: <CA+NtrhTyE4J-C2=hSUXYc+NJBsQeYvbwJb+-ROHE1QQP-_gYzg@mail.gmail.com>
On Wed, 7 Oct 2026 02:31:24 -0700 Ting-Han Hou <ue081723@gmail.com> wrote:
> lookup() casts each slot to a pointer to a node pointer and then
> dereferences it. Since the slot already contains an entry pointer,
> this reads the entry's contents as another pointer instead of
> returning the entry itself.
>
> Internal entries also need their tag bits removed before descending
> to the next node.
>
> Return non-internal entries directly and use entry_to_node() when
> descending through internal entries. Remove the explicit shift
> counter, as traversal now follows the entry type.
>
> Fixes: b7235d6bb516 ("scripts/gdb: add a Radix Tree Parser")
> Assisted-by: LLM
> Signed-off-by: Ting-Han Hou <ue081723@gmail.com>
> ---
> Tested with GDB 15.1 against standalone GCC-built C fixtures using the
> xarray/xa_node field layout, with XA_CHUNK_SHIFT=4 and 6. These are
> synthetic debugger fixtures, not a booted kernel or a kernel core dump.
>
> Before the fix, a one-level lookup returned the payload 0x12345678
> instead of its address; a two-level lookup missed a populated slot.
> After the fix, all 33 checks passed for each slot configuration (66
> total), including empty/direct roots, one- to three-level trees,
> zero-filled payloads, value entries, absent/out-of-range indices,
> struct/pointer roots, and the GDB convenience function.
>
> This does not test multi-index entries or concurrent updates/retry
> entries. The change is limited to the debugger lookup helper.
Thanks. Sashiko expressed a concern:
https://sashiko.dev/#/patchset/CA+NtrhTyE4J-C2=hSUXYc+NJBsQeYvbwJb+-ROHE1QQP-_gYzg@mail.gmail.com
your other patch doesn't apply due to word-wrapping.
Please turn these into a 2-patch series.
next prev parent reply other threads:[~2026-10-10 21:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-07 9:31 Ting-Han Hou
2026-10-09 18:10 ` Ting-Han Hou
2026-10-10 21:17 ` Andrew Morton [this message]
2026-10-11 2:30 ` [PATCH v2 0/2] scripts/gdb: fix radix tree lookup and stack depot diagnostic Ting-Han Hou
2026-10-11 2:30 ` [PATCH v2 1/2] scripts/gdb: Fix radix tree lookup pointer handling Ting-Han Hou
2026-10-11 2:30 ` [PATCH v2 2/2] scripts/gdb: Fix stack depot out-of-bounds diagnostic Ting-Han Hou
2026-10-11 3:58 ` [PATCH v2 0/2] scripts/gdb: fix radix tree lookup and stack depot diagnostic Andrew Morton
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=20261010141712.2db4491436e30110ccb5a25e@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=jan.kiszka@siemens.com \
--cc=kbingham@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ue081723@gmail.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
all inboxes | Powered by JetHome®