diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2013-04-24 11:06:05 +0000 |
---|---|---|
committer | Dmitry Vyukov <dvyukov@google.com> | 2013-04-24 11:06:05 +0000 |
commit | edd2821982c058469dca631a3147fdd42045c48a (patch) | |
tree | 722510c101c4c4d5847a83e245dabfb5f97bd7fe /lib | |
parent | 03049413f8978c202a254eb0acfa2f10b9bbe34a (diff) |
tsan: disable getpwuid_r() and glob64() interceptors under tsan, because they cause interceptor recursion if user intercepts fopen()
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@180182 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sanitizer_common/sanitizer_platform_interceptors.h | 4 | ||||
-rw-r--r-- | lib/tsan/rtl/tsan_interceptors.cc | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/sanitizer_common/sanitizer_platform_interceptors.h b/lib/sanitizer_common/sanitizer_platform_interceptors.h index 69bc2459b..f513bb3f2 100644 --- a/lib/sanitizer_common/sanitizer_platform_interceptors.h +++ b/lib/sanitizer_common/sanitizer_platform_interceptors.h @@ -11,6 +11,8 @@ // given library functions on a given platform. // //===----------------------------------------------------------------------===// +#ifndef SANITIZER_PLATFORM_INTERCEPTORS_H +#define SANITIZER_PLATFORM_INTERCEPTORS_H #include "sanitizer_internal_defs.h" @@ -67,3 +69,5 @@ # define SANITIZER_INTERCEPT_GLOB SI_LINUX_NOT_ANDROID # define SANITIZER_INTERCEPT_WAIT SI_NOT_WINDOWS # define SANITIZER_INTERCEPT_INET SI_NOT_WINDOWS + +#endif // #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H diff --git a/lib/tsan/rtl/tsan_interceptors.cc b/lib/tsan/rtl/tsan_interceptors.cc index dc7d31dcb..c7651c67b 100644 --- a/lib/tsan/rtl/tsan_interceptors.cc +++ b/lib/tsan/rtl/tsan_interceptors.cc @@ -10,7 +10,7 @@ // This file is a part of ThreadSanitizer (TSan), a race detector. // // FIXME: move as many interceptors as possible into -// sanitizer_common/sanitizer_common_interceptors.h +// sanitizer_common/sanitizer_common_interceptors.inc //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_atomic.h" @@ -1835,6 +1835,13 @@ struct TsanInterceptorContext { const uptr pc; }; +#include "sanitizer_common/sanitizer_platform_interceptors.h" +// Causes interceptor recursion (getpwuid_r() calls fopen()) +#undef SANITIZER_INTERCEPT_GETPWNAM_AND_FRIENDS +#undef SANITIZER_INTERCEPT_GETPWNAM_R_AND_FRIENDS +// Causes interceptor recursion (glob64() calls lstat64()) +#undef SANITIZER_INTERCEPT_GLOB + #define COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, size) \ MemoryAccessRange(((TsanInterceptorContext*)ctx)->thr, \ ((TsanInterceptorContext*)ctx)->pc, \ |