<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Wed, Oct 30, 2013 at 2:08 PM, Greg Fitzgerald <span dir="ltr"><<a href="mailto:garious@gmail.com" target="_blank">garious@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If running ASan on the host architecture, we can symbolize output with:<br>
<br>
export LLVM_SYMBOLIZER_PATH=`which llvm-symbolizer`<br>
./myInstrumentedProgram<br>
<br>
but on Android symbolizing is more complex. The bash script below is<br>
a "hello world" for symbolizing ASan output on Android. Is there a<br>
simpler way to do this?<br>
<br>
# Execute the test and save its output<br>
adb push myInstrumentedProgram /data/data/<br>
adb shell "LD_PRELOAD=/data/data/<a href="http://libclang_rt.asan-arm-android.so" target="_blank">libclang_rt.asan-arm-android.so</a><br>
/data/data/myInstrumentedProgram" | tee out/err.txt<br>
<br>
# Pull runtime dependencies so we can demangle the output<br>
adb pull /system/lib/libc.so out/<br>
adb pull /data/data/<a href="http://libclang_rt.asan-arm-android.so" target="_blank">libclang_rt.asan-arm-android.so</a> out/<br>
<br>
# Fix-up the output and demangle<br>
sed 's/\/data\/data/out/g' out/err.txt | \<br>
sed 's/\/system\/lib/out/g' | \<br>
$LLVM_DIR/utils/sanitizers/asan_symbolize.py --demangle<br>
<br>
Is it possible to embed llvm-symbolizer into the ASan runtime?<br></blockquote><div><br></div><div>We have a working solution for using in-process symbolization in sanitizer tools</div><div>(for Linux/x86_64), but it's somewhat complicated and is not yet upstreamed.</div>
<div>Once it's in the trunk, it should be possible to port it to Android as well.</div><div>Can't give you a very promising estimate, though :(<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks,<br>
Greg<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</div></div>