[PATCH] tsan: ignore interceptors coming from specified libraries

Kostya Serebryany kcc at google.com
Wed Oct 2 07:37:07 PDT 2013


  did a quick scan, more tomorrow


================
Comment at: sanitizer_common/sanitizer_libignore.h:27
@@ +26,3 @@
+
+class ALIGNED(64) LibIgnore {
+ public:
----------------
Will this work on Windows? (Check with Timur)

================
Comment at: sanitizer_common/sanitizer_libignore.h:29
@@ +28,3 @@
+ public:
+  LibIgnore(LinkerInitialized);
+
----------------
If this is linker-initialized, the empty body should be here. No?

================
Comment at: sanitizer_common/sanitizer_libignore.cc:21
@@ +20,3 @@
+  CHECK_EQ(count_, 0);
+  const InternalMmapVector<Suppression> *list = supp.GetSuppressions();
+  for (uptr i = 0; i < list->size(); i++) {
----------------
I'd prefer to have size() and get(i) methods in supp instead of giving away the guts.

================
Comment at: tsan/rtl/tsan_interceptors.cc:130
@@ -128,13 +129,3 @@
 
-// Used to ignore interceptors coming directly from libjvm.so.
-atomic_uintptr_t libjvm_begin;
-atomic_uintptr_t libjvm_end;
-
-static bool libjvm_check(uptr pc) {
-  uptr begin = atomic_load(&libjvm_begin, memory_order_relaxed);
-  if (begin != 0 && pc >= begin) {
-    uptr end = atomic_load(&libjvm_end, memory_order_relaxed);
-    if (end != 0 && pc < end)
-      return true;
-  }
-  return false;
+static uptr libignore_placeholder[sizeof(LibIgnore) / sizeof(uptr) + 1];
+static LibIgnore *libignore() {
----------------
Alexey Samsonov wrote:
> * do you need to use ALIGNED(64) here?
> * why not static char [sizeof(LibIgnore)]?
shouldn't this be aligned(64)? 

================
Comment at: tsan/rtl/tsan_rtl.cc:216
@@ -215,2 +215,3 @@
   InitializeSuppressions();
 #ifndef TSAN_GO
+  InitializeLibIgnore();
----------------
Two #ifndef TSAN_GO in a row? 

Also, can we start using   if (!TSAN_GO) instead ?


http://llvm-reviews.chandlerc.com/D1808



More information about the llvm-commits mailing list