Skip to content
Commit 62a0f559 authored by Maxim Ostapenko's avatar Maxim Ostapenko
Browse files

[sanitizer] Avoid possible deadlock in child process after fork

This patch addresses https://github.com/google/sanitizers/issues/774. When we
fork a multi-threaded process it's possible to deadlock if some thread acquired
StackDepot or allocator internal lock just before fork. In this case the lock
will never be released in child process causing deadlock on following memory alloc/dealloc
routine. While calling alloc/dealloc routines after multi-threaded fork is not allowed,
most of modern allocators (Glibc, tcmalloc, jemalloc) are actually fork safe. Let's do the same
for sanitizers except TSan that has complex locking rules.

Differential Revision: https://reviews.llvm.org/D33325

llvm-svn: 304285
parent 043fa4b3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment