-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Fully Compatible
-
ALL
-
Service Arch 2022-03-07, Service Arch 2022-03-21, Service Arch 2022-04-04
-
170
-
4
Currently, death test unittests work by having a the main unittest process fork(), and then running the code that's expected to crash in the child process. This requires the parent process to be very careful to ensure that all of the state shared with the child process at the time of fork() (i.e. the entire address space which is copied) is in a consistent state. In the case of third-party libraries we vendor (like gperftools), this often means relying on things like pthread_atfork registered handlers to ensure locks are in a consistent state; this can be fragile (the order pthread_atfork handlers will run in is hard to determine, see https://github.com/gperftools/gperftools/issues/904).
Since the child doesn't actually need to share any state with the parent, we should give it a "fresh start" and have it run the code expected to crash in a clean process image via exec(); the parent can still listen in on that process to ensure it fails as expected. This will prevent the child process from starting with bad state (for example locks held in the allocator).
- causes
-
SERVER-70705 Death Test invoked via PATH fails to exec itself
- Closed
- related to
-
SERVER-70604 decrease fork-exec window in jstest shell
- Closed