Skip to content

Commit dc23003

Browse files
DavidSpicketttomtor
authored andcommitted
[lldb][test] Don't call SBDebugger::Terminate if TestMultipleDebuggers times out (llvm#143732)
Fixes llvm#101162 This test did this: * SBDebugger::Initialize * Spawn a bunch of threads that do: * SBDebugger::Create * some work * SBDebugger::Destroy * Wait on those threads to finish then call SBDebugger::Terminate and exit, or - * Reach a time limit before all the threads finish, call SBDebugger::Terminate and exit. The problem was that in the timeout case, calling SBDebugger::Terminate destroys data being used by threads that are still running. I expect this test was expecting said threads to be so broken they were probably stuck, but when the machine is just heavily loaded, one of them might read that data before the whole program exits. This means what should have been a timeout becomes a crash. Sometimes. Which explains why we saw both timeouts and various signals on the AArch64 Linux bot. It depends on the timings. So I'm changing it not to call SBDebugger::Terminate in the timeout case. We will have to tweak the timeout value based on what happens on the buildbot, but we will know it's machine load not an lldb bug. Also use _exit instead of exit, to skip more cleanup that might cause a crash.
1 parent 1640b24 commit dc23003

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lldb/test/API/api/multiple-debuggers/TestMultipleDebuggers.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
class TestMultipleSimultaneousDebuggers(TestBase):
1313
NO_DEBUG_INFO_TESTCASE = True
1414

15-
# Sometimes times out on Linux, see https://github.com/llvm/llvm-project/issues/101162.
16-
@skipIfLinux
1715
@skipIfNoSBHeaders
1816
@skipIfWindows
1917
@skipIfHostIncompatibleWithTarget

lldb/test/API/api/multiple-debuggers/multi-process-driver.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,9 @@ int main (int argc, char **argv)
296296
NUMBER_OF_SIMULTANEOUS_DEBUG_SESSIONS);
297297
}
298298

299-
SBDebugger::Terminate();
300-
exit (1);
299+
// We do not call SBDebugger::Terminate() here because it will destroy
300+
// data that might be being used by threads that are still running. Which
301+
// would change the timeout into an unrelated crash.
302+
// _exit instead of exit, to skip more things that could cause a crash.
303+
_exit(1);
301304
}

0 commit comments

Comments
 (0)