[gdb/testsuite] Fix hang in fork-running-state.c
Pedro Alves
palves@redhat.com
Wed Jun 13 12:10:00 GMT 2018
On 06/12/2018 04:51 PM, Tom de Vries wrote:
> ...
> So, AFAIU, the hanging process is the child process that gdb detaches from.
>
> There's an alarm set in main before the fork, but alarms are not preserved in
> the fork child:
> ...
> $ man alarm
> ...
> NOTES
> Alarms created by alarm() are preserved across execve(2) and are not inherited by children created via fork(2).
Whoops.
> ...
> So, AFAIU, once the parent is killed, there's no alarm to terminate the child.
Indeed.
Your patch is definitely a good idea. Please push.
However, I think that still leaves an unnecessary delay until
the detached child/parent terminate. They used to exit themselves,
but that caused a race, so they no longer do, see here:
https://sourceware.org/ml/gdb-patches/2018-03/msg00588.html
Sounds like the best would be to restore the self-killing,
but make it controlled by a variable that gdb sets, depending
on whether gdb is staying attached to the child/parent.
Thanks,
Pedro Alves
More information about the Gdb-patches
mailing list