[Lldb-commits] test/lldbtest.py fix

Oleksiy Vyalov ovyalov at google.com
Fri Oct 24 12:08:33 PDT 2014


Great - thank you for quick review and check-in!

On Fri, Oct 24, 2014 at 12:04 PM, <jingham at apple.com> wrote:

> 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.
>
> Jim
>
> > On Oct 24, 2014, at 10:43 AM, Oleksiy Vyalov <ovyalov at google.com> wrote:
> >
> > Hello,
> >
> > I'm new to LLDB community and recently started to dive into LLDB.
> > I was running tests on my Ubuntu and noticed that sometimes lldb and
> inferior process remained in process list after test run is completed:
> >
> >  ps -elf | grep lldb
> > 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
> > 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
> > 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
> > 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
> > 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
> > 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
> > 0 S ovyalov  14837 28698  0  80   0 -  5936 pipe_w 17:16 pts/57
>  00:00:00 grep --color=auto lldb
> >
> > 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.
> >
> > diff --git a/test/lldbtest.py b/test/lldbtest.py
> > index 3c626fd..ed11ef8 100644
> > --- a/test/lldbtest.py
> > +++ b/test/lldbtest.py
> > @@ -1014,12 +1014,12 @@ class Base(unittest2.TestCase):
> >                  self.child.sendline('settings set
> interpreter.prompt-on-quit false')
> >                  self.child.sendline('quit')
> >                  self.child.expect(pexpect.EOF)
> > -            except ValueError, ExceptionPexpect:
> > +            except (ValueError, pexpect.ExceptionPexpect):
> >                  # child is already terminated
> >                  pass
> > -
> > -            # Give it one final blow to make sure the child is
> terminated.
> > -            self.child.close()
> > +         finally:
> > +             # Give it one final blow to make sure the child is
> terminated.
> > +             self.child.close()
> >
> >
> >      def tearDown(self):
> >
> >
> > Thank you.
> >
> >
> > --
> > Oleksiy Vyalov | Software Engineer | ovyalov at google.com
> > <lldbtest.py.patch>_______________________________________________
> > lldb-commits mailing list
> > lldb-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
>
>


-- 
Oleksiy Vyalov | Software Engineer | ovyalov at google.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20141024/cc4ca4e9/attachment.html>


More information about the lldb-commits mailing list