<div dir="ltr">Great - thank you for quick review and check-in!</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 24, 2014 at 12:04 PM, <span dir="ltr"><<a href="mailto:jingham@apple.com" target="_blank">jingham@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ooh, thanks! I had noticed that the spawned lldb's were getting stranded when I wrote the batch mode tests, and figuring out what was wrong there was on my list of things to do, so thanks for saving me the detective work. This looks right, and moreover works! I checked it in as r220583.<br>
<br>
Jim<br>
<div><div class="h5"><br>
> On Oct 24, 2014, at 10:43 AM, Oleksiy Vyalov <<a href="mailto:ovyalov@google.com">ovyalov@google.com</a>> wrote:<br>
><br>
> Hello,<br>
><br>
> I'm new to LLDB community and recently started to dive into LLDB.<br>
> I was running tests on my Ubuntu and noticed that sometimes lldb and inferior process remained in process list after test run is completed:<br>
><br>
> ps -elf | grep lldb<br>
> 0 S ovyalov 13653 4457 0 80 0 - 125362 futex_ 11:09 ? 00:00:00 /usr/local/home/ovyalov/projects/lldb/git/build/bin/lldb --no-lldbinit -b -o break set -n main -o run -o continue /usr/local/home/ovyalov/projects/lldb/git/lldb/test/driver/batch_mode/a.out -- CRASH<br>
> 0 t ovyalov 13783 13653 0 80 0 - 1049 ptrace 11:09 pts/60 00:00:00 /usr/local/home/ovyalov/projects/lldb/git/lldb/test/driver/batch_mode/a.out CRASH<br>
> 0 S ovyalov 14124 4457 0 80 0 - 125362 futex_ 11:43 ? 00:00:00 /usr/local/home/ovyalov/projects/lldb/git/build/bin/lldb --no-lldbinit -b -o break set -n main -o run -o continue /usr/local/home/ovyalov/projects/lldb/git/lldb/test/driver/batch_mode/a.out -- CRASH<br>
> 0 t ovyalov 14299 14124 0 80 0 - 1049 ptrace 11:43 pts/67 00:00:00 /usr/local/home/ovyalov/projects/lldb/git/lldb/test/driver/batch_mode/a.out CRASH<br>
> 0 S ovyalov 14803 14689 0 80 0 - 125297 futex_ 17:15 pts/55 00:00:00 ./lldb --no-lldbinit -b -o break set -n main -o run -o continue /usr/local/home/ovyalov/projects/lldb/git/lldb/test/driver/batch_mode/a.out -- NOCRASH<br>
> 0 t ovyalov 14809 14803 0 80 0 - 1048 ptrace 17:15 pts/58 00:00:00 /usr/local/home/ovyalov/projects/lldb/git/lldb/test/driver/batch_mode/a.out NOCRASH<br>
> 0 S ovyalov 14837 28698 0 80 0 - 5936 pipe_w 17:16 pts/57 00:00:00 grep --color=auto lldb<br>
><br>
> As I found out, the problem is in lldbtest.py which improperly handles exceptions. I've attached a patch to address this issue - please let me know whether it looks okay.<br>
><br>
> diff --git a/test/lldbtest.py b/test/lldbtest.py<br>
> index 3c626fd..ed11ef8 100644<br>
> --- a/test/lldbtest.py<br>
> +++ b/test/lldbtest.py<br>
> @@ -1014,12 +1014,12 @@ class Base(unittest2.TestCase):<br>
> self.child.sendline('settings set interpreter.prompt-on-quit false')<br>
> self.child.sendline('quit')<br>
> self.child.expect(pexpect.EOF)<br>
> - except ValueError, ExceptionPexpect:<br>
> + except (ValueError, pexpect.ExceptionPexpect):<br>
> # child is already terminated<br>
> pass<br>
> -<br>
> - # Give it one final blow to make sure the child is terminated.<br>
> - self.child.close()<br>
> + finally:<br>
> + # Give it one final blow to make sure the child is terminated.<br>
> + self.child.close()<br>
><br>
><br>
> def tearDown(self):<br>
><br>
><br>
> Thank you.<br>
><br>
><br>
> --<br>
> Oleksiy Vyalov | Software Engineer | <a href="mailto:ovyalov@google.com">ovyalov@google.com</a><br>
</div></div>> <lldbtest.py.patch>_______________________________________________<br>
> lldb-commits mailing list<br>
> <a href="mailto:lldb-commits@cs.uiuc.edu">lldb-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><span style="color:rgb(85,85,85);font-family:sans-serif;line-height:20px;background-color:rgb(255,255,255);border-width:2px 0px 0px;border-style:solid;border-color:rgb(213,15,37);padding-top:2px;margin-top:2px">Oleksiy Vyalov |</span><span style="color:rgb(85,85,85);font-family:sans-serif;line-height:20px;background-color:rgb(255,255,255);border-width:2px 0px 0px;border-style:solid;border-color:rgb(51,105,232);padding-top:2px;margin-top:2px"> Software Engineer |</span><span style="color:rgb(85,85,85);font-family:sans-serif;line-height:20px;background-color:rgb(255,255,255);border-width:2px 0px 0px;border-style:solid;border-color:rgb(0,153,57);padding-top:2px;margin-top:2px"> <a href="mailto:ovyalov@google.com" target="_blank">ovyalov<font color="#1155cc">@google.com</font></a></span></div>
</div>