[lldb/test] Use the shim executable for TestGdbRemoteAttach*Or*Wait as wellWithout it, the test may nondeterminstically fail due to YAMArestrictions.Also, merge the two tests into one to reduce
[lldb/test] Use the shim executable for TestGdbRemoteAttach*Or*Wait as wellWithout it, the test may nondeterminstically fail due to YAMArestrictions.Also, merge the two tests into one to reduce duplication.
show more ...
Recommit "[lldb/test] Don't use preexec_fn for launching inferiors"This recommits b15b1421, which reverted in was reverted in f51c47d98 due tofailures on apple systems. The problem was that the pa
Recommit "[lldb/test] Don't use preexec_fn for launching inferiors"This recommits b15b1421, which reverted in was reverted in f51c47d98 due tofailures on apple systems. The problem was that the patch introduced a racewhere the debug server could start the attach process before the first process(which isn't supposed to be attached to) was set up. This caused us to attachto the wrong process.The new version introduces additional synchronization to ensure that does nothappen.Original commit message was:As the documentation states, using this is not safe in multithreadedprograms, 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 programfrom the very first instruction, where our usual mechanism ofsynchronization -- 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 createa bespoke solution for that single test. The solution basicallyconsists of outsourcing the preexec_fn code to a separate (andsingle-threaded) shim process, which enables attaching and then executesthe real program.This pattern could be generalized in case we needed to use it for othertests, but I suspect that we will not be having many tests like this.This effectively reverts commita997a1d7fbe229433fb458bb0035b32424ecf3bd.
Revert "[lldb/test] Don't use preexec_fn for launching inferiors"This reverts commit b15b1421bc9a11b318b65b489e5fd58dd917db1f because itbreaks GreenDragon [1]. The bot has been red for several day
Revert "[lldb/test] Don't use preexec_fn for launching inferiors"This reverts commit b15b1421bc9a11b318b65b489e5fd58dd917db1f because itbreaks GreenDragon [1]. The bot has been red for several days, soreverting to green while I take a look.[1] https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/45012/
[lldb/test] Don't use preexec_fn for launching inferiorsAs the documentation states, using this is not safe in multithreadedprograms, and I have traced it to a rare deadlock in some of the tests.
[lldb/test] Don't use preexec_fn for launching inferiorsAs the documentation states, using this is not safe in multithreadedprograms, 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 programfrom the very first instruction, where our usual mechanism ofsynchronization -- 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 createa bespoke solution for that single test. The solution basicallyconsists of outsourcing the preexec_fn code to a separate (andsingle-threaded) shim process, which enables attaching and then executesthe real program.This pattern could be generalized in case we needed to use it for othertests, but I suspect that we will not be having many tests like this.This effectively reverts commita997a1d7fbe229433fb458bb0035b32424ecf3bd.