[LLVMdev] Symbolized ASan output on Android

Alexey Samsonov samsonov at google.com
Thu Oct 31 13:58:23 PDT 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131031/2060f0bb/attachment.html>


More information about the llvm-dev mailing list