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 | b1f0a346d627aa62189e19039c135e499cd0fff3 (patch) | |
tree | f70bc1b56a4b04cd14796c40eadb7c087c4ba8d6 | |
parent | 6a303a4e73be4823d05b120dacd60e51e1ba7154 (diff) | |
download | bcm5719-llvm-b1f0a346d627aa62189e19039c135e499cd0fff3.tar.gz bcm5719-llvm-b1f0a346d627aa62189e19039c135e499cd0fff3.zip |
[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.
llvm-svn: 304297
-rw-r--r-- | compiler-rt/lib/asan/asan_interceptors.cc | 12 | ||||
-rw-r--r-- | compiler-rt/lib/lsan/lsan_interceptors.cc | 12 |
2 files changed, 16 insertions, 8 deletions
diff --git a/compiler-rt/lib/asan/asan_interceptors.cc b/compiler-rt/lib/asan/asan_interceptors.cc index 1f0dc9e2df3..e82a5a4a7e9 100644 --- a/compiler-rt/lib/asan/asan_interceptors.cc +++ b/compiler-rt/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) { diff --git a/compiler-rt/lib/lsan/lsan_interceptors.cc b/compiler-rt/lib/lsan/lsan_interceptors.cc index b8cf6ae0748..a0a59daa07a 100644 --- a/compiler-rt/lib/lsan/lsan_interceptors.cc +++ b/compiler-rt/lib/lsan/lsan_interceptors.cc @@ -99,13 +99,17 @@ INTERCEPTOR(void*, valloc, uptr size) { #endif static void BeforeFork() { - LockAllocator(); - StackDepotLockAll(); + if (SANITIZER_LINUX) { + LockAllocator(); + StackDepotLockAll(); + } } static void AfterFork() { - StackDepotUnlockAll(); - UnlockAllocator(); + if (SANITIZER_LINUX) { + StackDepotUnlockAll(); + UnlockAllocator(); + } } INTERCEPTOR(int, fork, void) { |