Default asan options do not affect Android.
Categories
(Core :: mozglue, defect, P3)
Tracking
()
People
(Reporter: truber, Unassigned)
References
Details
We set a number of default options for Asan in mozglue/build/AsanOptions.cpp
. These don't have any effect on Android.
In bug 1482167 I have added fast_unwind_on_check=1:fast_unwind_on_fatal=1
, which are necessary to get a full backtrace on Android, but unless they are also added to ASAN_OPTIONS
in the environment, the backtrace is truncated (meaning __asan_default_options()
has no effect).
Comment 1•5 years ago
|
||
NI to froydnj since he probably has some context here. It looks like __asan_default_options
is "magic" in the sense that it's a special symbol that the ASAN libraries know about, and that suggests that something is wrong with the build itself or the library interpolation. Nathan, any thoughts?
Comment 2•5 years ago
|
||
I'm not entirely sure how __asan_default_options
gets interposed, though looking through compiler-rt source code, it seems like the magic should Just Work, as __asan_default_options
is a weak function.
So, to verify:
- mozglue/build/AsanOptions.o (or whatever unified file it is contained in) contains the
__asan_default_options
symbol. - Whatever mozglue gets linked into has the
__asan_default_options
symbol.
If those turn out OK, my only thought is that at the point asan initializes, we don't have the necessary bits loaded to ensure that asan sees the __asan_default_options
symbol. I don't know when asan initializes on Android, but probably before we even have libxul or mozglue loaded? I'd try to do some debugging as to when asan gets turned on, and that would tell us approximately where we need to ensure that __asan_default_options
is seen. Poke at what chromium does if debugging doesn't look palatable?
Reporter | ||
Comment 3•5 years ago
|
||
Yes, the mozglue contains a global __asan_default_options
and libclang_rt.asan-x86_64-android.so contains a weak __asan_default_options
. Asan is probably loaded with LD_PRELOAD when ART is launched, so I think you're right.
Updated•4 years ago
|
Updated•2 years ago
|
Description
•