From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0FuJNh4jm2JOPQoAWB0awg (envelope-from ) for ; Sat, 04 Jun 2022 05:17:18 -0400 Received: by simark.ca (Postfix, from userid 112) id D171B1E221; Sat, 4 Jun 2022 05:17:18 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=kEYdMdzN; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 625441E00D for ; Sat, 4 Jun 2022 05:17:18 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DC4043839C6E for ; Sat, 4 Jun 2022 09:17:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC4043839C6E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1654334237; bh=AwJs6AaxC1jJF3Gf7u52rso9w8xr6RzfYNCy76qcoto=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=kEYdMdzN/hb8V+L4pZ7dYnkb6CVnctw4b7WgM00/qdi0DwcHgplWFOOcoO1izBxBr dBERGUC5W6sVpsiU38UO/gDHN6Vkghz8xwmVkUt9WErOA9SV0Relgg9a1sFQCMRPKD GjiDuOxksbC3PJGHO68Lt2kKIYb0axSa0U+EJl64= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id C2D413858C74 for ; Sat, 4 Jun 2022 09:16:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C2D413858C74 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0B18021CDE; Sat, 4 Jun 2022 09:16:58 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E75B013A8F; Sat, 4 Jun 2022 09:16:57 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id UhZDNwkjm2LkZgAAMHmgww (envelope-from ); Sat, 04 Jun 2022 09:16:57 +0000 Message-ID: <290e44d3-b75a-a48f-3678-f4194540c70b@suse.de> Date: Sat, 4 Jun 2022 11:16:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: [committed][gdb/testsuite] Fix gdb.threads/manythreads.exp with check-read1 Content-Language: en-US To: gdb-patches@sourceware.org References: <20220525123430.GA22147@delia> In-Reply-To: <20220525123430.GA22147@delia> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Cc: Pedro Alves Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 5/25/22 14:34, Tom de Vries wrote: > Hi, > > When running test-case gdb.threads/manythreads.exp with check-read1, I ran > into this hard-to-reproduce FAIL: > ... > [New Thread 0x7ffff7318700 (LWP 31125)]^M > [Thread 0x7ffff7321700 (LWP 31124) exited]^M > [New T^C^M > ^M > Thread 769 "manythreads" received signal SIGINT, Interrupt.^M > [Switching to Thread 0x7ffff6d66700 (LWP 31287)]^M > 0x00007ffff7586a81 in clone () from /lib64/libc.so.6^M > (gdb) FAIL: gdb.threads/manythreads.exp: stop threads 1 > ... > > The matching in the failing gdb_test_multiple is done in an intricate way, > trying to pass on some order and fail on another order. > > Fix this by rewriting the regexps to match one line at most, and detecting > invalid order by setting and checking state variables. > > Tested on x86_64-linux. > > Any comments? Committed. Thanks, - Tom > [gdb/testsuite] Fix gdb.threads/manythreads.exp with check-read1 > > --- > gdb/testsuite/gdb.threads/manythreads.exp | 34 +++++++++++++++++-------------- > 1 file changed, 19 insertions(+), 15 deletions(-) > > diff --git a/gdb/testsuite/gdb.threads/manythreads.exp b/gdb/testsuite/gdb.threads/manythreads.exp > index f2b8bb791c6..8e0df3ef95c 100644 > --- a/gdb/testsuite/gdb.threads/manythreads.exp > +++ b/gdb/testsuite/gdb.threads/manythreads.exp > @@ -63,21 +63,12 @@ proc interrupt_and_wait { message } { > > send_gdb "\003" > > + set saw_signal 0 > + set order_ok 1 > gdb_test_multiple "" $message { > - -re "\\\[New \[^\]\]*\\\]\r\n" { > - exp_continue > - } > - -re "\\\[\[^\]\]* exited\\\]\r\n" { > - exp_continue > - } > - -re " received signal SIGINT.*$gdb_prompt $" { > - pass "$message" > - } > - -re "$gdb_prompt $" { > - # Note that with this regex order, if GDB emits [New > - # Thread ...] output between "Thread NNN received signal" > - # and the prompt, the "received signal" regex won't match. > - # That's good, as if we see that happening, it's a > + -re "\r\n\\\[New \[^\r\n\]*(?=\r\n)" { > + # Note if GDB emits [New Thread ...] output between > + # "Thread NNN received signal" and the prompt, it's a > # regression. > # > # GDB makes sure to notify about signal stops, end of > @@ -100,7 +91,20 @@ proc interrupt_and_wait { message } { > # foo () at foo.c:31 > # 31 bar (); > # > - fail $message > + if { $saw_signal } { > + set order_ok 0 > + } > + exp_continue > + } > + -re "\r\n\\\[\[^\r\n]* exited\\\](?=\r\n)" { > + exp_continue > + } > + -re "\r\n\[^\r\n]* received signal SIGINT\[^\r\n\]*(?=\r\n)" { > + set saw_signal 1 > + exp_continue > + } > + -re -wrap "" { > + gdb_assert {$saw_signal && $order_ok} $gdb_test_name > } > } > }