This is an archive of the discontinued LLVM Phabricator instance.

Fix lldb-gdbserver gdb-remote unit tests that require attaching to the inferior.
ClosedPublic

Authored by tfiala on Oct 17 2014, 11:38 AM.

Details

Reviewers
tfiala
Summary

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.

Diff Detail

Event Timeline

tfiala updated this revision to Diff 15089.Oct 17 2014, 11:38 AM
tfiala retitled this revision from to Fix lldb-gdbserver gdb-remote unit tests that require attaching to the inferior..
tfiala updated this object.
tfiala edited the test plan for this revision. (Show Details)
tfiala added a subscriber: Unknown Object (MLST).

I verified this on a stock ubuntu 14.04 x86_64 system. This fixes 4 of the 11 failing tests I see on a stock ubuntu 14.04 x86_64 system. I'm going to go ahead and check this in.

tfiala accepted this revision.Oct 19 2014, 9:07 PM
tfiala added a reviewer: tfiala.
This revision is now accepted and ready to land.Oct 19 2014, 9:07 PM
tfiala closed this revision.Oct 19 2014, 9:08 PM

This fixes the following test failures:

FAIL: LLDB (suite) :: TestGdbRemoteProcessInfo.py (Linux vagrant 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64)

FAIL: LLDB (suite) :: TestGdbRemoteAttach.py (Linux vagrant 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64)

FAIL: LLDB (suite) :: TestLldbGdbServer.py (Linux vagrant 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64)

FAIL: LLDB (suite) :: TestGdbRemoteKill.py (Linux vagrant 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64)

Checked in here.

svn commit
Sending        test/tools/lldb-gdbserver/main.cpp
Transmitting file data .
Committed revision 220181.

FWIW:

These are the test failures I still see on a stock Linux x86_64 system at TOT:

FAIL: LLDB (suite) :: TestCallStopAndContinue.py (Linux vagrant 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64)

FAIL: LLDB (suite) :: TestDataFormatterStdVector.py (Linux vagrant 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64)

FAIL: LLDB (suite) :: TestDataFormatterStdVBool.py (Linux vagrant 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64)

FAIL: LLDB (suite) :: TestDataFormatterStdMap.py (Linux vagrant 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64)

FAIL: LLDB (suite) :: TestDataFormatterSynthVal.py (Linux vagrant 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64)

FAIL: LLDB (suite) :: TestReportData.py (Linux vagrant 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64)

FAIL: LLDB (suite) :: TestMemoryHistory.py (Linux vagrant 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64)