[PATCH v2 0/2] scripts/gdb: fix radix tree lookup and stack depot diagnostic

From: Ting-Han Hou

Date: Sat Oct 10 2026 - 22:31:04 EST


Andrew, here are the two scripts/gdb fixes as a series, as requested.

Patch 1 fixes $lx_radix_tree_lookup(), which dereferenced slot contents
as if they were node pointers. v2 also handles the XArray sibling,
retry and zero entries that Sashiko pointed out: they carry the
internal tag but are not node pointers, and the v1 patch raised a GDB
MemoryError on them. Large folios in the page cache make sibling
entries common, so this was worth fixing rather than documenting.

Patch 2 is unchanged from v1 apart from being resent with git
send-email, since the earlier copy was word-wrapped by the mail
client. Sorry about that.

Both patches are tested against standalone GCC-built fixtures that use
the kernel struct layouts (details below the --- line of each patch),
not against a running kernel.

v1:
https://lore.kernel.org/r/CA+NtrhTyE4J-C2=hSUXYc+NJBsQeYvbwJb+-ROHE1QQP-_gYzg@xxxxxxxxxxxxxx/
https://lore.kernel.org/r/CA+NtrhTQXdQRWe+pRJHyKxPPgsF7Ob5R41Xm3dAJ54OfT2_z5A@xxxxxxxxxxxxxx/

Ting-Han Hou (2):
scripts/gdb: Fix radix tree lookup pointer handling
scripts/gdb: Fix stack depot out-of-bounds diagnostic

scripts/gdb/linux/radixtree.py | 66 ++++++++++++++++++++-------------
scripts/gdb/linux/stackdepot.py | 2 +-
2 files changed, 41 insertions(+), 27 deletions(-)

--
2.53.0