[PATCH] [ASan] Add process basename to log name and error message to simplify analysis of sanitized systems logs.

Kostya Serebryany kcc at google.com
Mon Mar 2 19:01:58 PST 2015


REPOSITORY
  rL LLVM

================
Comment at: lib/asan/asan_rtl.cc:311
@@ -310,2 +310,3 @@
   if (LIKELY(asan_inited)) return;
+
   SanitizerToolName = "AddressSanitizer";
----------------
empty line? 

================
Comment at: lib/asan/asan_rtl.cc:314
@@ +313,3 @@
+
+  CacheBinaryName();
+
----------------
do you really need to call this twice? 

================
Comment at: lib/sanitizer_common/sanitizer_common.cc:357
@@ +356,3 @@
+void CacheBinaryName() {
+  BlockingMutexLock l(&binary_name_cache_lock);
+  if (!binary_name_cache_initialized) {
----------------
So why do you still need the Mutex if you are calling this only once at init time? 
Just add an asssertion that you've never initialized this before. 
Then you also don't need binary_name_cache_initialized, you can use binary_name_cache_str[0], 
which in turn could be function-scope because no one else needs it. 


================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:647
@@ -646,7 +646,3 @@
   void PrepareForSandboxing() override {
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
-    BlockingMutexLock l(&mu_);
-    // Cache /proc/self/exe on Linux.
     CacheBinaryName();
   }
----------------
So, do we still need this here? 

================
Comment at: test/asan/TestCases/verbose-log-path_test.cc:9
@@ +8,3 @@
+// FIXME: only FreeBSD and Linux have verbose log paths now.
+// XFAIL: win32
+// XFAIL: android
----------------
maybe just put it inside test/asan/TestCases/Linux? 

================
Comment at: test/asan/TestCases/verbose-log-path_test.cc:16
@@ +15,3 @@
+int main(int argc, char **argv) {
+  if (argc > 2) return 0;
+  char *x = (char*)malloc(10);
----------------
this test could be smaller, e.g. 
int glob[10];
int main(int argc, char **argv) {
  return glob[argc * 10]; 
}

http://reviews.llvm.org/D7333

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list