[PATCH] [ASan] Add process basename to log name and error message to simplify analysis of sanitized systems logs.
Yury Gribov
tetra2005 at gmail.com
Wed Apr 29 23:42:34 PDT 2015
> Once again, sorry for delay :-/
Np, this isn't the most interesting change for sure.
REPOSITORY
rL LLVM
================
Comment at: lib/asan/asan_rtl.cc:372
@@ +371,3 @@
+
+ AsanCheckIncompatibleRT();
+ AsanCheckDynamicRTPrereqs();
----------------
samsonov wrote:
> I think that moving these functions to the AsanInitInternal is a positive change, do you think you can land it independently (as a refactoring), before submitting the rest of this patch?
Sure.
================
Comment at: lib/sanitizer_common/sanitizer_common.cc:237
@@ -229,2 +236,3 @@
return slash_pos + 1;
- }
+ else if (const char *backslash_pos = internal_strrchr(module, '\\'))
+ return backslash_pos + 1;
----------------
samsonov wrote:
> That's weird, don't we handle backslash on Windows above?
True.
================
Comment at: lib/sanitizer_common/sanitizer_printf.cc:261
@@ +260,3 @@
+ }
+ needed_length += internal_snprintf(buffer + needed_length,
+ buffer_size - needed_length,
----------------
samsonov wrote:
> You should probably check that needed_length is not greater than buffer_size here as well.
Good catch, otherwise there may be an overflow.
================
Comment at: lib/tsan/rtl/tsan_rtl.cc:309
@@ -308,2 +308,3 @@
is_initialized = true;
+ CacheBinaryName();
// We are not ready to handle interceptors yet.
----------------
samsonov wrote:
> I'd rather do this after setting SanitizerToolName and parsing the flags, as you do in different sanitizers.
> Also, what about MSan?
Will do.
================
Comment at: test/asan/TestCases/verbose-log-path_test.cc:6
@@ +5,3 @@
+// RUN: env ASAN_OPTIONS=log_path=%t.log:log_exe_name=1 not %run %t 2> %t.out
+// RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t.log.verbose-log-path_test.cc*
+
----------------
samsonov wrote:
> ... and matching against this executable name here.
Sorry, not quite clear. What would be the benefit of this?
http://reviews.llvm.org/D7333
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list