[PATCH] tsan: ignore interceptors coming from specified libraries

Alexey Samsonov samsonov at google.com
Thu Oct 3 01:13:06 PDT 2013



================
Comment at: tsan/lit_tests/ignore_lib1.cc:30
@@ +29,3 @@
+
+#include <pthread.h>
+#include <string.h>
----------------
Wait, is this copied from ingore_lib0.cc? I think it's better to put this source under lit_tests/Helpers directory - see the way it's done in ASan.

================
Comment at: sanitizer_common/sanitizer_libignore.cc:38
@@ +37,3 @@
+  MemoryMappingLayout proc_maps(/*cache_enabled*/false);
+  InternalMmapVector<char> fn(4096);
+  fn.push_back(0);
----------------
Why not InternalScopedBuffer?

================
Comment at: sanitizer_common/sanitizer_libignore.cc:44
@@ +43,3 @@
+    uptr b, e, off, prot;
+    while (proc_maps.Next(&b, &e, &off, &fn[0], fn.capacity(), &prot)) {
+      if ((prot & MemoryMappingLayout::kProtectionExecute) != 0
----------------
I think that if you change the order of loops (scan ProcSelfMaps and match its contents against all libs), you can make the code more testable 

================
Comment at: sanitizer_common/sanitizer_libignore.cc:48
@@ +47,3 @@
+        if (loaded[i]) {
+          Printf("%s: called_from_lib suppression '%s' is matched against"
+              " 2 libraries: '%s' and '%s'\n",
----------------
s/Printf/Report

================
Comment at: sanitizer_common/sanitizer_libignore.cc:65
@@ +64,3 @@
+    if (lib->loaded && !loaded[i]) {
+      Printf("%s: library '%s' that was matched against called_from_lib"
+          " suppression '%s' is unloaded\n",
----------------
Are you sure we want to report it?


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



More information about the llvm-commits mailing list