[patch] Hangs and/or multithreaded process left Stopped (T) on CTRL-C of strace
Roland McGrath
roland at redhat.com
Thu May 24 09:54:00 UTC 2007
What is <unistd.h> for?
tcp->parent->pid is wrong when there are -f fork children (not threads).
I believe that with your patch:
(sleep 5; exec sh -c 'sleep 10; sleep 10') & strace -f -p $!
# wait > 5sec
^C
will do a wrong tgkill to the sleep process, passing tgid of sh instead,
get ESRCH and block in wait4 having sent no SIGSTOP.
I think the tgid arg needs to be:
(tcp->flags & TCB_CLONE_THREAD) ? tcp->parent->pid : tcp->pid
Thanks,
Roland
More information about the Strace-devel
mailing list