gopalshankar / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
0 stars 0 forks source link

Bad choice of aliased symbol name in symbolizer #249

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
We symbolize "textdomain" from libc as "__textdomain", and strdup as 
"__GI___strdup".

For textdomain, we need to pick global symbol ahead of a local one, if they 
point to the same address.

For strdup, __GI___strdup is local, so the above would take care of it. But 
there is also 
 global "__strdup"
 global weak "strdup"

Not sure what to do. We could prioritize symbols that don't start with 
underscore. Would it make sense to prioritize weak symbols? What do other 
symbolizer libraries do in this case?

Original issue reported on code.google.com by euge...@google.com on 29 Nov 2013 at 11:49

GoogleCodeExporter commented 9 years ago
FTR, addr2line has the same problems:
$ addr2line -f -e /lib/x86_64-linux-gnu/libc-2.15.so
0x334f0
__textdomain
/build/buildd/eglibc-2.15/intl/textdomain.c:83
0x88d60
__GI___strdup
/build/buildd/eglibc-2.15/string/strdup.c:41

I think we can patch llvm-symbolizer to prioritize global symbols to locals, 
and weak symbols to non-weak. Do we still need this?

Original comment by samso...@google.com on 10 Feb 2014 at 1:52