From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0i+HOSpAXmlNgDAAWB0awg (envelope-from ) for ; Wed, 07 Jan 2026 06:14:50 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=1GElGyUB; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=3JS3imvV; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=1GElGyUB; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=3JS3imvV; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id DDC791E0B6; Wed, 07 Jan 2026 06:14:50 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, 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 0C59C1E048 for ; Wed, 07 Jan 2026 06:14:50 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 6FBDD4BA2E29 for ; Wed, 7 Jan 2026 11:14:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6FBDD4BA2E29 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=1GElGyUB; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=3JS3imvV; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=1GElGyUB; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=3JS3imvV Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 8B7DE4BA2E04 for ; Wed, 7 Jan 2026 11:14:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8B7DE4BA2E04 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8B7DE4BA2E04 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1767784461; cv=none; b=qff7Q4HPMW3+9uKde242IviU4LdY3wS27h91eEkmDjETN8gGe8nrNXcrX8CvXDXpT3/267FbhcpBTRQ+Ol5dtJhAuzOQRbZeCqHg2/ZVBRICLx8mVZhlJd2mgjy1tFqko47eqBu4zhA5Jkyiimc3tzcjEWgcwa+uD0Mh/0AHsdo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1767784461; c=relaxed/simple; bh=TWf6d690ZtL49bvEqFC4fbzWCKJikWHGlFysDm+q5tw=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=rCoD4/p7FznF1tL7AEMtECcFDBrdMDHMmute5pZGlJCZ4ZCKo1pWPnT019HG29/U0DiY2ohWWYiMLZ5yopJ0waJZfZbHS1egM27T0A+VQZJnHTJimAzdYOwUApgQnrK27wjtfRhedZaaB6LBp9zruVPN1qzIrkcp2pyvoQDXPNY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B7DE4BA2E04 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 8665E5BF4D for ; Wed, 7 Jan 2026 11:14:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1767784460; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=dXfMW/1SRRKVw217mnkoigKBfb+79cbdTH+KxCRyrjU=; b=1GElGyUB7wSlAWkUuGyUnZjreQzOjWTPj07P0JNhspvcyZpCRIZKjZO27LHrO9L/oDri7k x8+LjNMMqC2G28UoDVm0jbshfn4UZaDaG4OaJT6HQptazFtuTg07PPqYPdUb2p6WBX8hoX fPqG8o33R367aFb/1eNIDMWBMEXoHck= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1767784460; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=dXfMW/1SRRKVw217mnkoigKBfb+79cbdTH+KxCRyrjU=; b=3JS3imvV0CQStH3c7wo0xXzF6tyH+BWcsysJ1A8pcGW5XW+4IqCaETiHprwe8HcArca6p/ RHkkZAU/AJc0SVAA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1767784460; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=dXfMW/1SRRKVw217mnkoigKBfb+79cbdTH+KxCRyrjU=; b=1GElGyUB7wSlAWkUuGyUnZjreQzOjWTPj07P0JNhspvcyZpCRIZKjZO27LHrO9L/oDri7k x8+LjNMMqC2G28UoDVm0jbshfn4UZaDaG4OaJT6HQptazFtuTg07PPqYPdUb2p6WBX8hoX fPqG8o33R367aFb/1eNIDMWBMEXoHck= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1767784460; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=dXfMW/1SRRKVw217mnkoigKBfb+79cbdTH+KxCRyrjU=; b=3JS3imvV0CQStH3c7wo0xXzF6tyH+BWcsysJ1A8pcGW5XW+4IqCaETiHprwe8HcArca6p/ RHkkZAU/AJc0SVAA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 6E3053EA63 for ; Wed, 7 Jan 2026 11:14:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id YleGGQxAXmncBAAAD6G6ig (envelope-from ) for ; Wed, 07 Jan 2026 11:14:20 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH] [gdb/testsuite] Add missing wait in gdb.multi/sched-multi-add-inferior.exp Date: Wed, 7 Jan 2026 12:14:19 +0100 Message-ID: <20260107111419.2516856-1-tdevries@suse.de> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-2.77 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.17)[-0.838]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,imap1.dmz-prg2.suse.org:helo]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; RCVD_TLS_ALL(0.00)[] 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 With a gdb build with -O0 and Address Sanitizer and test-case gdb.multi/sched-multi-add-inferior.exp, I get: ... FAIL: $exp: target_type_1=extended-remote: target_type_2=extended-remote: \ continue to function1 FAIL: $exp: target_type_1=extended-remote: target_type_2=extended-remote: \ continue to function2 FAIL: $exp: target_type_1=native: target_type_2=extended-remote: \ continue to function1 FAIL: $exp: target_type_1=native: target_type_2=extended-remote: \ continue to function2 FAIL: $exp: target_type_1=native: target_type_2=native: continue to function1 FAIL: $exp: target_type_1=native: target_type_2=native: continue to function2 ... In more detail, for the target_type_1 == target_type_2 == native configuration, we have: ... (gdb) continue^M Continuing.^M [Switching to Thread 0x7ffff7cc02c0 (LWP 2514714)]^M ^M Thread 2.1 "sched-multi-add" hit Breakpoint 4, main (...) at multi-target.c:94^M 94 function2 (); /* set break 2 here */^M (gdb) FAIL: $exp: target_type_1=native: target_type_2=native: \ continue to function1 thread apply 2.1 set wait_for_gdb = 0^M ^M Thread 2.1 (Thread 0x7ffff7cc02c0 (LWP 2514714) "sched-multi-add"):^M (gdb) PASS: $exp: target_type_1=native: target_type_2=native: \ thread apply 2.1 set wait_for_gdb = 0 continue^M Continuing.^M [Switching to Thread 0x7ffff7cc02c0 (LWP 2514718)]^M ^M Thread 3.1 "sched-multi-add" hit Breakpoint 3, main (...) at multi-target.c:93^M 93 function1 (); /* set break 1 here */^M (gdb) FAIL: $exp: target_type_1=native: target_type_2=native: \ continue to function2 ... The situation is as follows: - there are two inferiors - due to "set schedule-multiple on", continue continues both inferiors - after the first continue, the test-case expects the breakpoint on thread 3.1 to trigger - instead, the breakpoint in thread 2.1 triggers The mechanism by which this order is supposed to be guaranteed, is that thread 2.1 is blocked, and only unblocked after thread 3.1 hits its breakpoint: ... # Unblock thread 2.1 and continue again. This time, thread 2.1 # will hit a breakpoint. gdb_test "thread apply 2.1 set wait_for_gdb = 0" ".*" ... However, thread 2.1 is never blocked. Fix this by adding the missing: ... gdb_test "thread apply 2.1 set wait_for_gdb = 1" ".*" ... Tested on x86_64-linux. PR testsuite/33540 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33540 --- gdb/testsuite/gdb.multi/sched-multi-add-inferior.exp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb/testsuite/gdb.multi/sched-multi-add-inferior.exp b/gdb/testsuite/gdb.multi/sched-multi-add-inferior.exp index 03d502a3cf3..4530960dd24 100644 --- a/gdb/testsuite/gdb.multi/sched-multi-add-inferior.exp +++ b/gdb/testsuite/gdb.multi/sched-multi-add-inferior.exp @@ -66,6 +66,10 @@ proc run_test { target_type_1 target_type_2 } { return 0 } + # Block thread 2.1 from exiting function1, making sure that the breakpoint + # on the call to function2 won't trigger untill we unblock the thread. + gdb_test "thread apply 2.1 set wait_for_gdb = 1" ".*" + if {![add_inferior 3 $target_type_2 $::binfile]} { return 0 } base-commit: fc9bd3b1baffa2af37d494751012d25618fdede5 -- 2.51.0