[Lldb-commits] [PATCH] Fix lldb-gdbserver gdb-remote unit tests that require attaching to the inferior.

Doug Snyder dsnyder at blueshiftinc.com
Fri Oct 17 15:41:03 PDT 2014


i couldn't figure out where to sign up for review status at llvm.org, so i
just took the 2 code snippets from D5846/Diff15089 and applied them to my
copy of test/tools/lldb-gdbserver/main.cpp

i tested the changes with runtest.py with ubuntu14.04, clang3.5
(/usr/bin/clang) and no ccache.  5 of the 9 previously seen unit test
failures remain, but the following 4 unit tests are fixed
    TestGdbRemoteAttach.py
TestGdbRemoteKill.py
TestGdbRemoteProcessInfo.py
TestLldbGdbServer.py

i got similar results when i ran ninja check-lldb with ubuntu14.04,
clang3.5 (/usr/bin/clang) and no ccache

the patch seems to fix these 4 unit tests without breaking anything else

there is a related unit test called TestGdbRemoteThreadsInStopReply.py that
has intermittently failed in the past, but it did not fail after your patch
using either of the test methods. your patch may have fixed this failure,
but i can't tell for certain.

notes:
i have since figured out how to sign up for review status (and done so)
when i first made the patch to main.cpp, ninja didn't seem to recognize
that there had been a change that needed recompiling, so i had to do a new
configure

doug





test/tools/lldb-gdbserver/main.cpp

On Fri, Oct 17, 2014 at 11:39 AM, Todd Fiala <tfiala at google.com> wrote:

> Hey Doug,
>
> Can you create yourself an account on reviews.llvm.org, add yourself as a
> reviewer, and check if this patch fixes the attach failures we diagnosed at
> your desk the other day?
>
> Thanks!
>
> -Todd
>
> On Fri, Oct 17, 2014 at 11:38 AM, Todd Fiala <todd.fiala at gmail.com> wrote:
>
>> Some Linux kernels have a ptrace security feature that prevents a ptracer
>> from attaching to the inferior if the ptracer is not an ancestor in the
>> process hierarchy.  In the gdb-remote attach tests, the llgs is not a
>> parent of the inferior, so kernels that protect against this are failing on
>> the attach tests.
>>
>> This change to the inferior test program checks if the inferior is
>> running on Linux and has the relevant ptrace flags, and if so, first thing
>> enables a ptracer that is not part of the parent hierarchy.
>>
>> http://reviews.llvm.org/D5846
>>
>> Files:
>>   test/tools/lldb-gdbserver/main.cpp
>>
>> _______________________________________________
>> lldb-commits mailing list
>> lldb-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
>>
>>
>
>
> --
> Todd Fiala | Software Engineer | tfiala at google.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20141017/be210a07/attachment.html>


More information about the lldb-commits mailing list