This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix gdb.base/fork-running-state.exp race
- From: Pedro Alves <palves at redhat dot com>
- To: Simon Marchi <simon dot marchi at polymtl dot ca>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 10 Apr 2018 15:05:41 +0100
- Subject: Re: [PATCH] Fix gdb.base/fork-running-state.exp race
- References: <20180328150630.18319-1-palves@redhat.com> <12eacdba1ae3cb9cc58c050601ddf958@polymtl.ca>
On 03/30/2018 07:23 AM, Simon Marchi wrote:
> On 2018-03-28 11:06, Pedro Alves wrote:
>> So I scratched that approach and came up with a simpler patch --
>> simply make the child not exit itself when the parent exits.
>>
>> The .exp file is going to kill both parent and child explicitly, and,
>> main() already calls alarm() as a safeguard. I don't think we lose
>> anything.
>
> Does the parent exit as part of the test, or only when we kill it at the end when we clean up?
It's not part of the test, the parent only dies when we kill it for clean up.
>
> If I understand correctly, we kill the parent, and by the time we want to kill the child, it has already noticed the parent is gone and has itself exited, is that right?
Yup, that's right.
In that case I think it makes sense to have only one way of cleaning up, either we kill the process or we let it exit, not both. So the patch LGTM.
Thanks, I've pushed it in now.
Pedro Alves