From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id I69fFVu00WoGRBcAWB0awg (envelope-from ) for ; Fri, 16 Oct 2026 01:21:31 -0400 Received: by simark.ca (Postfix, from userid 112) id 1682F1E050; Fri, 16 Oct 2026 01:21:31 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C92481E047 for ; Fri, 16 Oct 2026 01:21:28 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DAD244BA2E2A for ; Fri, 16 Oct 2026 05:21:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DAD244BA2E2A Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 8D9F54BA2E13 for ; Fri, 16 Oct 2026 05:21:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8D9F54BA2E13 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8D9F54BA2E13 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792128063; cv=none; b=adquDa0iqcpGL7VL1PZ/0d4E01uYnOa+gdc7zqAHqfpVYgv8V+hG/qVtxANDzxDB86TEuymwcKB4j5w6eKGdTV1dEJMJqsW+H8F/tBC3W5fgaE5iBDSKQFgu2JtYB5++BRd4oTQJRKnF9gcJs6hcuLgSwsulUK058OnQ4gB7+l8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792128063; c=relaxed/simple; bh=4gY/14xQzTnus7b59PyBgdTQEDxNvkOwONPjiQq4OYw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=sa7LojBq4jpJb8MiQtir4h4EC3TC6yDsmHQzAOiGQ2+u+ylaE1um21ATzn4IdNaNPweyeTQrniOEGc4AFgxZiI5bhyHmw86hbB3DGFqRLCNjRHJppkZq/9O25skl1ZJMDixtAl4Cgjm7YJ1Wv2vGtKIjq/iwr//wgsq45OfKN7w= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8D9F54BA2E13 Received: by simark.ca (Postfix) id ACCCF1E047; Fri, 16 Oct 2026 01:21:00 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 0/6] Fix generating core files when GPU waves are present Date: Fri, 16 Oct 2026 01:20:05 -0400 Message-ID: <20261016052100.1386999-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.56.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org 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