[patch] Multithreaded process left Stopped (T) on CTRL-C of strace

Roland McGrath roland at redhat.com
Thu May 24 05:08:42 UTC 2007


I had to infer the rationale for why this fix is right.
The comments should make it more clear.

Calling detach on something with TCB_EXITING set is wrong because that
means it has already been through detach, or else is a natural child
(without -p) that was continued and has had or soon will have a !WIFSTOPPED
death report seen by wait4.  All the process diddling has already been done
and only droptcb is needed to clean up the data structure.

The call you changed in handle_group_exit is also a case where it's already
detached or dead, so detach does not make sense.

I think the (leader->flags & TCB_ATTACHED) case there may also be wrong if
leader->flags has TCB_EXITING.  It should skip the PTRACE_KILL and detach
when leader is already TCB_EXITING.  

Does that all jibe with your understanding?


Thanks,
Roland





More information about the Strace-devel mailing list