[PATCH] [asan] Implement delayed activation of AddressSanitizer

Evgeniy Stepanov eugenis at google.com
Wed Jan 15 04:58:39 PST 2014


Hi kcc,

This feature is primarily meant for Android. It makes ASan both easier to use and much faster:
- No need to do setprop for each started application. Instead, a one-time, device-wide setup step is required.
- Works with -userdebug builds of Android, not just -eng builds.
- VM is not reloaded from scratch for each ASan process. Instead, zygote is run with ASan runtime (but no instrumented code) in "deactivated" mode, and the first loaded instrumented library "activates" it.

This change adds ASAN_OPTIONS=start_deactivated=1 flag. When present, ASan will start in "deactivated" mode, with no heap poisoning, no quarantine, no stack trace gathering, and minimal redzones. All this features come back when __asan_init is called for the constructor of an instrumented library.

The feature itself is not Android-specific, and this patch includes a Linux test for it.

It is not compatible with flexible shadow mapping.


http://llvm-reviews.chandlerc.com/D2553

Files:
  lib/asan/asan_interceptors.cc
  lib/asan/asan_flags.h
  lib/asan/asan_activation.cc
  lib/asan/asan_activation.h
  lib/asan/lit_tests/TestCases/SharedLibs/start-deactivated-so.cc
  lib/asan/lit_tests/TestCases/start-deactivated.cc
  lib/asan/asan_malloc_mac.cc
  lib/asan/asan_rtl.cc
  lib/asan/asan_allocator2.cc
  lib/asan/asan_internal.h
  lib/asan/CMakeLists.txt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2553.1.patch
Type: text/x-patch
Size: 16796 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140115/cdc2ca36/attachment.bin>


More information about the llvm-commits mailing list