[tsan] Fix fork() and fork-based tests for OS X
authorKuba Brecka <kuba.brecka@gmail.com>
Thu, 24 Mar 2016 11:54:33 +0000 (11:54 +0000)
committerKuba Brecka <kuba.brecka@gmail.com>
Thu, 24 Mar 2016 11:54:33 +0000 (11:54 +0000)
commit3bab18d4af327cdb0e2de49efe62f491899c67d0
tree0541e1070a3a7acf00760780f5f6283a28945e84
parent572ca71573e6a8913f4b7180c8e9fcf1ecb33537
[tsan] Fix fork() and fork-based tests for OS X

On OS X, fork() under TSan asserts (in debug builds only) because REAL(fork) calls some intercepted functions, which check that no internal locks are held via CheckNoLocks(). But the wrapper of fork intentionally holds some locks. This patch fixes that by using ScopedIgnoreInterceptors during the call to REAL(fork). After that, all the fork-based tests seem to pass on OS X, so let's just remove all the UNSUPPORTED: darwin annotations we have.

Differential Revision: http://reviews.llvm.org/D18409

llvm-svn: 264261
compiler-rt/lib/tsan/rtl/tsan_interceptors.cc
compiler-rt/test/tsan/fork_atexit.cc
compiler-rt/test/tsan/fork_deadlock.cc
compiler-rt/test/tsan/fork_multithreaded.cc
compiler-rt/test/tsan/fork_multithreaded3.cc
compiler-rt/test/tsan/vfork.cc