From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id IurPAMCC8GrLrjQAWB0awg (envelope-from ) for ; Sun, 08 Nov 2026 09:10:08 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=h935s1a1; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id DBC3D1E023; Sun, 08 Nov 2026 09:10:07 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FORGED_GMAIL_RCVD,FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 C5D821E023 for ; Sun, 08 Nov 2026 09:10:06 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D42624BA23C5 for ; Sun, 8 Nov 2026 14:10:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D42624BA23C5 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=h935s1a1 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 9814F4BA2E24 for ; Sun, 8 Nov 2026 14:09:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9814F4BA2E24 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9814F4BA2E24 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794146980; cv=none; b=beV7X7AgZVbGxpAnyecDZHbS+XhtJ+xg8s+0F3nLHPu2c8tw/Z7l9WqBrcQtHMvWur+Q7Hw7IalozSOfCdXeIKjFrofNZz3Fq0/sS3SrJ24mN0mRMs/cRrjSl09ODl4/F8RASEzIZtWZhfYguEVJRKIVD3GxZsv7pvXldWznw1g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794146980; c=relaxed/simple; bh=gs7xle25gf143Zm2FUfwmuccWQwcBwgn+RaNvEltLgo=; h=DKIM-Signature:To:Date:Message-ID:MIME-Version:From:Subject; b=JF7ukfbG4gzkdHQWIZsk1Tpr/dy5BnizisfA8mE9GS4U2IhEINhJ0cM/gmxAtZ+R8F4irK1d/yGVVxg0PCT4iQ6NraWdvM8y2YXG9RGXbH1t/+xQ+cuphmMUAtbvJ284a15U+L/tkhin9kP7D+ABvB24jrg1cvu4O1MqU2yPd04= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=h935s1a1 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9814F4BA2E24 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-4918c2d727fso38824f8f.3 for ; Sun, 08 Nov 2026 06:09:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794146979; x=1794751779; darn=sourceware.org; h=subject:from:content-transfer-encoding:content-type:mime-version :message-id:date:cc:to:from:to:cc:subject:date:message-id:reply-to :content-type; bh=WiTupPGcu87xDQF+pz374vk1K2w6vcLh1E0RcGbWaOY=; b=h935s1a1U24xbY5SkU23qH4r4jEER+nveXZJNWwvUDABX3PvOpZXvTee3il8sIbR4k Gw62HLPqCVl7Yl7cawsbGZNxAncdOHhRXXXRGWc0nISy2F9s2KdizCGgUTizuP91r0cg vcAGg+Rp3+t53muOg4sSWmWogaHcbSw36xTwhOy9ntdJfR5xEkrnehFNjz3SyEwh1QvW yI8OT48q7va0OpK728SJv0iCzDjJvun8r2BHb40frq24m7VR+wTwDCZH14bOB/t/ZJEX taR2BKkcV6pCEqoLY3V0gzY+ZwoUy+t5VMZboctgZ7vg3NnKNPuI4QsQ6QgF2sxOWdiZ e7RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794146979; x=1794751779; h=subject:from:content-transfer-encoding:content-type:mime-version :message-id:date:cc:to:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=WiTupPGcu87xDQF+pz374vk1K2w6vcLh1E0RcGbWaOY=; b=0x2ePdROmYOB7+jpsCMMgVSfTklftZ0Z8t2dbX3/r+KS/Z4OYHInQlAKzVRmdxHSsc CQClxYEiVE33hwnpxsj4cagxAb+vvLEEZwiQP08LdB7nfwxpS7G8gAN6JPk0muLEB4Fo NtYS6uZ3ZJrCtqCYNlf0hUZMyuVAnIBqgmErWgUTnSi1iYUJeBIdf5Etqyy9Mu5kQAbS jp4KmMibvTvqf4rwwA0F2KREOwd/w8oF3k9L7Ni9wx7GE7SKcYgmiYc/HUW2D904rzJ8 RSI6mq2ii1Z8dLnxmmsCEZyKz4ojzBpAYVi32AfwzuetWJL4Azd/AiBBJRT9Qj0jCMNr C5Iw== X-Gm-Message-State: APuU4Z9T257Li0+S2e/L/BQlaLYFeMa3Oxgg0hSlMviVW1IQpLXobiOz AUbk6NKgQuAw6FAFnEXuTdliwqhFlg3qBP40VfgRdENRttkelJo5encltCRtPg== X-Gm-Gg: AYBFou0ULm2Tkt5WC1LH8kRvUouTAvY+zdMP+/UUbRO4grGEh3Z8xqnhGUKNWrtsG1F Znt4hca5c3whH3oQKXRltdDnduI4BCGiiio9fHDl+xtkfORou+2IPaE9KqIUJ6/BH9va98yrmrH LzRPpQkBI0iD5in3OKBZt5E40LrfVgcNs3dQzjoZdEgBoP5/0EjEoC4jetqaQXr97TFadxZfA4Z GZcugrw2tAgFQcoOrC0PrWxNzQON16A7fhQ7xMxyJGJMH8/cH6261IWOyYVaniQ1X6qxwrNNinl WMTOkOF0DMpg4otb07MEuuH1yNdKvRRmXSOYIPxTXuc2QARza9IdBlW8O/oBDshDQ/RwF5TDo+y Lrf2XNVIeuq4LRyshV7RV1dEz4XC1OHAZEFZCCG53Vlsif2Dh7HIaZ2QHuiLiRBHjPVXdpBSZ4c ylQGxAz3pd8j+uMn7H+SMcN4gO/1SuDDn2ShWRy0KOyjZfqZwZTNVBm5w+rb9cW2iX6gFMtNZCW faMgeHiGof+AEFB3dHoY+1Md+hLo3BeffoLDPSrOaAidyL0hv6N2JCS56TB4mjoGKxMLbLdJGS5 3hfwHCo+rjapO6rXs6sOjvXp16nbzFMxgGiIiE66XLxD3AsqFRWSm9E= X-Received: by 2002:a5d:5f50:0:b0:48e:6f76:de9d with SMTP id ffacd0b85a97d-49589f205demr2791803f8f.46.1794146978786; Sun, 08 Nov 2026 06:09:38 -0800 (PST) Received: from [127.0.1.1] ([45.150.175.155]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-49597ef6db0sm4153608f8f.59.2026.11.08.06.09.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Nov 2026 06:09:38 -0800 (PST) To: gdb-patches@sourceware.org Cc: Tom de Vries Date: Sun, 08 Nov 2026 14:09:16 +0000 Message-ID: <179414695697.1079432.5038312432073150919@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Josip Seketa Subject: [PATCH] [gdb/testsuite] Fix leader-exit and non-ldr-exc-2 with gdbserver 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 Since commit 1fba9bb362c ("[gdb/testsuite] Fix race in gdb.threads/leader-exit.exp"), these two tests wait for the "Thread exited" message while the inferior is running, and interrupt it when that appears. gdbserver only reports a thread exit if GDB asks for it, which it does not do here, so GDB prints that message when the target next stops. The message never comes, the wait times out, and the tests give up at that point: FAIL: gdb.threads/leader-exit.exp: continue to thread exited (timeout) FAIL: gdb.threads/leader-exit.exp: thread exited With gdbserver, interrupt the target first, after giving the leader some time to exit, and then look for the message. Nothing changes for native. --- With native-gdbserver and native-extended-gdbserver these two tests go from 2 passes and 8 failures to 29 passes, also with target-non-stop on. The unix board stays at 29. Under load from 12 spinning processes: 348 passes in 12 rounds, on master alone as well. The test waits a fixed 1 second, so a very slow machine could still see the leader alive. The alternative would be for the inferior to wait until the leader is a zombie, which is Linux-specific. The test before 1fba9bb362c passed on these boards, so this is what that commit changed for them, not a problem in gdbserver. I have no FSF copyright assignment. This is my own work, not my employer's. gdb/testsuite/gdb.threads/leader-exit.exp | 19 ++++++++++++++++--- gdb/testsuite/gdb.threads/non-ldr-exc-2.exp | 19 ++++++++++++++++--- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/gdb/testsuite/gdb.threads/leader-exit.exp b/gdb/testsuite/gdb.threads/leader-exit.exp index fb2f6980c2a..80baffe3465 100644 --- a/gdb/testsuite/gdb.threads/leader-exit.exp +++ b/gdb/testsuite/gdb.threads/leader-exit.exp @@ -30,14 +30,27 @@ if {![runto_main]} { return } -# Wait for the "Thread exited" message. +# Wait for the "Thread exited" message. gdbserver only reports a +# thread exit if GDB asks for that, which it does not do here, so +# there GDB sees the exit when the target stops. Then give the +# leader some time to exit, and interrupt the target. set re_thread_exited {\[Thread [^\r\n]+ exited\]} set saw_thread_exited 0 +set interrupt_first [target_is_gdbserver] gdb_test_multiple "continue" "continue to thread exited" { + -re "Continuing\\.\r\n" { + if { $interrupt_first } { + after 1000 + send_gdb "\003" + } + exp_continue + } -re $re_thread_exited { set saw_thread_exited 1 - # Get a prompt. - send_gdb "\003" + if { !$interrupt_first } { + # Get a prompt. + send_gdb "\003" + } exp_continue } -re -wrap "" { diff --git a/gdb/testsuite/gdb.threads/non-ldr-exc-2.exp b/gdb/testsuite/gdb.threads/non-ldr-exc-2.exp index 3f465e10159..0132a310408 100644 --- a/gdb/testsuite/gdb.threads/non-ldr-exc-2.exp +++ b/gdb/testsuite/gdb.threads/non-ldr-exc-2.exp @@ -39,14 +39,27 @@ proc do_test { lock_sched nonstop } { return -1 } - # Wait for the "Thread exited" message. + # Wait for the "Thread exited" message. gdbserver only reports a + # thread exit if GDB asks for that, which it does not do here, so + # there GDB sees the exit when the target stops. Then give the + # leader some time to exit, and interrupt the target. set re_thread_exited {\[Thread [^\r\n]+ exited\]} set saw_thread_exited 0 + set interrupt_first [target_is_gdbserver] gdb_test_multiple "continue" "continue to thread exited" { + -re "Continuing\\.\r\n" { + if { $interrupt_first } { + after 1000 + send_gdb "\003" + } + exp_continue + } -re $re_thread_exited { set saw_thread_exited 1 - # Get a prompt. - send_gdb "\003" + if { !$interrupt_first } { + # Get a prompt. + send_gdb "\003" + } exp_continue } -re -wrap "" { -- 2.56.0