[lldb-dev] Process attach and pgid of forked process under Linux

jingham at apple.com jingham at apple.com
Tue Mar 25 09:54:37 PDT 2014

Why are you waiting for process groups?  That's not something we have to do on Mac OS X.


On Mar 25, 2014, at 1:17 AM, Andrew MacPherson <andrew.macp at gmail.com> wrote:

> Currently under Linux if you attach to a process whose process group id is not equal to its process id (such as the child process of a fork() call) the calls to waitpid() that pass -1*pid will return ECHILD since the pid argument refers to a process group that doesn't exist. These calls occur in Host::MonitorChildProcessThreadFunction() and the Linux ProcessMonitor.
> Changing -1*pid to simply -1 or to -1*getpgid(pid) resolves the issue but it's not clear if this is the right fix as I'm unsure how other OSes deal with this scenario.
> Any thoughts?
> Thanks,
> Andrew
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

More information about the lldb-dev mailing list