From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [PATCH 0/6] Fix generating core files when GPU waves are present
Date: Fri, 16 Oct 2026 01:20:05 -0400 [thread overview]
Message-ID: <20261016052100.1386999-1-simon.marchi@efficios.com> (raw)
The thing that sparked this series is that we identified a problem in
rocgdb with the recently introduced get_ptid_for_slash_proc function.
When GPU waves are present, and especially when a GPU wave is selected,
get_ptid_for_slash_proc will return the ptid of such a wave to be used
for /proc accesses. All GPU waves have `lwp == 1`, which means GDB
attempts to read from /proc/1, which does not end well.
While looking for a way to expose this problem with what we currently
have upstream, I found that trying to generate a core dump while GPU
waves exist fails quite badly. The get_ptid_for_slash_proc problem is a
reason, but there are more issues.
The goal of this series is to make it possible to generate a host core
dump while GPU waves are active, and possibly one of those is selected.
It is not a goal of this series to dump the state of GPU waves.
Downstream rocgdb has this functionality, and we want to send it
upstream eventually, just not in this series.
Shahab Vahedi (1):
gdb/amd-dbgapi: defer TARGET_OBJECT_AUXV xfers to the beneath target
Simon Marchi (5):
gdb/testsuite: make with_rocm_gpu_lock transparent to return
gdb/corefile: handle no signalled thread when writing NT_GDB_TDESC
gdb/amd-dbgapi: handle regno == -1 in fetch_registers and
store_registers
gdb/linux-tdep: don't write core file notes for non-Linux threads
gdb/linux-tdep: ignore non-Linux threads in get_ptid_for_slash_proc
gdb/amd-dbgapi-target.c | 109 +++++++++------
gdb/elf-none-tdep.c | 7 +-
gdb/gcore.c | 27 ++--
gdb/gcore.h | 9 +-
gdb/linux-tdep.c | 64 ++++++---
gdb/testsuite/gdb.rocm/auxv-wave-selected.cpp | 42 ++++++
gdb/testsuite/gdb.rocm/auxv-wave-selected.exp | 65 +++++++++
gdb/testsuite/gdb.rocm/gcore-host.cpp | 42 ++++++
gdb/testsuite/gdb.rocm/gcore-host.exp | 125 ++++++++++++++++++
.../gdb.testsuite/with-rocm-gpu-lock.exp | 90 +++++++++++++
.../gcore-exited-selected-thread.c | 51 +++++++
.../gcore-exited-selected-thread.exp | 83 ++++++++++++
gdb/testsuite/lib/rocm.exp | 20 ++-
13 files changed, 661 insertions(+), 73 deletions(-)
create mode 100644 gdb/testsuite/gdb.rocm/auxv-wave-selected.cpp
create mode 100644 gdb/testsuite/gdb.rocm/auxv-wave-selected.exp
create mode 100644 gdb/testsuite/gdb.rocm/gcore-host.cpp
create mode 100644 gdb/testsuite/gdb.rocm/gcore-host.exp
create mode 100644 gdb/testsuite/gdb.testsuite/with-rocm-gpu-lock.exp
create mode 100644 gdb/testsuite/gdb.threads/gcore-exited-selected-thread.c
create mode 100644 gdb/testsuite/gdb.threads/gcore-exited-selected-thread.exp
base-commit: 835aee81fa93e587eb9ac73a79e911361ec46d6f
--
2.56.0
next reply other threads:[~2026-10-16 5:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 5:20 Simon Marchi [this message]
2026-10-16 5:20 ` [PATCH 1/6] gdb/testsuite: make with_rocm_gpu_lock transparent to return Simon Marchi
2026-10-16 5:20 ` [PATCH 2/6] gdb/corefile: handle no signalled thread when writing NT_GDB_TDESC Simon Marchi
2026-10-16 5:20 ` [PATCH 3/6] gdb/amd-dbgapi: handle regno == -1 in fetch_registers and store_registers Simon Marchi
2026-10-16 5:20 ` [PATCH 4/6] gdb/linux-tdep: don't write core file notes for non-Linux threads Simon Marchi
2026-10-16 5:20 ` [PATCH 5/6] gdb/amd-dbgapi: defer TARGET_OBJECT_AUXV xfers to the beneath target Simon Marchi
2026-10-16 5:20 ` [PATCH 6/6] gdb/linux-tdep: ignore non-Linux threads in get_ptid_for_slash_proc Simon Marchi
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=20261016052100.1386999-1-simon.marchi@efficios.com \
--to=simon.marchi@efficios.com \
--cc=gdb-patches@sourceware.org \
/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