[PATCH] [compiler-rt] Demangling for DlAddrSymbolizer

Kuba Brecka kuba.brecka at gmail.com
Thu Mar 12 10:21:12 PDT 2015


================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:42
@@ -42,2 +41,3 @@
+const char *DemangleCXXABI(const char *name) {
   // FIXME: __cxa_demangle aggressively insists on allocating memory.
   // There's not much we can do about that, short of providing our
----------------
zaks.anna wrote:
> Maybe we should provide an option that allows us to turn off demangling? It would make it easier to isolate cases where we get a second failure while reporting. Clients who don't need this (ex: running under the debugger) could turn this off.
> 
> What do you think?
Can demangling really cause such a bad failure? I was under the impression that either `__cxa_demangle` could be missing (because we're not linked against libcxx) or it could return `NULL`, and we handle both these cases here. (Which reminds me that the extra check for NULL-ness above in `sanitizer_symbolizer_mac.cc` is not necessary, because `DemangleCXXABI` can never return NULL).

However, if you suspect that it could actually cause a crash, having an option to turn it on/off sounds like a good idea.

FYI, if you use `ASAN_OPTIONS=symbolize=0`, stack traces will not be symbolicated at all, and no demangling will occur either.

http://reviews.llvm.org/D8291

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






More information about the llvm-commits mailing list