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

Yury Gribov tetra2005 at gmail.com
Thu Mar 12 13:33:10 PDT 2015


REPOSITORY
  rL LLVM

================
Comment at: lib/sanitizer_common/sanitizer_common.cc:347
@@ +346,3 @@
+static char binary_name_cache_str[kMaxPathLength];
+static const char *binary_basename_cache_str = binary_name_cache_str;
+
----------------
kcc wrote:
> ygribov wrote:
> > kcc wrote:
> > > initialize to nullptr, so that if we forget to call CacheBinaryName we instantly crash 
> > Yeah, I thought about this. But note that even though we call CacheBinaryName very early, some code has to execute before it. And I'd prefer this code to print something at least to stderr instead of crashing.
> Sure, use CHECK_NE(foo, nullptr)
Sorry, I still don't understand - how do you propose to handle failing CHECKs in e.g. InitializeFlags (which is called before CacheBinaryName has a chance to set binary_basename_cache_str)? If we CHECK_NE(binary_basename_cache_str, nullptr) we'll abort without reporting the real error.

http://reviews.llvm.org/D7333

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






More information about the llvm-commits mailing list