This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix gdb.base/fork-running-state.exp race


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]