summaryrefslogtreecommitdiff
path: root/lib/asan/scripts
AgeCommit message (Collapse)Author
2015-12-29For the asan_symbolize.py script, use addr2line as the default systemDimitry Andric
symbolizer on FreeBSD too. This allows the asan-symbolize-bad-path.cc test to succeed. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256578 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04Check multilib dir for asan_device_setup.Dan Albert
Reviewers: eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15247 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254789 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-28[asan] Fix asan_device_setup script on KitKat.Evgeniy Stepanov
app_process32, when started via a shell script wrapper, needs a different security context to satisty SELinux. Patch by Abhishek Arya. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251572 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26asan_symbolize.py: Call llvm-symbolizer with --functions=linkage instead of ↵Alexey Samsonov
--functions=short. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251356 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-30[asan] Fix asan_symbolize.py handling of non-existing pathsEvgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@248962 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-14Support inline functions symbolization in Addr2Line symbolizer.Alexey Samsonov
Patch by Maxim Ostapenko! Summary: Right now, Addr2Line symbolizer in asan_symbolize.py doesn't support inline functions symbolization. This might be a useful feature for using ASan on embedded systems. Test results: $ cat test.c static inline void FooBarBaz() { __sanitizer_print_stack_trace(); } int main() { FooBarBaz(); return 0; } $ clang test.c -fsanitize=address -g -O2 -o test.x && ./test.x &> /tmp/test.log $ ./projects/compiler-rt/lib/asan/scripts/asan_symbolize.py -l /tmp/test.log #0 0x42095e in __sanitizer_print_stack_trace _asan_rtl_ #1 0x4cec07 in FooBarBaz /home/max/build/llvm/asan/test.c:4 #2 0x4cec07 in main /home/max/build/llvm/asan/test.c:8 #3 0x7f89f0891ec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287 Reviewers: glider, samsonov Subscribers: jevinskie, llvm-commits, ygribov Differential Revision: http://reviews.llvm.org/D12153 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@247642 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-30[asan] Support arm64 devices in asan_device_setup.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@243679 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-28[asan] Support per-application flags in the Android setup script.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@243494 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-06[asan] Allow users of asan_symbolize.py to forbid fallback to atos/addr2line.Sergey Matveev
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@231492 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16[asan] Support 'su' rooted devices in ASan setup script.Evgeniy Stepanov
Android devices may not support 'adb root', but be rooted with 'su' binary. This patch makes it possible to install ASAN to such devices. When --use-su flag is specified, most 'adb ...' commangs are changed to 'adb su -c "..."'. Some other notes: * 'readlink' changed to 'ls -l', since not all devices have readlink in their firmware. * removing ASan library step moved to very end, because 'su' may not run properly without this library until shell will be restarted. Patch by Dmitry <ripp at yandex-team dot ru>. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229368 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29[asan] Add one more wait-for-device in the Android setup script.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@227473 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-28Fix indents on asan_symbolize.py's argument parsing code. No behavior change.Nico Weber
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@227327 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-28Make asan_symbolize.py not crash on Windows.Nico Weber
asan_symbolize.py isn't needed on Windows, but it's nice if asan has a unified UI on all platforms. So rather than have asan_symolize.py die on startup due to it importing modules that don't exist on Windows, let it just echo the input. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@227326 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-16[asan] Change detection of allow_user_segv_handler on Android.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226273 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-22[ASan] Fix the logic that decides whether we need to spawn a new ↵Alexander Potapenko
llvm-symbolizer in asan_symbolize.py git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224710 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21[ASan] Allow the users of SymbolizationLoop to make use of the --dsym_hint ↵Alexander Potapenko
option in llvm-symbolizer Let the users of SymbolizationLoop define a function that produces the list of .dSYM hints (possible path to the .dSYM bundle) for the given binary. Because the hints can't be added to an existing llvm-symbolizer process, we spawn a new symbolizer process ones each time a new hint appears. Those can only appear for binaries that we haven't seen before. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222535 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06[asan] Minor tweak to asan_device_setup.Evgeniy Stepanov
Add another wait-for-device which may fix a flaky setup error. Fix output message. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219117 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-03[asan] Support Android/x86 in asan_device_setup.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218968 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-29[sanitizer] Android build cleanup.Evgeniy Stepanov
* Detect Android toolchain target arch and set correct runtime library name. * Merged a lot of Android and non-Android code paths. * Android is only supported in standalone build of compiler-rt now. * Linking lsan-common in ASan-Android (makes lsan annotations work). * Relying on -fsanitize=address linker flag when building tests (again, unification with non-Android path). * Runtime library moved from lib/asan to lib/linux. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218605 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-29[asan] Fix SELinux setup on Android-K.Evgeniy Stepanov
On pre-L devices SELinux is set up in such a way that zygote wrapper has to be in system_file context, not zygote_exec. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218599 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-19[asan] asan_device_setup improvements.Evgeniy Stepanov
* Allow user SEGV handler if Android-L-like setup is detected. Necessary for correctness. * Change file context labels on the wrapper script to appease SELinux. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218124 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-18[asan] Initialize logfile in asan_symbolize.py to sys.stdin.Sergey Matveev
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218072 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-18[asan] Fix a bug in asan_symbolize.pySergey Matveev
Do not forget to add newlines between multiple symbolized lines corresponding to a single input line (i.e. inlining). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218071 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-11[asan] Preserve existing LD_PRELOAD setting on Android.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217584 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-01[asan] Update asan_device_setup to support Android L Preview.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216884 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-11[ASan] Add new options for asan_symbolize.py script.Alexey Samsonov
The patch adds new features in asan-symbolizer script which are helpful for using ASan on embedded systems: 1) add cross-compile prefix for binutils 2) define path to sysroot with sanitized binaries Features are enabled by command line options. The patch also extends command line interface with help option. Reviewed in http://reviews.llvm.org/D4703. Patch by Maria Guseva! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@215381 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-18Add FreeBSD support to the Asan symbolization scriptViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D4560 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213370 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-16[ASan] Factor out SymbolizationLoop.process_line() function to let PythonAlexander Potapenko
scripts that import asan_symbolize to symbolize their reports line by line. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213136 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-07[asan] Remove runtime assembly helpers.Evgeniy Stepanov
Remove helper functions that were used in assembly instrumentation. Patch by Yuri Gorshenin. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@212456 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05[asan] asan_device_setup: extend search pathEvgeniy Stepanov
In standalone build asan-rt is stored in yet another path. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@210259 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-21[asan] Fix x86 asm instrumentation to preserve flags.Evgeniy Stepanov
This change also enables asm instrumentation in asan tests that was accidentally disabled yearlier, and adds a sanity test for that. Patch by Yuri Gorshenin. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209282 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-19[asan] update asan_symbolize.py to use the new llvm-symbolizer flag syntaxKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209116 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-05asan_symbolize.py: use llvm-symbolizer results even if it returned function ↵Alexey Samsonov
name w/o file/line info git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202983 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-05Improve llvm-symbolizer discovery in asan_symbolize.pyAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202982 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-27[asan] Install asan_device_setup to bin/ when targetting Android.Evgeniy Stepanov
asan_device_setup is a utility that prepares a device to run code built with ASan. Essentially, it installs ASan runtime library into the system. For this reason, it has to be at a predictable relative path from the runtime library itself. We also plan to distribute this utility, packaged with runtime library and maybe llvm-symbolizer, to the users. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202362 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-26[asan] asan_device_setup: fix a typo in usage textEvgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202246 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-26[asan] Remove .sh extension from asan_device_setup.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202245 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-20[asan] Changes to asm instrumentation must be done through the generator script.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201766 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19[asan] Disable asm instrumentation and tests on Mac.Evgeniy Stepanov
Move asm tests to their own file. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201653 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19[asan] Added assembly functions for x86/amd64 asan.Evgeniy Stepanov
These are runtime support functions for inline assembly instrumentation. This is a re-submit of r201402. Patch by Yuri Gorshenin. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201650 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14[asan] Revert r201402, r201404.Evgeniy Stepanov
Test fails in bootstrap build. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201411 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14[asan] Added assembly functions for x86/amd64 asan.Evgeniy Stepanov
These are runtime support functions for inline assembly instrumentation. Patch by Yuri Gorshenin. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201402 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-03[asan] asan_device_setup.sh: allow overriding adb path.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200698 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-29[asan] Fix asan_device_setup.sh failure on userdebug Android.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200382 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-27[asan] Android setup: do "adb root" before "adb remount".Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200199 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-24[asan] Add an ASan-on-Android installation script.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200009 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-31[ASan] Make asan_symbolize.py fall back to ASAN_SYMBOLIZER_PATH (which is ↵Alexander Potapenko
used when ASAN_OPTIONS=symbolize=1) if LLVM_SYMBOLIZER_PATH is empty. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193758 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-04[ASan] Close stderr before launching atos in asan_symbolize.pyAlexander Potapenko
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@185631 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-01[ASan] Cache atos processes to make Darwin symbolication faster.Alexander Potapenko
Patch by Jesse Ruderman<jruderman@gmail.com> git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@185325 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-31[ASan] Do not buffer stdin in asan_symbolize.pyAlexander Potapenko
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@183006 91177308-0d34-0410-b5e6-96231b3b80d8