<div dir="ltr">Hello,<div><br></div><div>I'm new to LLDB community and recently started to dive into LLDB.</div><div>I was running tests on my Ubuntu and noticed that sometimes lldb and inferior process remained in process list after test run is completed:</div><div><br></div><div> ps -elf | grep lldb</div><div>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</div><div>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</div><div>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</div><div>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</div><div>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</div><div>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</div><div>0 S ovyalov 14837 28698 0 80 0 - 5936 pipe_w 17:16 pts/57 00:00:00 grep --color=auto lldb</div><div><br></div><div>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.</div><div><br></div><div><div>diff --git a/test/lldbtest.py b/test/lldbtest.py</div><div>index 3c626fd..ed11ef8 100644</div><div>--- a/test/lldbtest.py</div><div>+++ b/test/lldbtest.py</div><div>@@ -1014,12 +1014,12 @@ class Base(unittest2.TestCase):</div><div> self.child.sendline('settings set interpreter.prompt-on-quit false')</div><div> self.child.sendline('quit')</div><div> self.child.expect(pexpect.EOF)</div><div>- except ValueError, ExceptionPexpect:</div><div>+ except (ValueError, pexpect.ExceptionPexpect):</div><div> # child is already terminated</div><div> pass</div><div>-</div><div>- # Give it one final blow to make sure the child is terminated.</div><div>- self.child.close()</div><div>+<span class="" style="white-space:pre"> </span> finally:</div><div>+<span class="" style="white-space:pre"> </span># Give it one final blow to make sure the child is terminated.</div><div>+<span class="" style="white-space:pre"> </span>self.child.close()</div><div> </div><div> </div><div> def tearDown(self):</div></div><div><br></div><div><br></div><div>Thank you.</div><div><br clear="all"><div><br></div>-- <br><div dir="ltr"><span style="color:rgb(85,85,85);font-family:sans-serif;line-height:20px;border-width:2px 0px 0px;border-style:solid;border-color:rgb(213,15,37);padding-top:2px;margin-top:2px;background-color:rgb(255,255,255)">Oleksiy Vyalov |</span><span style="color:rgb(85,85,85);font-family:sans-serif;line-height:20px;border-width:2px 0px 0px;border-style:solid;border-color:rgb(51,105,232);padding-top:2px;margin-top:2px;background-color:rgb(255,255,255)"> Software Engineer |</span><span style="color:rgb(85,85,85);font-family:sans-serif;line-height:20px;border-width:2px 0px 0px;border-style:solid;border-color:rgb(0,153,57);padding-top:2px;margin-top:2px;background-color:rgb(255,255,255)"> <a href="mailto:ovyalov@google.com" target="_blank">ovyalov<font color="#1155cc">@google.com</font></a></span></div>
</div></div>