[compiler-rt] c80604f - tsan: remove real func check from interceptors

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 26 23:47:32 PDT 2021


Author: Dmitry Vyukov
Date: 2021-10-27T08:47:27+02:00
New Revision: c80604f7a30a5eee5421a4d9786ef135b03c25a8

URL: https://github.com/llvm/llvm-project/commit/c80604f7a30a5eee5421a4d9786ef135b03c25a8
DIFF: https://github.com/llvm/llvm-project/commit/c80604f7a30a5eee5421a4d9786ef135b03c25a8.diff

LOG: tsan: remove real func check from interceptors

If the real function is not intercepted,
we are going to crash one way or another.
The question is just in the failure mode:
error message vs NULL deref. But the message
costs us a check in every interceptor and
they are not observed to be failing in real life
for a long time, also other sanitizers don't
have this check as well (also crash on
NULL deref if that happens).
Remove the check from non-debug mode.

Reviewed By: melver

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

Added: 
    

Modified: 
    compiler-rt/lib/tsan/rtl/tsan_interceptors.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors.h b/compiler-rt/lib/tsan/rtl/tsan_interceptors.h
index 89b2f990d036f..a7728549c9990 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_interceptors.h
+++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors.h
@@ -47,10 +47,7 @@ inline bool in_symbolizer() {
 
 #define SCOPED_TSAN_INTERCEPTOR(func, ...)                                \
   SCOPED_INTERCEPTOR_RAW(func, __VA_ARGS__);                              \
-  if (REAL(func) == 0) {                                                  \
-    Report("FATAL: ThreadSanitizer: failed to intercept %s\n", #func);    \
-    Die();                                                                \
-  }                                                                       \
+  DCHECK(REAL(func));                                                     \
   if (!thr->is_inited || thr->ignore_interceptors || thr->in_ignored_lib) \
     return REAL(func)(__VA_ARGS__);
 


        


More information about the llvm-commits mailing list