https://github.com/DavidSpickett updated 
https://github.com/llvm/llvm-project/pull/143732

>From 8ab827fab1dc9fed30b28f03b545f78d96af7946 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spick...@linaro.org>
Date: Wed, 11 Jun 2025 15:29:29 +0000
Subject: [PATCH 1/2] [lldb][test] Don't call SBDebugger::Terminate if
 TestMultipleDebuggers times out

Fixes #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, 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. 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 can exit.

This means what should have been a timeout is now 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.
---
 lldb/test/API/api/multiple-debuggers/TestMultipleDebuggers.py | 2 --
 lldb/test/API/api/multiple-debuggers/multi-process-driver.cpp | 4 +++-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lldb/test/API/api/multiple-debuggers/TestMultipleDebuggers.py 
b/lldb/test/API/api/multiple-debuggers/TestMultipleDebuggers.py
index 1fd4806cd74f4..f0a3893f53aab 100644
--- a/lldb/test/API/api/multiple-debuggers/TestMultipleDebuggers.py
+++ b/lldb/test/API/api/multiple-debuggers/TestMultipleDebuggers.py
@@ -12,8 +12,6 @@
 class TestMultipleSimultaneousDebuggers(TestBase):
     NO_DEBUG_INFO_TESTCASE = True
 
-    # Sometimes times out on Linux, see 
https://github.com/llvm/llvm-project/issues/101162.
-    @skipIfLinux
     @skipIfNoSBHeaders
     @skipIfWindows
     @skipIfHostIncompatibleWithTarget
diff --git a/lldb/test/API/api/multiple-debuggers/multi-process-driver.cpp 
b/lldb/test/API/api/multiple-debuggers/multi-process-driver.cpp
index 64728fb7c29a1..fcec9bae0ed9c 100644
--- a/lldb/test/API/api/multiple-debuggers/multi-process-driver.cpp
+++ b/lldb/test/API/api/multiple-debuggers/multi-process-driver.cpp
@@ -296,6 +296,8 @@ int main (int argc, char **argv)
                  NUMBER_OF_SIMULTANEOUS_DEBUG_SESSIONS);
     }
 
-    SBDebugger::Terminate();
+    // We do not call SBDebugger::Terminate() here because it will destroy
+    // data that might be being used by threads that are still running. Which
+    // would change the timeout into an unrelated crash.
     exit (1);
 }

>From 102139ca0bb03c7325d95fa26c8c6acaa02a912b Mon Sep 17 00:00:00 2001
From: David Spickett <david.spick...@linaro.org>
Date: Thu, 12 Jun 2025 14:24:38 +0000
Subject: [PATCH 2/2] _exit

---
 lldb/test/API/api/multiple-debuggers/multi-process-driver.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lldb/test/API/api/multiple-debuggers/multi-process-driver.cpp 
b/lldb/test/API/api/multiple-debuggers/multi-process-driver.cpp
index fcec9bae0ed9c..5ad75e3c1e472 100644
--- a/lldb/test/API/api/multiple-debuggers/multi-process-driver.cpp
+++ b/lldb/test/API/api/multiple-debuggers/multi-process-driver.cpp
@@ -299,5 +299,6 @@ int main (int argc, char **argv)
     // We do not call SBDebugger::Terminate() here because it will destroy
     // data that might be being used by threads that are still running. Which
     // would change the timeout into an unrelated crash.
-    exit (1);
+    // _exit instead of exit, to skip more things that could cause a crash.
+    _exit(1);
 }

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to