Message ID | 20250414115102.1991-1-tdevries@suse.de |
---|---|
State | Committed |
Headers |
Return-Path: <gdb-patches-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 17F7B3858408 for <patchwork@sourceware.org>; Mon, 14 Apr 2025 11:52:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 17F7B3858408 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=cuh/MaBR; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=wJHbSwKf; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=cuh/MaBR; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=wJHbSwKf X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id D2F453858430 for <gdb-patches@sourceware.org>; Mon, 14 Apr 2025 11:50:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D2F453858430 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 D2F453858430 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744631440; cv=none; b=P0CbnpF+TY9ITkUmWAcbVBaBT44iQeEsGVjL9eA2BqBePEXdhQAO3xrSp90w4rxUgfXrn9J7hVI1cIBUtIlGsCxXkX3Smn4CNSOt3wseJPhP1DwfL0aFdMuFd2wJmbWdOoBmlBMt+YxVtGLmMqcBx2huxqVtt1RYMhRtvZDWcmA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744631440; c=relaxed/simple; bh=jk7iyB2ePnGr4ZgYsnfr+hUiczwYi8JL5dO5e6s6CM8=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=uEurn7PNzr0KHQBULZ5zIO5f++38gtg41iaonG5exeURzB7aaFwf6ffAh2zWl+X35qRSWb3bPz2krzoyh057NxD5X/kYzUhzu63U6ipYGyZOBxuRxOvUVzavDPhlmohlAFGCuJjIri4+817UJiQ0dKWLXFt16VzO0x8x0mGgMdo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2F453858430 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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-out1.suse.de (Postfix) with ESMTPS id B0B91211F9 for <gdb-patches@sourceware.org>; Mon, 14 Apr 2025 11:50:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1744631438; 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=ghnPn8PZJkM72HyciXpvqypLSswLaE6CqpDR/Rbsn2Q=; b=cuh/MaBRTd1zRarkyWFtE1Zl/qBXlgsfjM3nMYwQSZA4TZnbt+S3kAOIPAyYTzkQ+3RgVm CMi7q1+CPbR5aaPOUpvD+tK+48Wk6+BSXEQFHh5TTUy5i/0T+BUop07Ub6J67qt8BgJwU9 i2/KBPAnptw1wpbN7aa/ieAjtSDSEfQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1744631438; 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=ghnPn8PZJkM72HyciXpvqypLSswLaE6CqpDR/Rbsn2Q=; b=wJHbSwKfFlc3UzfoXduxhJiT/P8ySijJcfEtWPdInd5UcwuxEHbz1HSrkH+NlMZxlxIZ0N SeQryyUm0O17eSBg== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="cuh/MaBR"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=wJHbSwKf DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1744631438; 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=ghnPn8PZJkM72HyciXpvqypLSswLaE6CqpDR/Rbsn2Q=; b=cuh/MaBRTd1zRarkyWFtE1Zl/qBXlgsfjM3nMYwQSZA4TZnbt+S3kAOIPAyYTzkQ+3RgVm CMi7q1+CPbR5aaPOUpvD+tK+48Wk6+BSXEQFHh5TTUy5i/0T+BUop07Ub6J67qt8BgJwU9 i2/KBPAnptw1wpbN7aa/ieAjtSDSEfQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1744631438; 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=ghnPn8PZJkM72HyciXpvqypLSswLaE6CqpDR/Rbsn2Q=; b=wJHbSwKfFlc3UzfoXduxhJiT/P8ySijJcfEtWPdInd5UcwuxEHbz1HSrkH+NlMZxlxIZ0N SeQryyUm0O17eSBg== 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 9979F136A7 for <gdb-patches@sourceware.org>; Mon, 14 Apr 2025 11:50:38 +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 UmoNJI72/GeKXAAAD6G6ig (envelope-from <tdevries@suse.de>) for <gdb-patches@sourceware.org>; Mon, 14 Apr 2025 11:50:38 +0000 From: Tom de Vries <tdevries@suse.de> To: gdb-patches@sourceware.org Subject: [PATCH] [gdb/testsuite] Fix another timeout in gdb.base/bg-execution-repeat.exp Date: Mon, 14 Apr 2025 13:51:02 +0200 Message-ID: <20250414115102.1991-1-tdevries@suse.de> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B0B91211F9 X-Spam-Score: -3.01 X-Rspamd-Action: no action X-Spamd-Result: default: False [-3.01 / 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.20)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:25478, ipnet:::/0, country:RU]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:dkim,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_TLS_ALL(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from,2a07:de40:b281:106:10:150:64:167:received]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_ONE(0.00)[1]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Level: X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces~patchwork=sourceware.org@sourceware.org |
Series |
[gdb/testsuite] Fix another timeout in gdb.base/bg-execution-repeat.exp
|
|
Checks
Context | Check | Description |
---|---|---|
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 | success | Build passed |
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 | success | Test passed |
linaro-tcwg-bot/tcwg_gdb_build--master-arm | success | Build passed |
Commit Message
Tom de Vries
April 14, 2025, 11:51 a.m. UTC
With test-case gdb.base/bg-execution-repeat.exp, occasionally I run into a timeout: ... (gdb) c 1& Will stop next time breakpoint 1 is reached. Continuing. (gdb) PASS: $exp: c 1&: c 1& Breakpoint 2, foo () at bg-execution-repeat.c:23 23 return 0; /* set break here */ PASS: $exp: c 1&: breakpoint hit 1 Will stop next time breakpoint 2 is reached. Continuing. (gdb) PASS: $exp: c 1&: repeat bg command print 1 $1 = 1 (gdb) PASS: $exp: c 1&: input still accepted interrupt (gdb) PASS: $exp: c 1&: interrupt Program received signal SIGINT, Interrupt. foo () at bg-execution-repeat.c:24 24 } PASS: $exp: c 1&: interrupt received set var do_wait=0 (gdb) PASS: $exp: c 1&: set var do_wait=0 continue& Continuing. (gdb) PASS: $exp: c 1&: continue& FAIL: $exp: c 1&: breakpoint hit 2 (timeout) ... I can reproduce it reliably by adding a "sleep (1)" before the "do_wait = 1" in the .c file. The timeout happens as follows: - with the inferior stopped at main, gdb continues (command c 1&) - the inferior hits the breakpoint at foo - gdb continues (using the repeat command functionality) - the inferior is interrupted - inferior variable do_wait gets set to 0. The assumption here is that the inferior has progressed enough that do_wait is set to 1 at that point, but that happens not to be the case. Consequently, this has no effect. - gdb continues - the inferior sets do_wait to 1 - the inferior enters the wait function, and wait for do_wait to become 0, which never happens. Fix this by moving the "do_wait = 1" to before the first call to foo. Tested on x86_64-linux. --- gdb/testsuite/gdb.base/bg-execution-repeat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: e25c84752c9df2bf3a999b53afb58e5bebaf3b7c
Comments
On Mon, Apr 14, 2025 at 1:51 PM Tom de Vries <tdevries@suse.de> wrote: > With test-case gdb.base/bg-execution-repeat.exp, occasionally I run into a > timeout: > ... > (gdb) c 1& > Will stop next time breakpoint 1 is reached. Continuing. > (gdb) PASS: $exp: c 1&: c 1& > > Breakpoint 2, foo () at bg-execution-repeat.c:23 > 23 return 0; /* set break here */ > PASS: $exp: c 1&: breakpoint hit 1 > > Will stop next time breakpoint 2 is reached. Continuing. > (gdb) PASS: $exp: c 1&: repeat bg command > print 1 > $1 = 1 > (gdb) PASS: $exp: c 1&: input still accepted > interrupt > (gdb) PASS: $exp: c 1&: interrupt > > Program received signal SIGINT, Interrupt. > foo () at bg-execution-repeat.c:24 > 24 } > PASS: $exp: c 1&: interrupt received > set var do_wait=0 > (gdb) PASS: $exp: c 1&: set var do_wait=0 > continue& > Continuing. > (gdb) PASS: $exp: c 1&: continue& > FAIL: $exp: c 1&: breakpoint hit 2 (timeout) > ... > > I can reproduce it reliably by adding a "sleep (1)" before the "do_wait = > 1" > in the .c file. > > The timeout happens as follows: > - with the inferior stopped at main, gdb continues (command c 1&) > - the inferior hits the breakpoint at foo > - gdb continues (using the repeat command functionality) > - the inferior is interrupted > - inferior variable do_wait gets set to 0. The assumption here is that the > inferior has progressed enough that do_wait is set to 1 at that point, > but > that happens not to be the case. Consequently, this has no effect. > - gdb continues > - the inferior sets do_wait to 1 > - the inferior enters the wait function, and wait for do_wait to become 0, > which never happens. > > Fix this by moving the "do_wait = 1" to before the first call to foo. > > Tested on x86_64-linux. > --- > Hi Tom, I also tested this on aarch64 and it works as expected, I think it's a reasonable change. Reviewed-By: Alexandra Petlanova Hajkova <ahajkova@redhat.com>
On 4/16/25 17:26, Alexandra Petlanova Hajkova wrote: > > > On Mon, Apr 14, 2025 at 1:51 PM Tom de Vries <tdevries@suse.de > <mailto:tdevries@suse.de>> wrote: > > With test-case gdb.base/bg-execution-repeat.exp, occasionally I run > into a > timeout: > ... > (gdb) c 1& > Will stop next time breakpoint 1 is reached. Continuing. > (gdb) PASS: $exp: c 1&: c 1& > > Breakpoint 2, foo () at bg-execution-repeat.c:23 > 23 return 0; /* set break here */ > PASS: $exp: c 1&: breakpoint hit 1 > > Will stop next time breakpoint 2 is reached. Continuing. > (gdb) PASS: $exp: c 1&: repeat bg command > print 1 > $1 = 1 > (gdb) PASS: $exp: c 1&: input still accepted > interrupt > (gdb) PASS: $exp: c 1&: interrupt > > Program received signal SIGINT, Interrupt. > foo () at bg-execution-repeat.c:24 > 24 } > PASS: $exp: c 1&: interrupt received > set var do_wait=0 > (gdb) PASS: $exp: c 1&: set var do_wait=0 > continue& > Continuing. > (gdb) PASS: $exp: c 1&: continue& > FAIL: $exp: c 1&: breakpoint hit 2 (timeout) > ... > > I can reproduce it reliably by adding a "sleep (1)" before the > "do_wait = 1" > in the .c file. > > The timeout happens as follows: > - with the inferior stopped at main, gdb continues (command c 1&) > - the inferior hits the breakpoint at foo > - gdb continues (using the repeat command functionality) > - the inferior is interrupted > - inferior variable do_wait gets set to 0. The assumption here is > that the > inferior has progressed enough that do_wait is set to 1 at that > point, but > that happens not to be the case. Consequently, this has no effect. > - gdb continues > - the inferior sets do_wait to 1 > - the inferior enters the wait function, and wait for do_wait to > become 0, > which never happens. > > Fix this by moving the "do_wait = 1" to before the first call to foo. > > Tested on x86_64-linux. > --- > > Hi Tom, > > I also tested this on aarch64 and it works as expected, I think it's a > reasonable change. > Hi Alexandra, thanks for the review, pushed. - Tom > Reviewed-By: Alexandra Petlanova Hajkova <ahajkova@redhat.com > <mailto:ahajkova@redhat.com>>
diff --git a/gdb/testsuite/gdb.base/bg-execution-repeat.c b/gdb/testsuite/gdb.base/bg-execution-repeat.c index 8e9bae4dfbb..3c0cc763e48 100644 --- a/gdb/testsuite/gdb.base/bg-execution-repeat.c +++ b/gdb/testsuite/gdb.base/bg-execution-repeat.c @@ -37,9 +37,9 @@ main (void) { alarm (60); + do_wait = 1; foo (); - do_wait = 1; wait (); /* do_wait set to 0 externally. */