This is an archive of the discontinued LLVM Phabricator instance.

Bug 23051 - Fix zombie processes after lldb-server tests
ClosedPublic

Authored by ki.stfu on Apr 14 2015, 9:37 AM.

Details

Summary

This patch fixes the following bug: https://llvm.org/bugs/show_bug.cgi?id=23181
For some reason some lldb-server tests should be kicked using SIGHUP and SIGINT before termination, otherwise it will leave a zombie process.
I think the reason is that the lldb-server will terminate a slave process if it gets the SIGHUP/SIGINT and if so it should be fixed in lldb-server.

The solution is to terminate process like it does the pexpect (including the delayafterterminate interval).

Also this patch reverts the following commits:

  • r234549 - Skip lldb-server tests according to bug 23181
  • r234765 - Skip a few tests on OS X according to the bug 23181
  • r234803 - Skip the TestGdbRemoteRegisterState.test_grp_register_save_restore_works_no_suffix_debugserver_dsym test on OS X according to the bug 23181

Diff Detail

Event Timeline

ki.stfu updated this revision to Diff 23738.Apr 14 2015, 9:37 AM
ki.stfu retitled this revision from to Bug 23051 - Fix zombie processes after lldb-server tests.
ki.stfu updated this object.
ki.stfu edited the test plan for this revision. (Show Details)
ki.stfu updated this object.Apr 14 2015, 9:39 AM
ki.stfu updated this object.
ki.stfu updated this object.Apr 14 2015, 9:41 AM
tberghammer requested changes to this revision.Apr 14 2015, 10:01 AM
tberghammer edited edge metadata.

Thanks for looking into it.

test/lldbtest.py
284–289

I think we should use kill() here to be sure the process is stopped (or add one more layer where we first do a terminate and if it is unsuccessful then do a kill).

This revision now requires changes to proceed.Apr 14 2015, 10:01 AM
clayborg accepted this revision.Apr 14 2015, 10:53 AM
clayborg edited edge metadata.
ki.stfu added inline comments.Apr 14 2015, 11:46 AM
test/lldbtest.py
284–289

I have thought about this, ok. BTW, the pexpect also sends SIGCONT, but I didn't understand why it's needed. Should I use it too or not?

tberghammer added inline comments.Apr 14 2015, 3:25 PM
test/lldbtest.py
284–289

I have no idea why it sends SIGCONT. I think if you send a SIGKILL then the process should die in any condition so sending a SIGCONT isn't necessary but I might be wrong.

ki.stfu updated this revision to Diff 23770.Apr 15 2015, 6:35 AM
ki.stfu edited edge metadata.

Send SIGCONT and SIGKILL signals on termination

This revision was automatically updated to reflect the committed changes.