Skip to content

Commit db07e08

Browse files
author
Julian Lettner
committed
[TSan] Omit vfork interceptor iOS simulator runtime
`_vfork` moved from libsystem_kernel.dylib to libsystem_c.dylib as part of the below changes. The iOS simulator does not actually have libsystem_kernel.dylib of its own, it only has the host Mac's. The umbrella-nature of Libsystem makes this movement transparent to everyone; except the simulator! So when we "back deploy", i.e., use the current version of TSan with an older simulator runtime then this symbol is now missing, when we run on the latest OS (but an older simulator runtime). Note we use `SANITIZER_IOS` because usage of vfork is forbidden on iOS and the API is completely unavailable on watchOS and tvOS, even if this problem is specific to the iOS simulator. Caused by: rdar://74818691 (Shim vfork() to fork syscall on iOS) rdar://76762076 (Shim vfork() to fork syscall on macOS) Radar-Id: rdar://8634734
1 parent 04eb93b commit db07e08

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,6 +2204,7 @@ void atfork_child() {
22042204
FdOnFork(thr, pc);
22052205
}
22062206

2207+
#if !SANITIZER_IOS
22072208
TSAN_INTERCEPTOR(int, vfork, int fake) {
22082209
// Some programs (e.g. openjdk) call close for all file descriptors
22092210
// in the child process. Under tsan it leads to false positives, because
@@ -2220,6 +2221,7 @@ TSAN_INTERCEPTOR(int, vfork, int fake) {
22202221
// Instead we simply turn vfork into fork.
22212222
return WRAP(fork)(fake);
22222223
}
2224+
#endif
22232225

22242226
#if SANITIZER_LINUX
22252227
TSAN_INTERCEPTOR(int, clone, int (*fn)(void *), void *stack, int flags,

0 commit comments

Comments
 (0)