From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id CVjbBVMaDmoq3AoAWB0awg (envelope-from ) for ; Wed, 20 May 2026 16:32:19 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=FbAT8mxE; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 0B1711E024; Wed, 20 May 2026 16:32:19 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 E77E61E024 for ; Wed, 20 May 2026 16:32:16 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 413AE4BA79A9 for ; Wed, 20 May 2026 20:32:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 413AE4BA79A9 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=FbAT8mxE Received: from MW6PR02CU001.outbound.protection.outlook.com (mail-westus2azlp170120002.outbound.protection.outlook.com [IPv6:2a01:111:f403:c007::2]) by sourceware.org (Postfix) with ESMTPS id 5B3144BA2E0D for ; Wed, 20 May 2026 20:31:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5B3144BA2E0D Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=amd.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5B3144BA2E0D Authentication-Results: sourceware.org; arc=fail smtp.remote-ip=2a01:111:f403:c007::2 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1779309102; cv=fail; b=i9pNs3MxgcSSK0zkj5S+2nqBQdPACfHLN/FwPe5qlkO+eHSp6Iy+aV0bFqPvPvefQIu+Rhya8mx4cvNPZR4/UZ7HXOhpKdpYZu1qvYoewcsYTopXZdUGl2NyjK2RuKtHw5TXvM87EFaEXC6w+wUqFZls+Fy6OIX2eBtnkVM7Yl0= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1779309102; c=relaxed/simple; bh=tY1cXTJvraZ/amTumwsHUf5DVJjN7aXRJA8q+ZDjxPc=; h=DKIM-Signature:Message-ID:Date:Subject:To:From:MIME-Version; b=n6bUDVuxMn/Ssz2oqhJuqjdt/OcvHBY1BGBTUbKM4WNgUvM2rGXI5a/MJXgok6ib3Qtqgw0JVYWcZilh97hFcG05o3baDaJyTfcpmKoyw3jRoVCw/fntg5D49eCVN2hueFeFOJEka9uINS3OJ0Yk9ygPbE2U/xnHWKN5NYCTws8= ARC-Authentication-Results: i=2; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=FbAT8mxE DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5B3144BA2E0D ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IqHtALHGaLmxSS1+jYRK4ieJq2Q7RyAkdoj0C6MtBFxY+g6r4FH6fij/u5CmSTVM8TGOxLX88BtFpHvUi8zIS6D6APyg9B70rqGvvtiSTqDLofL0a8IiiuwlCPAB/YvuJj4XBqyhrx1F7hpPPu5Two6Qj2/asG950DRnmVLMpqWRjk7K3gqGV7E3MuYwPg3S/i9AgEviVyeIP/l+7A778N67jhj50EjcXVzDhjhL1tKo7d3WI/yJe/XHaUEwLTks++LqwFgWL4JbQbDjfK895wZGgLE884vG9Qst1u7qNuwTDozh8e+WmCkeciiDLhdEqyv6iPHzqb6vhAvLDYYdIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=p8ehf0uPzDjpCOJnT5mr7kyuLSB8xM5id3OJMcReYAg=; b=ewSdii/D0OsYJa7l6WUT5CnOH6RtrS74kh7cyo3scSYr6UyyweSH/FmBky/gey9PpUprlNIPkKCTS1PZKRhB5Qm6C4KaJh5z5U4+sp7680IgdVlk8ZOXswzCexw0wWdR7cnCQE+ReBLcouejC70x21zeMzx8XqvtP9ktvpmrv5q8Fw7K6FHC87dr8KftWBph5LyZ2EhSjLLqM1ZrNmwDFnFo90B6cbRHg/RZijaTbjrQI8Ir2gkskD6QGe+snkmDlo8gNDHqMdvVv1G1p05pm84Ir5ACl8WiAhzjCOpqwY7uPn+DYEMQHqRHrMTFSvU/wo6ONmK7HMrV/Xx5p2FJ4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p8ehf0uPzDjpCOJnT5mr7kyuLSB8xM5id3OJMcReYAg=; b=FbAT8mxEfEl+WwiDvfiQyi68RixZsPI46TEoG/3iCHZILkXF2xyjRC9+/B/D97lQPIMaicF/w7dOlYixSb5ISAf6YveuCEaKyVilgYNTMndH9icusVrGcZxSBzrAAD5sW8WG5g+ToJO7yi5Vj4F/EqXECsfOy5x8dHA+Fd8tM6k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH3PR12MB9079.namprd12.prod.outlook.com (2603:10b6:610:1a1::9) by MN0PR12MB6127.namprd12.prod.outlook.com (2603:10b6:208:3c5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.25.24; Wed, 20 May 2026 20:31:35 +0000 Received: from CH3PR12MB9079.namprd12.prod.outlook.com ([fe80::5a7a:2adf:1862:35c3]) by CH3PR12MB9079.namprd12.prod.outlook.com ([fe80::5a7a:2adf:1862:35c3%5]) with mapi id 15.21.0048.016; Wed, 20 May 2026 20:31:34 +0000 Message-ID: Date: Wed, 20 May 2026 21:31:30 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] gdb/amd-dbgapi-target: suppress a repeated stop request To: Tankut Baris Aktemur , gdb-patches@sourceware.org References: <20260520115215.2042499-1-tankutbaris.aktemur@amd.com> Content-Language: en-US From: Lancelot SIX In-Reply-To: <20260520115215.2042499-1-tankutbaris.aktemur@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR4P281CA0108.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:bb::17) To CH3PR12MB9079.namprd12.prod.outlook.com (2603:10b6:610:1a1::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR12MB9079:EE_|MN0PR12MB6127:EE_ X-MS-Office365-Filtering-Correlation-Id: 43573a8a-96b3-4398-b58f-08deb6aec8fe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|3023799007|13003099007|56012099003|11063799006|18002099003|22082099003|5023799004|6133799003; X-Microsoft-Antispam-Message-Info: xux6vtVHKx90sr05cCL7H1+BdCeRInKZ5kn193KNkJAMFekxNjMhN/Rjc8ljWHeKXub9UNh36IeFGOZKzS3g1X12ULACrWAuPnHaDxzQBNv236c5v7KingT9hpfa4zj4+9ZfhhEMNYLAsTvrZKJYKbLM5SvZFjltADeldanux9B2idDhyUOpuO602ZRLEBktCkQOhdgglhItA/o9w72U0k1DbXY6121HmNWtlus3XmB+PpPd+hN38q/GidYp4Lg99TkwFnpJekXrrulNy6LtTMWKF4aHwDJgB7gi4MKjgqEs1dcrqp7VhSe42trd/eIp3QL5cYaCJDDay/06hyYul/N34YfvKnwlZTM4Lvveh4JdnAbosssQbyO/12AtNK19E0XNBEF3t14vHidohRfoME5A23psxc5RZsYD+BSN5hltYJtzMJ9eqZS7e5qb8EMdgX+mq/uZOlfDrBdXC0p5g2YXekHyQvyhBKJCmbZutdPFAFCJLVaLkoNj03EMA81USiDLfRmZ2ta20ntcRy9FmPFJRlqkoFzsTb0wGhmZppYqq6xCV7YhRlklQ1U5XXO6yOAQUp1YHqVcHU5vgXSQpM20+K6HDJBXrmJ04AbcVlnCR7/1jfcLTXBbaHbu4pyCOcLgWFLEPBQObSMSCbu9lYMZ8oyp1yM4/IteqkET2Ffb6fudLwP9iTupIfIMv6LOE+fOyXiay09rw8atJ6ytow== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH3PR12MB9079.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024)(3023799007)(13003099007)(56012099003)(11063799006)(18002099003)(22082099003)(5023799004)(6133799003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-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ZEJabm16emhoRDZl?= =?utf-8?B?Qnh2TUI5dHdES1NFaTlQMG5IRWdXOTBUVFZUdUJwMEFvZWNyS0VwRlFkWWk0?= =?utf-8?B?Y0wvamdPSENVa2o0bXlQWnJNTXlkMkJCUlcxMU5zamg4NUp5Y0ZaSDVOdFdW?= =?utf-8?B?bHF2YW9mK29uWDlGZ0p6Ri9RQldpZFR1dzVqZS9UMUdGRUhOa3phWlRWZUJp?= =?utf-8?B?enZMZzFRYnV2WmpsQjhvYUJCa1NxUzZTOVFvd2Q0NUxDZTdWZlNaZzBDRGdz?= =?utf-8?B?NjJYR3VGV2dDNCtLeFloMkdCdkNzZ1BySW5jNVphK1VZK0hTandGTC92NXBr?= =?utf-8?B?TlhHblh2ZmlWQ0FxMTZPTVcvNE9Tc2kwekx6M295Smp5RW9lUzlpYVJ5RkE5?= =?utf-8?B?WEZrQytzK0d1UFNjeUIvRWZ5NW8xMjNYVCtjdHUzSjVUd3VXQ0VhcHZ0ZURV?= =?utf-8?B?TzBLSzZmdDVVUkdlUTMrUUpDcTA2NXBKNmRtS3hCMGR6WnFweHF4bHVnTkdl?= =?utf-8?Q?PMG3Z6LNW/99YSputo?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 43573a8a-96b3-4398-b58f-08deb6aec8fe X-MS-Exchange-CrossTenant-AuthSource: CH3PR12MB9079.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2026 20:31:34.7244 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: I2CwgFmf87dTFL/fQCqrqV4Tao0cEgT3PZ2vyET1KJAIjFndwYi3AOKHVcf30BHfTZnNJayWxGIFCGEQcxzm3w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6127 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 Hi, On 20/05/2026 12:52, Tankut Baris Aktemur wrote: > This revision uses a nested gdb_test_multiple/gdb_test when defining > the user command in the test. > > Regards, > Baris > > ==== > > Sending a second stop request to an AMD GPU thread before fetching the > event caused by the first request leads to an error: > > wave_stop for wave_1 failed (The wave has an outstanding stop request) > > Prevent sending a new stop request if there already is an outstanding > one. The fix is in amd_dbgapi_target::stop. > > A regression test is included. The test uses non-stop mode and > executes the "interrupt" command twice, because in non-stop mode this > command uses the 'stop' target op, where the fix is applied. > > To be able to execute two interrupt commands repeatedly, we define a > user command. > --- > gdb/amd-dbgapi-target.c | 8 ++- > gdb/testsuite/gdb.rocm/interrupt-twice.cpp | 43 +++++++++++++ > gdb/testsuite/gdb.rocm/interrupt-twice.exp | 75 ++++++++++++++++++++++ > 3 files changed, 123 insertions(+), 3 deletions(-) > create mode 100644 gdb/testsuite/gdb.rocm/interrupt-twice.cpp > create mode 100644 gdb/testsuite/gdb.rocm/interrupt-twice.exp > > diff --git a/gdb/amd-dbgapi-target.c b/gdb/amd-dbgapi-target.c > index 421ec8599ed..d44f03d0b80 100644 > --- a/gdb/amd-dbgapi-target.c > +++ b/gdb/amd-dbgapi-target.c > @@ -1090,14 +1090,16 @@ amd_dbgapi_target::stop (ptid_t ptid) > sizeof (state), &state); > if (status == AMD_DBGAPI_STATUS_SUCCESS) > { > - /* If the wave is already known to be stopped then do nothing. */ > - if (state == AMD_DBGAPI_WAVE_STATE_STOP) > + wave_info &wi = get_thread_wave_info (thread); > + > + /* If the wave is already known to be stopped or there is an > + outstanding stop request, then do nothing. */ > + if (state == AMD_DBGAPI_WAVE_STATE_STOP || wi.stopping) > return; > > status = amd_dbgapi_wave_stop (wave_id); > if (status == AMD_DBGAPI_STATUS_SUCCESS) > { > - wave_info &wi = get_thread_wave_info (thread); > wi.stopping = true; > return; > } > diff --git a/gdb/testsuite/gdb.rocm/interrupt-twice.cpp b/gdb/testsuite/gdb.rocm/interrupt-twice.cpp > new file mode 100644 > index 00000000000..fc8d2cca697 > --- /dev/null > +++ b/gdb/testsuite/gdb.rocm/interrupt-twice.cpp > @@ -0,0 +1,43 @@ > +/* Copyright 2026 Free Software Foundation, Inc. > + > + This file is part of GDB. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see . */ > + > +#include > +#include "gdb_watchdog.h" > + > +__device__ void > +loop () > +{ > + while (true) > + __builtin_amdgcn_s_sleep (8); > +} > + > +__global__ void > +kern () > +{ > + loop (); > +} > + > +int > +main () > +{ > + /* Make sure that if anything goes wrong, the program eventually > + gets killed. */ > + gdb_watchdog (30); > + > + kern<<<1, 1>>> (); > + return hipDeviceSynchronize () != hipSuccess; > +} > diff --git a/gdb/testsuite/gdb.rocm/interrupt-twice.exp b/gdb/testsuite/gdb.rocm/interrupt-twice.exp > new file mode 100644 > index 00000000000..3c653547dc2 > --- /dev/null > +++ b/gdb/testsuite/gdb.rocm/interrupt-twice.exp > @@ -0,0 +1,75 @@ > +# Copyright 2026 Free Software Foundation, Inc. > + > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; either version 3 of the License, or > +# (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program. If not, see . > + > +# Test that sending repeated stop requests to a running GPU thread > +# does not cause a failure. This is done in non-stop mode because > +# "interrupt" command in this mode uses the 'stop' target op. > + > +load_lib rocm.exp > + > +require allow_hipcc_tests > + > +standard_testfile .cpp > + > +if {[build_executable "failed to prepare" $testfile $srcfile {debug hip}]} { > + return > +} > + > +with_rocm_gpu_lock { > + save_vars { ::GDBFLAGS } { > + append ::GDBFLAGS " -ex \"set non-stop on\"" > + clean_restart $::testfile > + } > + > + gdb_breakpoint "loop" {allow-pending} {temporary} > + gdb_run_cmd > + > + set gpu_thread "undefined" > + > + gdb_test_multiple "" "hit breakpoint" { > + -re -wrap "Thread ($decimal) \[^\r\n\]*hit Temporary breakpoint.*" { > + set gpu_thread $expect_out(1,string) > + pass $gdb_test_name > + } > + } > + > + gdb_test "thread $gpu_thread" "Switching to.*" "switch to gpu thread" > + > + # Resume the thread in the background. It will loop. Then we > + # interrupt twice. To be able to run the "interrupt" command back > + # to back, we define a user command. > + gdb_test "continue &" "Continuing." "continue async" > + > + gdb_test_multiple "define inttwice" "" { > + -re "End with .*\r\n>$" { > + gdb_test "interrupt\ninterrupt\nend" "" $gdb_test_name > + } > + } > + > + # For logging purposes. > + gdb_test "show user inttwice" Not sure this is needed, but if we really have it, shouldn't we check the output? gdb_test "show user inttwice" \ [multi_line \ "User command \"inttwice\":" \ "\[\t \]*interrupt" \ "\[\t \]*interrupt" \ ""] > + > + gdb_test_multiple "inttwice" "interrupt twice" { > + -re "wave_stop \[^\r\n\]+ failed \[^\r\n\]+ outstanding stop request\\)\r\n" { > + fail $gdb_test_name > + } > + -re "Thread $gpu_thread \[^\r\n\]*stopped" { > + pass $gdb_test_name > + } > + -re "$gdb_prompt" { I expect this should be (with " $") -re "$gdb_prompt $" { > + exp_continue > + } > + } > +} With this adjusted, this LGTM, thanks. I have tested this on gfx1031, and also applied to downstream rocgdb. Best, Lancelot. Approved-by: Lancelot Six (amdgpu)