[Bug sanitizer/56393] SIGSEGV when -fsanitize=address and dynamic lib with global objects

kcc at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Apr 8 06:32:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56393

--- Comment #23 from Kostya Serebryany <kcc at gcc dot gnu.org> 2013-04-08 06:32:45 UTC ---
(In reply to comment #22)
> Has this been resolved in the final 4.8.0 (r196952)? I checked some changes and
> they seems to be in.
> 
> I have a number (<100) C++/C packages (incl. boost 1.51.00) compiled w/o
> address sanitizer and I am only enabling it for the main software using all
> these packages.  Yet compilation fails of the main software segflaut from

David, please provide more info on the segfault. 
E.g. run with env. var. ASAN_OPTIONS=verbosity=1 and also 
disassemble the failing instruction in gdb. 
I suspect that the non-instrumented code runs before __asan_init_v1 and then
calls instrumented code. This will never work. 

You need to make sure that __asan_init_v1 is called before any instrumented
code.
One way: put this function into the preinint array; this is automatically done
if you use -static-libasan; you can do it manually in your main module. 
Another way: instrument everything.



More information about the Gcc-bugs mailing list