From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 016203858D39 for ; Wed, 24 May 2023 16:57:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 016203858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de 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-out2.suse.de (Postfix) with ESMTPS id 160271FD99; Wed, 24 May 2023 16:57:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684947473; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yqx0tU7cta133uC4MmuGJccMtvP+QZ88hYi3JIqMxFk=; b=1ZV/Civ0hbqlNR9I2xCL+wN/Sr5ZeHzoszW8lFtTFPiCTrbWtwoc5D0iXtY8hEY5Wsdqah S5shiN2wOWD29WH0HdRzj8zCd5F3m5+ONw+V+K9LpNtUZvqUAXMGI4EvZjrktUrVo+setz WcdOItZv/ugrCgiLB4D+pWQjj1nP7GM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684947473; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yqx0tU7cta133uC4MmuGJccMtvP+QZ88hYi3JIqMxFk=; b=UF3uDE1Ty1qYsd40otyvkmYMWMId+XR4N+OqmoJz+R9mDbwIBwhDRSw9NSJ3vp/ALqgkTu 6qLxzIEHSZtbrkCQ== 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 F3AA813425; Wed, 24 May 2023 16:57:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id GUdWOhBCbmQSbwAAMHmgww (envelope-from ); Wed, 24 May 2023 16:57:52 +0000 Message-ID: Date: Wed, 24 May 2023 18:58:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] gdb/testsuite: fix race in gdb.server/multi-ui-errors.exp Content-Language: en-US To: Andrew Burgess , gdb-patches@sourceware.org References: <21d9b41b65c9215cc3fd387e20934ad174e57203.1684945721.git.aburgess@redhat.com> From: Tom de Vries In-Reply-To: <21d9b41b65c9215cc3fd387e20934ad174e57203.1684945721.git.aburgess@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 5/24/23 18:29, Andrew Burgess wrote: > After this commit: > > commit ed32754a8c7919feffc6ddb66ff1c532e4a4d1cd > Date: Thu Mar 9 10:45:03 2023 +0100 > > [gdb/testsuite] Fix gdb.server/multi-ui-errors.exp for remote target > > I noticed the occasional failure in gdb.server/multi-ui-errors.exp, > which looked like this: > > (gdb) PASS: gdb.server/multi-ui-errors.exp: interact with GDB's main UI > interrupt > (gdb) > Program received signal SIGINT, Interrupt. > 0x00007ffff7d501e7 in nanosleep () from /lib64/libc.so.6 > FAIL: gdb.server/multi-ui-errors.exp: interrupt (timeout) > PASS: gdb.server/multi-ui-errors.exp: interrupt arrived > p server_pid > $1 = 718174 > (gdb) PASS: gdb.server/multi-ui-errors.exp: p server_pid > > This is triggered by this code in gdb.server/multi-ui-errors.exp: > > gdb_test "interrupt" > > gdb_test_multiple "" "interrupt arrived" { > -re "Program received signal SIGINT, Interrupt\\.\r\n" { > pass $gdb_test_name > } > } > > The problem here is that the first interrupt will trigger the prompt > to be printed, and then, after some time the inferior will be > interrupted. > > However the default pattern for gdb_test includes a '$' end anchor. > If expect see the prompt with nothing following it then everything is Hi Andrew, see -> sees > fine, and the test passes. > > However, if the interrupt is quick and so what expect sees is this: > > (gdb) > Program received signal SIGINT, Interrupt. > 0x00007ffff7d501e7 in nanosleep () from /lib64/libc.so.6 > > In this case the end anchor means that the gdb_test fails to match, > and eventually times out. > > Fix this by passing -no-prompt-anchor to gdb_test. thanks for fixing this. LGTM. Reviewed-by: Tom de Vries Thanks, - Tom > --- > gdb/testsuite/gdb.server/multi-ui-errors.exp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gdb/testsuite/gdb.server/multi-ui-errors.exp b/gdb/testsuite/gdb.server/multi-ui-errors.exp > index af83614fe55..47ded35bc86 100644 > --- a/gdb/testsuite/gdb.server/multi-ui-errors.exp > +++ b/gdb/testsuite/gdb.server/multi-ui-errors.exp > @@ -106,7 +106,7 @@ with_spawn_id $gdb_main_spawn_id { > # Get the gdbserver PID. > set gdbserver_pid 0 > with_spawn_id $gdb_main_spawn_id { > - gdb_test "interrupt" > + gdb_test -no-prompt-anchor "interrupt" > > gdb_test_multiple "" "interrupt arrived" { > -re "Program received signal SIGINT, Interrupt\\.\r\n" { > > base-commit: 389971df23ca74092314dbde1303310a33766ba7