Comment #8 on issue 264 by [email protected]: Symbolization of globals is broken on Android
http://code.google.com/p/address-sanitizer/issues/detail?id=264

Yes, I think collecting the unmangled names in the frontend would work. Currently ASan creates a string literal with global name during the instrumentation. Instead, we may create this literal in the frontend and pass it to instrumentation pass in llvm.asan.globals metadata.

I have a small patch for this, and it works fine except for the one minor case: it's tempting to calculate the unmangled global name in the frontend by simply calling "NamedDecl::printQualifiedName", the same method which is used in Clang diagnostics. However, it adds qualifiers only for namespaces and classes, i.e. global
  namespace N { int x; }
will have qualified name "N::x", while global
  void foo() { static int x; }
will have qualified name "x". I asked around and it seems to be a conscious decision - diagnostics should only print valid C++ names, and one can't write "foo::x" to refer to function static variable.

I suggest to live with it and just print "global variable 'x'" in ASan error reports in the latter case. We would also print the exact source location (file/line/column) of global declaration, so users won't get confused. If you're OK with it, I will proceed with the change.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"address-sanitizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to