public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: Tom Tromey <tom@tromey.com>
Cc: Andrew Burgess <aburgess@redhat.com>,  gdb-patches@sourceware.org
Subject: Re: [PATCH] Guard against killing unrelated processes in amd64-disp-step.exp
Date: Mon, 07 Aug 2023 15:51:24 +0200	[thread overview]
Message-ID: <ydd350vhsf7.fsf@CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <87zg39b1tp.fsf@tromey.com> (Tom Tromey's message of "Wed, 02 Aug 2023 14:56:34 -0600")

[-- Attachment #1: Type: text/plain, Size: 1494 bytes --]

Hi Tom,

>>>>>> "Rainer" == Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 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



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sol2-amd64-random-kill.patch --]
[-- Type: text/x-patch, Size: 756 bytes --]

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" \

  reply	other threads:[~2023-08-07 13:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-13 11:19 Rainer Orth
2023-07-13 16:34 ` Tom Tromey
2023-07-13 17:59   ` Rainer Orth
2023-07-14 17:25     ` Pedro Alves
2023-07-19 12:21       ` Rainer Orth
2023-07-15 13:38 ` Andrew Burgess
2023-07-19 12:37   ` Rainer Orth
2023-08-01 14:05     ` Rainer Orth
2023-08-02 20:56       ` Tom Tromey
2023-08-07 13:51         ` Rainer Orth [this message]
2023-08-07 22:14           ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ydd350vhsf7.fsf@CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).