diff options
author | Pavel Labath <pavel@labath.sk> | 2022-07-01 14:32:50 +0200 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2022-07-01 14:36:01 +0200 |
commit | b15b1421bc9a11b318b65b489e5fd58dd917db1f (patch) | |
tree | 7956491226784f96588468855b83ae4c9d24dac5 /lldb/packages/Python/lldbsuite/test/lldbtest.py | |
parent | fabe915705472e2c06ed1aa9a90620462594e82f (diff) | |
download | llvm-b15b1421bc9a11b318b65b489e5fd58dd917db1f.zip llvm-b15b1421bc9a11b318b65b489e5fd58dd917db1f.tar.gz llvm-b15b1421bc9a11b318b65b489e5fd58dd917db1f.tar.bz2 |
[lldb/test] Don't use preexec_fn for launching inferiors
As the documentation states, using this is not safe in multithreaded
programs, and I have traced it to a rare deadlock in some of the tests.
The reason this was introduced was to be able to attach to a program
from the very first instruction, where our usual mechanism of
synchronization -- waiting for a file to appear -- does not work.
However, this is only needed for a single test
(TestGdbRemoteAttachWait) so instead of doing this everywhere, I create
a bespoke solution for that single test. The solution basically
consists of outsourcing the preexec_fn code to a separate (and
single-threaded) shim process, which enables attaching and then executes
the real program.
This pattern could be generalized in case we needed to use it for other
tests, but I suspect that we will not be having many tests like this.
This effectively reverts commit
a997a1d7fbe229433fb458bb0035b32424ecf3bd.
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbtest.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/lldbtest.py | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py index 2285173..d46e54f 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbtest.py +++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -393,7 +393,6 @@ class _LocalProcess(_BaseProcess): stdout=open( os.devnull) if not self._trace_on else None, stdin=PIPE, - preexec_fn=lldbplatformutil.enable_attach, env=env) def terminate(self): |