From: John Baldwin <jhb@FreeBSD.org>
To: Simon Marchi <simark@simark.ca>, Gary Benson <gbenson@redhat.com>
Cc: Pedro Alves <palves@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Don't compare the pid returned from wait() against inferior_ptid.
Date: Thu, 9 Jul 2020 09:37:05 -0700 [thread overview]
Message-ID: <37dfa87e-e71b-2357-e140-02f6fd40160c@FreeBSD.org> (raw)
In-Reply-To: <6891f4e5-7dc3-e2f5-05be-510607ed0485@simark.ca>
On 7/8/20 9:52 AM, Simon Marchi wrote:
> On 2020-07-08 12:46 p.m., John Baldwin wrote:
>> On 7/8/20 2:48 AM, Gary Benson wrote:
>>> Hi John,
>>>
>>> John Baldwin wrote:
>>>> inf_ptrace::wait() needs to discard termination events reported by
>>>> detached child processes. Previously it compared the returned pid
>>>> against the pid in inferior_ptid to determine if a termination event
>>>> should be discarded or reported. inferior_ptid is now null_ptid in
>>>> wait() target methods, so this was always failing and never
>>>> reporting exit events. Instead, report termination events whose pid
>>>> matches any inferior belonging to the current target.
>>>>
>>>> gdb/ChangeLog:
>>>>
>>>> * inf-ptrace.c (inf_ptrace_target::wait): Don't compare against
>>>> inferior_ptid.
>>>
>>> Did the bug you've fixed cause any tests to fail? And, if not, is
>>> this something it's possible to write a test for?
>>
>> It did cause regressions in some tests on FreeBSD. I am still letting
>> a before-after testsuite run, but gdb.base/a2-run.exp at least failed
>> all tests due to this bug and is back to passing on FreeBSD with the fix.
>
> Here's the context, for Gary and others:
>
> https://sourceware.org/pipermail/gdb-patches/2020-July/170238.html
>
> In the commit message, you should point out that commit xYZ caused some
> existing tests to fail, and that this patch makes them pass again. This
> way it's implied that there doesn't need to be new tests added, and it
> gives a paper trail to understand why this fix has come to be needed.
So after some git bisecting on the a2-run.exp test, I found that this
actually broke in the multi-target commit. This is ironic as I had tested
that change pre-commit and given Pedro patches to fix it on the FreeBSD
native target, but clearly I didn't test it well enough.
FYI, about 400 tests are fixed on FreeBSD after applying this patch
and some other failures go back to failing for an original reason
instead of timeouts / GDB internal errors.
How's this for an updated log:
Don't compare the pid returned from wait() against inferior_ptid.
inf_ptrace::wait() needs to discard termination events reported by
detached child processes. Previously it compared the returned pid
against the pid in inferior_ptid to determine if a termination event
should be discarded or reported. The multi-target changes cleared
inferior_ptid to null_ptid in wait() target methods, so this was
always failing and never reporting exit events. Instead, report
termination events whose pid matches any inferior belonging to the
current target.
Several tests started failing on FreeBSD after the multi-target
changes and pass again after this change.
--
John Baldwin
next prev parent reply other threads:[~2020-07-09 16:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-08 0:46 John Baldwin
2020-07-08 9:48 ` Gary Benson
2020-07-08 16:46 ` John Baldwin
2020-07-08 16:52 ` Simon Marchi
2020-07-09 16:37 ` John Baldwin [this message]
2020-07-09 17:34 ` Eli Zaretskii
2020-07-08 18:40 ` Pedro Alves
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=37dfa87e-e71b-2357-e140-02f6fd40160c@FreeBSD.org \
--to=jhb@freebsd.org \
--cc=gbenson@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
--cc=simark@simark.ca \
/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