[Lldb-commits] [PATCH] D13124: test runner: switch to pure-Python timeout mechanism

Todd Fiala via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 24 08:51:44 PDT 2015


tfiala added a comment.

In http://reviews.llvm.org/D13124#252784, @zturner wrote:

> If I understand correctly, the process hierarchy used to look like this:
>
> python - dotest.py
>  |__ python - multiprocessing fork
>
>   |__ python - lldbtest
>         |__ inferior executable
>   
>
> And now looks like this:
>
> python - dotest.py
>
>   |__ python - lldbtest
>         |__ inferior executable
>   
>
> In either case, the process.terminate() runs in the python - lldbtest
>  process, and terminates the inferior.  So I don't see how the behavior is
>  any different than before.  Do you mean with gtimeout it's creating a
>  separate process group for the inferior so that if the inferior itself
>  spawns children, those will get cleaned up too?


The man page for the timeout (this one here: http://linux.die.net/man/1/timeout) doesn't explicitly call out that it creates a process group, but that wouldn't at all be out of character for a command like that.  Interestingly, it does call out the issue that a using a catchable signal means it can't guarantee that it really shuts down that app if it handles the signal and essentially ignores it.

> do that?  And if so, we could always use the same logic from python of

>  creating the inferior in a separate process group


We have that logic in for non-Windows.  That's the change I sent you a ping on to see if you wanted to add the Windows flag for creating a separate process group.  Since I no longer recall the semantics of that on the Windows side, I wasn't sure if that was useful to you.

I think sending the signal to the process group (since we have one) is probably the right way to go here.  But I also think we get into the realm of "did we really kill it" if we start playing around with catchable signals.  Also, there is going to be a divergence on how that works on Unix-like vs. Windows.  The process group kill command is os.killpg(), which is listed as Unix-only.

I'll come up with the alternative and we can see where we go from there.


http://reviews.llvm.org/D13124





More information about the lldb-commits mailing list