llvm-project/compiler-rt/lib/asan
Kostya Serebryany 8b981c2564 The code instrumented with ASan may have its own instance of the
mach_override library.
In this case chances are that functions from it will be called from
mach_override_ptr() during ASan initialization.
This may lead to crashes (if those functions are instrumented) or
incorrect behavior (if the implementations differ).

The attached patch renames mach_override_ptr() into
__asan_mach_override_ptr() and makes the rest of the mach_override
internals hidden.
The corresponding AddressSanitizer bug is
http://code.google.com/p/address-sanitizer/issues/detail?id=22

Patch by glider@google.com

llvm-svn: 147303
2011-12-28 01:08:14 +00:00
..
mach_override The code instrumented with ASan may have its own instance of the 2011-12-28 01:08:14 +00:00
scripts AddressSanitizer run-time library. Not yet integrated with the compiler-rt build system, but can be built using the old makefile. See details in README.txt 2011-11-30 01:07:02 +00:00
sysinfo [asan] fix some more format warnings in sysinfo/sysinfo.cc 2011-12-13 23:34:59 +00:00
tests [asan] remove the test for cfree. 'man cfree' says: 'This function should never be used.' and this function is not found on many OSes we support. 2011-12-27 23:42:55 +00:00
Makefile.mk build: Add ModuleName per-subdir variable as a way to organize the different 2011-12-02 02:42:07 +00:00
Makefile.old [asan] rely on __has_feature(address_sanitizer) instead of the ADDRESS_SANITIZER macro 2011-12-27 21:57:12 +00:00
README.txt AddressSanitizer run-time library. Not yet integrated with the compiler-rt build system, but can be built using the old makefile. See details in README.txt 2011-11-30 01:07:02 +00:00
asan_allocator.cc [asan] canonicalise the output for double-free and wrong-free. fixes asan issue 18 2011-12-13 19:16:36 +00:00
asan_allocator.h [asan] make use-after-return mode more robust: allow to call instrumented functions while reporting an error 2011-12-09 01:49:31 +00:00
asan_globals.cc [asan] fix a bug (issue 19) where dlclose and the following mmap caused a false positive. run-time part. 2011-12-15 21:55:34 +00:00
asan_interceptors.cc [asan] canonicalise the output for double-free and wrong-free. fixes asan issue 18 2011-12-13 19:16:36 +00:00
asan_interceptors.h The code instrumented with ASan may have its own instance of the 2011-12-28 01:08:14 +00:00
asan_interface.h [asan] rely on __has_feature(address_sanitizer) instead of the ADDRESS_SANITIZER macro 2011-12-27 21:57:12 +00:00
asan_internal.h [asan] rely on __has_feature(address_sanitizer) instead of the ADDRESS_SANITIZER macro 2011-12-27 21:57:12 +00:00
asan_linux.cc [asan] flatten the asan-rt build slightly 2011-12-01 21:40:52 +00:00
asan_lock.h AddressSanitizer run-time library. Not yet integrated with the compiler-rt build system, but can be built using the old makefile. See details in README.txt 2011-11-30 01:07:02 +00:00
asan_mac.cc Recently the GCD tests started failing because of the invalid size of 2011-12-16 19:13:35 +00:00
asan_mac.h [asan] flatten the asan-rt build slightly 2011-12-01 21:40:52 +00:00
asan_malloc_linux.cc [asan] flatten the asan-rt build slightly 2011-12-01 21:40:52 +00:00
asan_malloc_mac.cc asan: #if 0 out some unused functions (we build with -Werror). 2011-12-01 23:35:47 +00:00
asan_mapping.h Refactor shadow poisoning done by asan-rt, no funtionality changes; patch by samsonov@google.com 2011-11-30 18:50:23 +00:00
asan_poisoning.cc [asan] minimize the use of STL. One bit is still left. 2011-12-02 18:42:04 +00:00
asan_printf.cc AddressSanitizer run-time library. Not yet integrated with the compiler-rt build system, but can be built using the old makefile. See details in README.txt 2011-11-30 01:07:02 +00:00
asan_rtl.cc [asan] make sure __asan_report_* functions are not inlined (so that they are not optimized away and are kept in the resulting library). Patch by glider@google.com 2011-12-28 00:59:39 +00:00
asan_stack.cc [asan] move build-time config options from makefile to source (otherwise we need config options in all makefiles) 2011-12-08 18:30:42 +00:00
asan_stack.h AddressSanitizer run-time library. Not yet integrated with the compiler-rt build system, but can be built using the old makefile. See details in README.txt 2011-11-30 01:07:02 +00:00
asan_stats.cc [asan] always collect malloc statstics (removed FLAG_stats) 2011-12-05 19:17:53 +00:00
asan_stats.h AddressSanitizer run-time library. Not yet integrated with the compiler-rt build system, but can be built using the old makefile. See details in README.txt 2011-11-30 01:07:02 +00:00
asan_thread.cc Recently the GCD tests started failing because of the invalid size of 2011-12-16 19:13:35 +00:00
asan_thread.h Recently the GCD tests started failing because of the invalid size of 2011-12-16 19:13:35 +00:00
asan_thread_registry.cc AddressSanitizer run-time library. Not yet integrated with the compiler-rt build system, but can be built using the old makefile. See details in README.txt 2011-11-30 01:07:02 +00:00
asan_thread_registry.h AddressSanitizer run-time library. Not yet integrated with the compiler-rt build system, but can be built using the old makefile. See details in README.txt 2011-11-30 01:07:02 +00:00

README.txt

AddressSanitizer RT
================================
This directory contains sources of the AddressSanitizer (asan) run-time library.
We are in the process of integrating AddressSanitizer with LLVM, stay tuned.

Directory structre:

README.txt       : This file.
Makefile.mk      : Currently a stub for a proper makefile. not usable.
Makefile.old     : Old out-of-tree makefile, the only usable one so far.
asan_*.{cc,h}    : Sources of the asan run-time lirbary.
mach_override/*  : Utility to override functions on Darwin (MIT License).
sysinfo/*        : Portable utility to iterate over /proc/maps (BSD License).
scripts/*        : Helper scripts.

Temporary build instructions (verified on linux):

cd lib/asan
make -f Makefile.old get_third_party  # gets googletest and cpplint
make -f Makefile.old test -j 8 CLANG_BUILD=/path/to/Release+Asserts
# Optional:
# make -f Makefile.old install # installs clang and rt to lib/asan_clang_linux

For more info see http://code.google.com/p/address-sanitizer/