tsan: don't start background thread after clone
authorDmitry Vyukov <dvyukov@google.com>
Thu, 11 Nov 2021 19:37:05 +0000 (20:37 +0100)
committerDmitry Vyukov <dvyukov@google.com>
Fri, 12 Nov 2021 11:58:49 +0000 (12:58 +0100)
commite91595bf948a23bb44a47854321aa80307a48fd1
tree91f7a875b06fa534d7d9fbcd171c8dc52ba99c59
parentaa3731806723a2a12914aecda2af6e40e1903702
tsan: don't start background thread after clone

Start the background thread only after fork, but not after clone.
For fork we did this always and it's known to work (or user code has adopted).
But if we do this for the new clone interceptor some code (sandbox2) fails.
So model we used to do for years and don't start the background thread after clone.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D113744
compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp
compiler-rt/lib/tsan/rtl/tsan_rtl.h
compiler-rt/test/tsan/Linux/clone_setns.cpp [new file with mode: 0644]