https://github.com/Teemperor updated 
https://github.com/llvm/llvm-project/pull/195816

>From 2e832f8ceb84958afe483945eb7f884373a33603 Mon Sep 17 00:00:00 2001
From: Raphael Isemann <[email protected]>
Date: Fri, 1 May 2026 10:41:43 +0100
Subject: [PATCH] [lldb][test] Move dotest processes to own group to avoid
 random SIGHUPs

On macOS, LLDB's test suite randomly receives SIGHUP signals that stop
the test suite early. The source of these SIGHUP's seems to be
a bug in the kernel (most likely the job control).

The exact steps for reproducing this are not clear, but I have a set
of three tests of which two need to run concurrently for this to
trigger:

* TestDAP_runInTerminal
* TestDAP_launch_io_integratedTerminal
* TestDAP_launch_stdio_redirection_and_console

I was also running UBSan on this build which may or may not be
necessary to make this random failure more persistent.

When these tests run, macOS job control will send SIGHUP to the
process group of the spawned subprocesses in that test. As LIT is in
the same process group, it also receives the SIGHUP and shuts down.

This patch forces all spawned subprocess to its own process group. This
won't stop the SIGHUP and only prevents it from reaching LIT or dotest.
This change is applied to all dotest processes as we saw similar
failures before DAP tests were introduced.

The SIGHUP itself doesn't seem to affect the DAP test itself. My theory
here is that the SIGHUP is received during test shutdown (or after it
was shut down), so that's why it doesn't cause any (visible) failures
in any of the tests.
---
 lldb/packages/Python/lldbsuite/test/lldbtest.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py 
b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index f0eafba899c29..15976036808b0 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -441,6 +441,15 @@ def launch(self, executable, args, extra_env, **kwargs):
             stderr=stderr,
             stdin=PIPE,
             env=env,
+            # This works around a bug in the macOS job control code where
+            # a supurious SIGHUP is sent to the the process group of our
+            # spawned subprocess when it is shutting down.
+            # While this SIGHUP doesn't cause any issues for our subprocess,
+            # it does reach the LIT process and stops the test suite run
+            # early.
+            # This parameter forces the spawned process into a new process
+            # group which prevents the supurious SIGHUP from reaching LIT.
+            start_new_session=True,
             **kwargs,
         )
 

_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to