[PATCH] Optional support for dynamic Asan runtime

Yury Gribov tetra2005 at gmail.com
Thu Mar 13 09:35:28 PDT 2014


  Added support for
  * detection of static/dynamic rt conflicts
  * detection of dlopen
  * make sure that libasan is preloaded
  (all features have unit tests).

  One huge problem is that currently Asan always starts in active mode because dlsym's in AsanCheckIncompatibleRT call dlerror, this calls malloc and malloc activates Asan. I'm not sure how to address the issue (I tried the calloc-style hack but this would cause errors when dlerror-allocated regions are freed).

  As before, I haven't really checked anything besides Linux x64.

  I decided to leave dynamic runtimes for UBSan, etc. for future. IMHO this would be a trivial piece of work anyway.

Hi kcc, eugenis, samsonov,

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

CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D3042?vs=7743&id=7804#toc

Files:
  lib/sanitizer_common/sanitizer_internal_defs.h
  lib/asan/asan_internal.h
  lib/asan/asan_win.cc
  lib/asan/asan_linux.cc
  lib/asan/asan_mac.cc
  lib/asan/CMakeLists.txt
  lib/asan/asan_interface_internal.h
  lib/asan/asan_rtl.cc
  CMakeLists.txt
  test/lit.common.configured.in
  test/asan/CMakeLists.txt
  test/asan/TestCases/sanity_check_pure_c.c
  test/asan/TestCases/start-deactivated.cc
  test/asan/TestCases/Linux/interception_malloc_test.cc
  test/asan/TestCases/Linux/DynamicRT/asan_preload_test-1.cc
  test/asan/TestCases/Linux/DynamicRT/asan_preload_test-2.cc
  test/asan/TestCases/Linux/DynamicRT/asan_rt_confict_test-1.cc
  test/asan/TestCases/Linux/DynamicRT/lit.local.cfg
  test/asan/TestCases/Linux/DynamicRT/asan_dlopen_test.cc
  test/asan/lit.site.cfg.in
  test/asan/Unit/lit.site.cfg.in
  test/asan/lit.cfg
  cmake/Modules/AddCompilerRT.cmake
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3042.3.patch
Type: text/x-patch
Size: 23464 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140313/2fb2feb5/attachment.bin>


More information about the llvm-commits mailing list