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 37C483858413 for ; Wed, 19 Jul 2023 12:37:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 37C483858413 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 18EDBC5956; Wed, 19 Jul 2023 14:37:07 +0200 (CEST) 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 10024) with ESMTP id t9dgf3uHZqe4; Wed, 19 Jul 2023 14:37:06 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p50855614.dip0.t-ipconnect.de [80.133.86.20]) (Authenticated sender: ro) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id B83FEC5955; Wed, 19 Jul 2023 14:37:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=CeBiTec.Uni-Bielefeld.DE; s=20200306; t=1689770225; bh=z2bFje1i/lUnF6b4W3fPAmk0xIBj/+iUu1rPFUqMmNg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=KqbmhkPFKTOT+Wf92XdryVBuTHWhhpLec9uBRS3KTf0yg/NxZfQm1BhFwauAb5Sxn deejHbnVNhAtEOGc2Cm8otR6zG7tdy9KhBlPWBJciO35RI3jKfj3LzOKkhpiLQNdsu 7+so+E518KLAPMmE5VNgOSFn4fjhjv/ltE3TIPIAWg0kdD0sLiz+7Kfpi8o1S15ZhV ktBTj48DudbhCqkCU68cjnyVDaZjmPee7yzihJBciSJZGZuNO4ToRRy49osAYw/UsN yBw7/ep9HF8YAbwQbxD64VRwNfTcHkz58UZjbrzoaevIHmNhickQF0vFD1Fe4Fpc8Y e7rAx1VyBWfoA== From: Rainer Orth To: Andrew Burgess Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Guard against killing unrelated processes in amd64-disp-step.exp References: <875y6li9as.fsf@redhat.com> Date: Wed, 19 Jul 2023 14:37:04 +0200 In-Reply-To: <875y6li9as.fsf@redhat.com> (Andrew Burgess's message of "Sat, 15 Jul 2023 14:38:51 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (usg-unix-v) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-3792.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,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: Hi Andrew, >> 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,10 @@ 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. >> + if {$inferior_pid > 0} { >> + remote_exec target "kill -ALRM $inferior_pid" >> + } > > Does this not hide the fact that the test is no longer doing what it > expected? it does. However, the results for this particular test were so bad already that I didn't think about one or more FAILs here. > I'm fine with the 'if {$inferior_pid > 0}' being added to ensure we > don't signal some random process(es), but I think we should probably add > something like: > > 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 -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University