From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id h01TLJ5wA2ogCDQAWB0awg (envelope-from ) for ; Tue, 12 May 2026 14:25:34 -0400 Received: by simark.ca (Postfix, from userid 112) id A0FB71E067; Tue, 12 May 2026 14:25:34 -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 0DB5F1E067 for ; Tue, 12 May 2026 14:25:34 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 691C44BB24EF for ; Tue, 12 May 2026 18:25:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 691C44BB24EF Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by sourceware.org (Postfix) with ESMTPS id 86C454BB24F5 for ; Tue, 12 May 2026 18:24:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 86C454BB24F5 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 86C454BB24F5 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778610299; cv=none; b=osa0gUlUnDnPLnnNWuMcAaJ5wKTfDUT7+6Nk9hyFpqB19y9Nfz5Zhh6w/dO0Fm/W9MZu61PrRLFLtu7sXmDzZcuTz5ls/c8G6gKZqsG/CddRKfE/EwqXviCFdDhr/HsT9TWHn98nq8dPeBLGYCibdMhEIcmGpXT4CoxsikGC8Yw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778610299; c=relaxed/simple; bh=BMAGznrvyNnYLyUfniMGu2ryOoJDooW+bQKgwqjE2w8=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=LHD23nygVvh7mErHoLP4HGY2sh5C48VoKI12j1HNKUKqJ99aw/OyreDTziSxMKRKmIv4nz5dlCgZ7ZUNmwwt+Pi8tOQMjapEqSCGXqcfRWJy/W1ErvW441yLDTzutqJfTAljcVexAID6rbYt4oBZXHcbhHvmlRBuIKAhvTqh5uQ= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 86C454BB24F5 Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-488b0e1b870so99460255e9.2 for ; Tue, 12 May 2026 11:24:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778610298; x=1779215098; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UC1FuA0crUiDp+aOgl6QZZ6+mcUpy16Np++7LQZ+LEk=; b=Gb0HXIHon/90K0gQd5pynN3yZTURoD2vSqDiLljXlvbk//BSgiUt+C5T8WqC4aqIf3 CM7oGVjuN3K49zwZxrv4BAtYQFi8QRfMWVH0Oig1HRWUVpNTEmW54xsBJq3YHtBzwLgn sb4rHRulXGzNAIXL8J0Zlfw6GvgEgtgcgSQ3niP8VtRkSnlCgeiAeytEdnt+/AZ/oY0U 5Dw4mhAzstIzH4DH8MnbNENirElj5EPpSOfVpMsMGdqDtKs6UY8svS3IxEQj+6ZTgNZu +8beyqJp2B8FaW2DQCmrhUs8fvI+mOrgIPdYS/C0jySSdHzUCs1wu4fBxSPCS0lB4P4L b9Qg== X-Forwarded-Encrypted: i=1; AFNElJ8YDqqYSilOBoo+l+OxtTmfO1ZJ9RHdCPJTk+ZWCmSk3J0ZKoVLdNuLKVz+/pp2gXkKt3SoaFmtwHXmzQ==@sourceware.org X-Gm-Message-State: AOJu0Yz7zix/kQ6q5O6pAITU0GLFoGWu40yf67Cg8VKnl3UoCOhZBzAf SUNBq8GI16EzEPj0OXR4G9zuDGmbgOLtLBMn3pvuLs7nH2vJPjEQdGFaBxopGw== X-Gm-Gg: Acq92OEtNZnPMjbIKYwxc9bFtrJ0zGYrDNYZnRGK0y/RcvKFBgnBq/Qye0XfqlMZbsS dsvE3oHXxKJDe9xfizt6YKrDXu0JtwGxgNfkd/5HKYOauolK1Z5QtkbUUizvKMaqk6PbyXJZD+Z toV6D5unpNllCClz4UhO8r33K8DCo13pAaGEsbroUsUzsyNtTLaSDkyVy57Cw6SOYPSS9UT7v+P Qcm0gJP82c0yBG/Iu6qWsoHUZnoAQIAbaHucoVunt52iLDadvIa0n5tMCZBwHuVxx4ZkhrLF+Sd lY8AUmuDnuBniSff0ANFMA0sbRuLYcspimbxE1dHR2jwy9ANbKzpa6ZRGcazpiHQfLkm8a+6y1T 6JYuuS/ng+TzsNchVMyKy/bHB0t678eKgEMAqT9tbzufrrxopAeU838iOjd0j3ow9Mn/0DEChMU zP6n2xKqjGgFlHqHXfPiGEd/dAnUN+A00t4+fQa5iYUdWCjTpTetV3REhgkwNYDlrnrg== X-Received: by 2002:a05:600c:4453:b0:48a:5363:8cac with SMTP id 5b1f17b1804b1-48fc9a43526mr543725e9.22.1778610298099; Tue, 12 May 2026 11:24:58 -0700 (PDT) Received: from ?IPV6:2001:8a0:facb:a800:1326:7e29:3028:cba8? ([2001:8a0:facb:a800:1326:7e29:3028:cba8]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48fc8d1b100sm15788295e9.4.2026.05.12.11.24.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 May 2026 11:24:57 -0700 (PDT) Message-ID: <51925086-b88a-48a4-bbca-836cbe44039c@palves.net> Date: Tue, 12 May 2026 19:24:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] gdb/amd-dbgapi-target: implement the 'interrupt' target op To: Tankut Baris Aktemur , gdb-patches@sourceware.org Cc: lancelot.six@amd.com, eliz@gnu.org References: <20260512173318.2727821-1-tankutbaris.aktemur@amd.com> From: Pedro Alves Content-Language: en-US In-Reply-To: <20260512173318.2727821-1-tankutbaris.aktemur@amd.com> Content-Type: text/plain; charset=UTF-8 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 Hi! On 2026-05-12 18:33, Tankut Baris Aktemur wrote: > > +void > +amd_dbgapi_target::interrupt () > +{ > + stop (minus_one_ptid); > +} Two issues here: #1 - Note that this changes the behavior of the CPU target. We push the dbgapi target on the stack even before GPU debugging is active. Before the patch, "interrupt" stops with SIGINT. After the patch, "interrupt" stops with SIGINT vs "stopped" depending on whether dbgapi is built into GDB and active, or not. Ultimately, I want to make the linux target interrupt with "stopped" too, and my larger "ctrl-c rework" series does that: https://inbox.sourceware.org/gdb-patches/20210603190243.2609886-17-pedro@palves.net/ but maybe we can have a simpler localized patch in linux-nat.c meanwhile, similar to what I did for Windows recently, here: https://inbox.sourceware.org/gdb-patches/20260505122434.1444507-1-pedro@palves.net/ #2 - That is going to iterate over all threads and queue a stop for every thread. That is incorrect in all-stop mode. The assumption is that there is only one single event queued, and then infrun stops all threads when it handles the event. E.g., if I try without scheduler-locking, I see: (gdb) c& Continuing. (gdb) info threads Id Target Id Frame 1 Thread 0x7ffff62a8540 (LWP 3244715) "interrupt-singl" (running) 2 Thread 0x7fffe8dff6c0 (LWP 3244828) "interrupt-singl" (running) 3 Thread 0x7fffe3fff6c0 (LWP 3244829) "interrupt-singl" (running) 6 Thread 0x7ffff5adf6c0 (LWP 3244832) "interrupt-singl" (running) * 7 AMDGPU Wave 1:2:1:1 (0,0,0)/0 "kern" (running) (gdb) interrupt (gdb) ❌️ wave_stop for wave_1 failed (The wave has an outstanding stop request) (gdb) ❌️ wave_stop for wave_1 failed (The wave has an outstanding stop request) (gdb) ❌️ wave_stop for wave_1 failed (The wave has an outstanding stop request) (gdb) ❌️ wave_stop for wave_1 failed (The wave has an outstanding stop request) (gdb) Thread 7 "kern" stopped. 0x00007ffff7fa7d60 in loop () at /home/pedro/rocm/gdb/build/gdb/testsuite/../../../src/gdb/testsuite/gdb.rocm/interrupt-single.cpp:25 25 __builtin_amdgcn_s_sleep (8); It's probably also possible to trigger badness in the CPU side. Your test should definitely cover this, not just schedlock on. Pedro Alves