[lldb-dev] Tests leaving behind zombie processes on OS X

Chaoren Lin chaorenl at google.com
Wed Apr 1 16:11:45 PDT 2015


> That is horrifying. This cannot possibly be the intended behavior.

Sorry, I got a bit too dramatic here.

We will try to fix this up in lldb-server but hopefully it can be addressed
at the OS level, too. I think this would be a very good improvement for the
OS X community.

On Wed, Apr 1, 2015 at 3:57 PM, Chaoren Lin <chaorenl at google.com> wrote:

> Since these are all GdbRemote tests, the regular process of iterating over
> targets/process in self.dbg and killing them is ineffective. I think we'll
> need to add a tear down step in gdbremote_testcase.py to cleanup using raw
> gdb packets to debugserver.
>
> all processes get re-parented to launchd and they *remain zombies there*.
>
>
> That is horrifying. This cannot possibly be the intended behavior.
>
> On Wed, Apr 1, 2015 at 11:24 AM, Greg Clayton <gclayton at apple.com> wrote:
>
>> Someone isn't reaping their processes. Since you have figured out which
>> tests do this, it shouldn't be too hard to track down. After the python
>> process goes away, all processes get re-parented to launchd and they remain
>> zombies there. Some GDB remote tests actually launch their own process and
>> then they attach to it using the debugserver. In this case, on MacOSX, we
>> still need to reap the process, even though "debugserver" or "lldb-server"
>> also needs to reap it if they don't detach... So on MacOSX:
>>
>> If you:
>> - python: launch "a.out" from python
>> - debugserver: attach to it and debug it and kill
>> - debugserver: needs to reap "a.out"
>> - python: needs to reap "a.out"
>>
>> Not sure if the python needing to reap "a.out" also happens on other unix
>> variants or if this is just Mach/BSD specific? Or just Darwin specific.
>>
>>
>> > On Mar 31, 2015, at 3:25 PM, Chaoren Lin <chaorenl at google.com> wrote:
>> >
>> > Hi Greg,
>> >
>> > The following tests leave behind zombie a.out processes on OS X after
>> finishing:
>> >       • TestGdbRemoteAbort.py
>> >       • TestGdbRemoteSegFault.py
>> >       • TestGdbRemote_vCont.py
>> >       • TestGdbRemoteSingleStep.py
>> >       • TestLldbGdbServer.py
>> > Since the parent is launchd, there is no way to remove them. Eventually
>> our OS X buildbot runs into a zombie apocalypse, and must be rebooted.
>> >
>> > This seems to be a bug in launchd, since it should be reaping the
>> zombies.
>> >
>> > Is there anything we can do about this?
>> >
>> > Thanks,
>> > Chaoren
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150401/4356a352/attachment.html>


More information about the lldb-dev mailing list