[LLVMdev] Symbolized ASan output on Android

Kostya Serebryany kcc at google.com
Thu Oct 31 14:49:35 PDT 2013


On Thu, Oct 31, 2013 at 2:38 PM, Greg Fitzgerald <garious at gmail.com> wrote:

> Thanks for letting me know that this is in the works.  This is
> something that would make running ASan (and all other sanitizers I
> assume) quite a bit more appealing on Android.


Not just for Android.
But beware that the symbolization is a heavy thing -- it requires more RAM
and more CPU -- so some our users
have to disable it and symbolize output offline to save resources.
(We still want to have in-process symbolizer upstreamed very much)


>  If there's anything I
> can do to help, please let me know.  If you'd like to discuss in
> person, I'll be at the Developers' Meeting next week.
>

Good! See you there.

--kcc

>
> -Greg
>
>
> On Thu, Oct 31, 2013 at 1:58 PM, Alexey Samsonov <samsonov at google.com>
> wrote:
> >
> > On Wed, Oct 30, 2013 at 2:08 PM, Greg Fitzgerald <garious at gmail.com>
> wrote:
> >>
> >> If running ASan on the host architecture, we can symbolize output with:
> >>
> >>     export LLVM_SYMBOLIZER_PATH=`which llvm-symbolizer`
> >>     ./myInstrumentedProgram
> >>
> >> but on Android symbolizing is more complex.  The bash script below is
> >> a "hello world" for symbolizing ASan output on Android.  Is there a
> >> simpler way to do this?
> >>
> >>     # Execute the test and save its output
> >>      adb push myInstrumentedProgram /data/data/
> >>      adb shell "LD_PRELOAD=/data/data/libclang_rt.asan-arm-android.so
> >> /data/data/myInstrumentedProgram" | tee out/err.txt
> >>
> >>      # Pull runtime dependencies so we can demangle the output
> >>      adb pull /system/lib/libc.so out/
> >>      adb pull /data/data/libclang_rt.asan-arm-android.so out/
> >>
> >>     # Fix-up the output and demangle
> >>     sed 's/\/data\/data/out/g' out/err.txt | \
> >>     sed 's/\/system\/lib/out/g' | \
> >>     $LLVM_DIR/utils/sanitizers/asan_symbolize.py --demangle
> >>
> >> Is it possible to embed llvm-symbolizer into the ASan runtime?
> >
> >
> > We have a working solution for using in-process symbolization in
> sanitizer
> > tools
> > (for Linux/x86_64), but it's somewhat complicated and is not yet
> upstreamed.
> > Once it's in the trunk, it should be possible to port it to Android as
> well.
> > Can't give you a very promising estimate, though :(
> >
> >>
> >>
> >> Thanks,
> >> Greg
> >> _______________________________________________
> >> LLVM Developers mailing list
> >> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> >
> >
> >
> >
> > --
> > Alexey Samsonov, MSK
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131031/eb8b8265/attachment.html>


More information about the llvm-dev mailing list