This is an archive of the discontinued LLVM Phabricator instance.

tsan: don't start background thread after clone
ClosedPublic

Authored by dvyukov on Nov 12 2021, 1:40 AM.

Details

Summary

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.

Diff Detail

Event Timeline

dvyukov requested review of this revision.Nov 12 2021, 1:40 AM
dvyukov created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptNov 12 2021, 1:40 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
melver accepted this revision.Nov 12 2021, 2:49 AM
melver added inline comments.
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp
522–523

This comment block seems more appropriate above the call to this function in the clone interceptor.

This revision is now accepted and ready to land.Nov 12 2021, 2:49 AM
dvyukov updated this revision to Diff 386787.Nov 12 2021, 3:56 AM

move the comment to clone interceptor

dvyukov marked an inline comment as done.Nov 12 2021, 3:56 AM
This revision was landed with ongoing or failed builds.Nov 12 2021, 3:58 AM
This revision was automatically updated to reflect the committed changes.