tsan: do not deadlock on fork

Description

tsan: do not deadlock on fork

Currently correct programs can deadlock after fork, because atomic operations and async-signal-safe calls are not async-signal-safe under tsan.
With this change:

  • if a single-threaded program forks, the child continues running with verification enabled (the tsan background thread is recreated as well)
  • if a multi-threaded program forks, then the child runs with verification disabled (memory accesses, atomic operations and interceptors are disabled); it's expected that it will exec soon anyway
  • if the child tries to create more threads after multi-threaded fork, the program aborts with error message
  • die_after_fork flag is added that allows to continue running, but all bets are off

http://llvm-reviews.chandlerc.com/D2614

Details

Committed
dvyukovJan 24 2014, 4:33 AM
Parents
rL199992: Add missing intrinsics, fix a couple of typos in intrinsic names,
Branches
Unknown
Tags
Unknown