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

Andrew MacPherson andrew.macp at gmail.com
Tue Mar 25 01:17:39 PDT 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140325/2571351f/attachment.html>


More information about the lldb-dev mailing list