diff options
author | Maxim Ostapenko <chefmax7@gmail.com> | 2017-05-31 11:40:57 +0000 |
---|---|---|
committer | Maxim Ostapenko <chefmax7@gmail.com> | 2017-05-31 11:40:57 +0000 |
commit | e1dfaf677272ae85e80cae9a72295e5fede40192 (patch) | |
tree | d3c1fee0c7f20197b21babe1287103505716bf35 /lib/asan/asan_interceptors.cc | |
parent | e1a8ef98132e737d3e7c4045a3e6e6e7ae20242e (diff) |
[sanitizer] Trying to fix MAC buildbots after r304285
It seems that on MAC allocator already locks on fork thus adding another ForceLock
in fork interceptor will cause a deadlock.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@304297 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_interceptors.cc')
-rw-r--r-- | lib/asan/asan_interceptors.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/asan/asan_interceptors.cc b/lib/asan/asan_interceptors.cc index 1f0dc9e2d..e82a5a4a7 100644 --- a/lib/asan/asan_interceptors.cc +++ b/lib/asan/asan_interceptors.cc @@ -707,13 +707,17 @@ INTERCEPTOR(int, __cxa_atexit, void (*func)(void *), void *arg, #if ASAN_INTERCEPT_FORK static void BeforeFork() { - get_allocator().ForceLock(); - StackDepotLockAll(); + if (SANITIZER_LINUX) { + get_allocator().ForceLock(); + StackDepotLockAll(); + } } static void AfterFork() { - StackDepotUnlockAll(); - get_allocator().ForceUnlock(); + if (SANITIZER_LINUX) { + StackDepotUnlockAll(); + get_allocator().ForceUnlock(); + } } INTERCEPTOR(int, fork, void) { |