From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id C484E3842405 for ; Thu, 10 Nov 2022 02:01:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C484E3842405 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [10.0.0.11] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 265CE1E0D3; Wed, 9 Nov 2022 21:01:17 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1668045677; bh=P/ZkAzfpY30gRli3sl0Vc9vbW4+Fc0SruHrh4KdGbFI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=j823hr4r83CjjPFU+fw/37+oQ/+OZjy5G/N6T40zVMGCgY6uPO01u5jYzi7eMpOXQ BoKP/KiBPkfNeM9mNXKwhzjHHeZIpVNvC318O/9iGHq4VnoolxH4FUGWH1dN+8/BBn Ac4HLzwu5VruMbYjePqylaLhpoun4b0aAEl0kV4Y= Message-ID: Date: Wed, 9 Nov 2022 21:01:16 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH] gdb/testsuite: Fix rtld-step-nodebugsym.exp Content-Language: en-US To: Lancelot SIX , gdb-patches@sourceware.org Cc: lsix@lancelotsix.com References: <20221109232945.2016705-1-lancelot.six@amd.com> From: Simon Marchi In-Reply-To: <20221109232945.2016705-1-lancelot.six@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,SPF_HELO_PASS,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/9/22 18:29, Lancelot SIX via Gdb-patches wrote: > The test case introduced in bafcc335266 (Fix stepping in rtld without > debug symbol) fails on some systems as reported by PR/29768. This can > be seen if the system does not have debug info for the libc: > > (gdb) step^M > Single stepping until exit from function main,^M > which has no line number information.^M > hello world[Inferior 1 (process 48203) exited normally]^M > (gdb) PASS: gdb.base/rtld-step-nodebugsym.exp: step > continue^M > The program is not being run.^M > (gdb) FAIL: gdb.base/rtld-step-nodebugsym.exp: continue until exit (the program is no longer running) > > Without glibc debug info, GDB steps until the program finishes, and > then "gdb_continue_to_end" fails. > > As this test was designed to check that GDB does not crash in the "step" > command, the continue does not carry real meaning to the test. > > Replace it by "print 0" so we still check that after the step command > GDB is still alive, which is what we care about. > > Tested on Ubuntu-22.04 x86_64, with and without libc6-dbg. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29768 > --- > gdb/testsuite/gdb.base/rtld-step-nodebugsym.exp | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/gdb/testsuite/gdb.base/rtld-step-nodebugsym.exp b/gdb/testsuite/gdb.base/rtld-step-nodebugsym.exp > index 1c8fa478cb8..80ff1572c1a 100644 > --- a/gdb/testsuite/gdb.base/rtld-step-nodebugsym.exp > +++ b/gdb/testsuite/gdb.base/rtld-step-nodebugsym.exp > @@ -29,4 +29,6 @@ if { ![runto_main] } { > > gdb_test "step" "Single stepping until exit from function.*" > > -gdb_continue_to_end "" continue 1 > +# GDB used to crash while doing the step command. Check that this bug is > +# fixed and that GDB is still alive at this point. > +gdb_test "print 0" "= 0" In theory, the gdb_test for step expects to see a (gdb) prompt at the end, and I suppose that GDB would crash before printing that prompt. So the test would catch the problem even without that "print 0". But I don't mind the extra safety: Approved-By: Simon Marchi Simon