From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id A6E843858296 for ; Sat, 26 Nov 2022 13:31:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A6E843858296 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 C4FD71F88B for ; Sat, 26 Nov 2022 13:31:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1669469496; 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=DcdaMTN3fv9btABKdgS7TapPipph3BEW6U1gPn6E8w0=; b=lXzjNCmZLFFtaxYSD8VARYYUM24pV5zVIV3FayHUUGQtI9xkRzoVdnlLhjq10TDOoOfDJR OV8d+1X5zqk5nYALkZhc5KNOMSIwsffciqLx66cZrteC8HnWL88+ZyIEtMdw4RACeMBFR/ 2/FPkreqbpkXcNqsPWeul/hlB0u14lU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1669469496; 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=DcdaMTN3fv9btABKdgS7TapPipph3BEW6U1gPn6E8w0=; b=lMHFYDMt5R8nRlXlbtX0RvCZOQ/7bcxdiFZ0XopbxMIyyrOLOI+Eog4YOismTuFSejdWpK KKbxeewO3Vk9lNBA== 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 8002E13A8D for ; Sat, 26 Nov 2022 13:31:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id u6UkFjgVgmONDwAAMHmgww (envelope-from ) for ; Sat, 26 Nov 2022 13:31:36 +0000 Message-ID: Date: Sat, 26 Nov 2022 14:31:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH] [gdb/testsuite] Don't generate core in gdb.base/bt-on-fatal-signal.exp Content-Language: en-US To: gdb-patches@sourceware.org References: <20221116112236.24224-1-tdevries@suse.de> From: Tom de Vries In-Reply-To: <20221116112236.24224-1-tdevries@suse.de> 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 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 11/16/22 12:22, Tom de Vries via Gdb-patches wrote: > When running test-case gdb.base/bt-on-fatal-signal.exp on powerpc64le-linux I > noticed: > ... > FAIL: gdb.base/bt-on-fatal-signal.exp: SEGV: scan for backtrace (timeout) > ... > > The timeout is 10 seconds, but generating the core file takes more than a > minute, probably due to slow NFS. > > I managed to reproduce this behaviour independently of gdb, by compiling > "int main (void) { __builtin_abort (); }" and running it, which took 1.5 > seconds for a core file 50 times smaller than the one for gdb. > > Fix this by preventing the core file from being generated, using a wrapper > around gdb that does "ulimit -c 0". > > Tested on x86_64-linux. Committed. Thanks, - Tom > --- > gdb/testsuite/gdb.base/bt-on-fatal-signal.exp | 5 ++++- > gdb/testsuite/lib/gdb.exp | 11 +++++++++++ > 2 files changed, 15 insertions(+), 1 deletion(-) > > diff --git a/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp b/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp > index 8f9d857106d..1af88d50c4c 100644 > --- a/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp > +++ b/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp > @@ -62,7 +62,10 @@ foreach test_data {{SEGV "Segmentation fault"} \ > with_test_prefix ${sig} { > > # Restart GDB. > - clean_restart $binfile > + save_vars { GDB } { > + set GDB [gdb_no_core] > + clean_restart $binfile > + } > > # Capture the pid of GDB. > set testpid [spawn_id_get_pid $gdb_spawn_id] > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp > index 042d7ade59f..8b09d548839 100644 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -6304,6 +6304,17 @@ proc cached_file { filename txt {executable 0}} { > return $filename > } > > +# Return a wrapper around gdb that prevents generating a core file. > + > +proc gdb_no_core { } { > + set script \ > + [list \ > + "ulimit -c 0" \ > + [join [list exec $::GDB {"$@"}]]] > + set script [join $script "\n"] > + return [cached_file gdb-no-core.sh $script 1] > +} > + > # Set 'testfile', 'srcfile', and 'binfile'. > # > # ARGS is a list of source file specifications. > > base-commit: 6e5d0bc52fbbfcac6f35f2d014e27afd4506d687