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



Evgeniy Stepanov <eugeni.stepanov at gmail dot com> changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

                 CC|                            |eugeni.stepanov at gmail

                   |                            |dot com



--- Comment #7 from Evgeniy Stepanov <eugeni.stepanov at gmail dot com> 
2013-02-19 20:35:12 UTC ---

You've got a constructor of an uninstrumented shared library calling back into

the application code. Of course, it happens before constructors of the main

executable run. This breaks ASan initialization order.



boost::get_static_exception_object<boost::bad_alloc_> is compiled in both

hoge1.o and hoge2.o, both as weak symbols, one of them is ASan-instrumented.

The call from a shared library constructor is resolved to the instrumented

version from the main executable.



This shows that bad things can happen implicitly, in very harmlessly looking

code. We probably should not rely on normal constructors and switch

.preinit_array. The only thing that is stronger than .preinit_array is

DF_1_INITFIRST, we can't use it with static libasan, unfortunately.

Reply via email to