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

Alexey Samsonov vonosmas at gmail.com
Wed Jan 28 15:19:25 PST 2015


REPOSITORY
  rL LLVM

================
Comment at: lib/asan/asan_report.cc:56
@@ -55,3 +55,3 @@
     // FIXME: reallocate the buffer instead of truncating the message.
-    error_message_buffer_pos += remaining > length ? length : remaining;
+    error_message_buffer_pos += Min(remaining, length);
   }
----------------
Feel free to commit this part separately in a cleanup CL.

================
Comment at: lib/sanitizer_common/sanitizer_common.cc:224
@@ -221,1 +223,3 @@
     return slash_pos + 1;
+  else if (const char *backslash_pos = internal_strrchr(module, '\\'))
+    return backslash_pos + 1;
----------------
I forgot, why do you need this?

================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:754
@@ -761,3 +753,3 @@
   uptr module_name_len = internal_readlink(
       "/proc/self/exe", buf, buf_len);
   int readlink_error;
----------------
Use default_module_name here.

================
Comment at: lib/sanitizer_common/sanitizer_printf.cc:258
@@ -257,1 +257,3 @@
+      needed_length += internal_snprintf(buffer, buffer_size,
+                                         "==%s %d==", pname, pid);
       if (needed_length >= buffer_size) {
----------------
Hm, do we really want this? I believe some users may scrape logs by searching for ==%d== prefix.

================
Comment at: test/asan/TestCases/verbose-log-path_test.cc:1
@@ +1,2 @@
+// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316
+// XFAIL: android
----------------
Why do you need this?

================
Comment at: test/asan/TestCases/verbose-log-path_test.cc:12
@@ +11,3 @@
+// FIXME: log_path is not supported on Windows yet.
+// XFAIL: win32
+//
----------------
This test will not be run on Windows anyway - verbose-log-path is not set there.

http://reviews.llvm.org/D7172

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






More information about the llvm-commits mailing list