From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.CeBiTec.Uni-Bielefeld.DE (smtp.CeBiTec.Uni-Bielefeld.DE [129.70.160.84]) by sourceware.org (Postfix) with ESMTPS id CB797385840B for ; Mon, 7 Aug 2023 13:51:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CB797385840B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cebitec.uni-bielefeld.de Received: from localhost (localhost [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 46085B9B86; Mon, 7 Aug 2023 15:51:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= cebitec.uni-bielefeld.de; h=content-type:content-type :mime-version:user-agent:message-id:in-reply-to:date:date :references:subject:subject:from:from:received:received; s= 20200306; t=1691416285; bh=NkTL6rQ/17rOzsmSveOIGI0k17lZXmu6sh2I/ JNpnR4=; b=ewI0eBHniRahBo++/1HQlTAecN/38XapIX9RCTeQA3X6YSnmkcGz9 kuQSVJGmweZKq9ov+6lmcD1QdQtnYV2WqN1wSl5bmsRpusHEM1EZpO3jQVJO67lY zROZe2GeFPIBdXMx9UU47zVMcYSbgehLorb35swkB1V8m8l+AxiYcZ6lGMY34Amt 7ymICSenicKMJtuQfH5TnNcrPR2GwnUgLNZi9W1FEIuG6rIOsfBaMJHABuZsa34h qcp1251y0rYekRw6uKDN+B92bshC2n0vROQHzpNxVQyRg2iVEiZDwCbrn3Ox35uA byqensJc2j9kssrhHsGrky4ppmSq6aDqA== X-Virus-Scanned: amavisd-new at cebitec.uni-bielefeld.de Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (smtp.cebitec.uni-bielefeld.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Tffwhq6-JEnG; Mon, 7 Aug 2023 15:51:25 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p50855fc8.dip0.t-ipconnect.de [80.133.95.200]) (Authenticated sender: ro) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id F11A9B9B85; Mon, 7 Aug 2023 15:51:24 +0200 (CEST) From: Rainer Orth To: Tom Tromey Cc: Andrew Burgess , gdb-patches@sourceware.org Subject: Re: [PATCH] Guard against killing unrelated processes in amd64-disp-step.exp References: <875y6li9as.fsf@redhat.com> <87zg39b1tp.fsf@tromey.com> Date: Mon, 07 Aug 2023 15:51:24 +0200 In-Reply-To: <87zg39b1tp.fsf@tromey.com> (Tom Tromey's message of "Wed, 02 Aug 2023 14:56:34 -0600") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (usg-unix-v) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Status: No, score=-3791.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,RCVD_IN_BARRACUDACENTRAL,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: --=-=-= Content-Type: text/plain Hi Tom, >>>>>> "Rainer" == Rainer Orth writes: > >>>> gdb_assert {[expr $inferior_pid > 0]} \ >>>> "check for a sane inferior pid" >>>> if {$inferior_pid > 0} { >>>> remote_exec target "kill -ALRM $inferior_pid" >>>> } >>>> >>>> This way you will still see a FAIL. >>> >>> True, but you will also see quite a bunch of PASSes in the working case >>> that tell you nothing. Seems like unnecessary noise to me. Isn't there >>> another way to convey the failure info without that noise? > > Rainer> how should we proceed with this patch? It would be a pity to release > Rainer> GDB 14 with make check killing the whole session on Solaris... > > I think just adding Andrew's proposed assert to your patch should be > good enough. > > The idea behind the assert is so that we can detect the bad case, if it > ever happens, on a platform that is otherwise ok. The noise of an extra > pass doesn't seem so bad, we have zillions of those already. The noise > from the fail also shouldn't be too bad since, IIRC, you said this test > is already not fully passing on Solaris. > > Anyway to sum up, the assert would be there as a "just in case" for > other platforms, not Solaris. fine with me. Here's the patch as amended. Re-tested on amd64-pc-solaris2.11 and x86_64-pc-linux-gnu. Ok for master now? Thanks. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=sol2-amd64-random-kill.patch diff --git a/gdb/testsuite/gdb.arch/amd64-disp-step.exp b/gdb/testsuite/gdb.arch/amd64-disp-step.exp --- a/gdb/testsuite/gdb.arch/amd64-disp-step.exp +++ b/gdb/testsuite/gdb.arch/amd64-disp-step.exp @@ -222,7 +222,12 @@ proc rip_test { reg test_start_label tes # If we use 'signal' to send the signal GDB doesn't actually do # the displaced step, but instead just delivers the signal. set inferior_pid [get_inferior_pid] - remote_exec target "kill -ALRM $inferior_pid" + # Ensure that $inferior_pid refers to a single process. + gdb_assert {[expr $inferior_pid > 0]} \ + "check for a sane inferior pid" + if {$inferior_pid > 0} { + remote_exec target "kill -ALRM $inferior_pid" + } } gdb_test "continue" \ --=-=-=--