I'm ptracing a multithreaded application and 9 out of 10 times, the breakpointhandling works just fine, but sometimes i get a SIGCHLD event instead of SIGTRAP.
This is the sequence:
What am I supposed to do with this SIGCHILD? Ignoring it makes the debugger stuck forever in following waitpids. Injecting it back into the debugee with PTRACE_CONT screws with the initial PTRACE_SINGLESTEP.
It seems that it is happening only for main threads (PID==TID), not for childthreads (aka LWP).
I'm using UBUNTU 12.04 64bit in virtual box.
Injecting SIGCHLD with PTRACE_SINGLESTEP (data param) back into debugee seems todo the trick.