[asan] fix lint

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162258 91177308-0d34-0410-b5e6-96231b3b80d8
[Sanitizer] define InternalScopedBuffer to replace large arrays on stack. It is defined analogous to similar class in tsan and should replace it.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162262 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] update asan-rt to match the interface change in LLVm (r162268)

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162269 91177308-0d34-0410-b5e6-96231b3b80d8
[Sanitizer] implement internal_strcspn

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162272 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] run-time part of the initialization order checker. Patch by Reid Watson with some bits from kcc. The sub-pass is off by default for now. On simple tests it works fine. 

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162278 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] fix mac build

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162279 91177308-0d34-0410-b5e6-96231b3b80d8
[TSan] switch tsan to using InternalScopedBuffer from sanitizer_common

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162351 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] fix CMake build: make sure that all ASan runtimes are built at correct directory

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162353 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] make ASan malloc/free hooks weak interface functions, overridable by user. Now the user can control malloc/free hooks without recompiling ASan runtime

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162355 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] get rid of ASAN_USE_EXTERNAL_SYMBOLIZER compiler def in favor of __asan_set_symbolize_callback interface function. Now the user doesn't have to recompile ASan runtime to provide its own symbolizer

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162358 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] use write instead of puts in malloc hooks test for ASan, as puts calls malloc on Mac

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162359 91177308-0d34-0410-b5e6-96231b3b80d8
[Sanitizer] Switch the symbolization strategy that would be used by sanitizer tools family: as compiling in-process symbolizer into runtime involves certain difficulties, we may instead launch an external symbolizer program (fork + execl) in a subprocess and communicate with it via pipe.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162437 91177308-0d34-0410-b5e6-96231b3b80d8
Re-implement the wrappers for libdispatch functions using blocks where appropriate
(kudos to Anna Zaks for a good example).
This simplifies the code much and lets us not implement internal parts of libdispatch.

All ASan tests from t32 and t64 should pass with the dylib runtime now.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162439 91177308-0d34-0410-b5e6-96231b3b80d8
[Sanitizer] Add external symbolizer binary. Next steps - include it in CMake build (produce 32-bit and 64-bit version of it, make sure we can compile LLVM sources with our own flags) and add tests for it.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162442 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: fix new memory allocator
Deallocate: drain blocks to central cache if cached too much (instead of never drain).
Allocate: batch allocate fixed amount of blocks (instead of all blocks).
This significantly reduces memory consumption of large heavy-multithreaded programs.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162447 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: allow to override per-thread event trace size
useful if you don't see the second stack trace


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162456 91177308-0d34-0410-b5e6-96231b3b80d8
Add add_clang_runtime_shared_library() CMake function and use it to put the shared ASan runtime in the appropriate place.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162546 91177308-0d34-0410-b5e6-96231b3b80d8
If the program is linked to a dynamic ASan runtime which is not present in DYLD_INSERT_LIBRARIES
(which, in turn, is required for our interceptors to take effect), re-exec the program with
DYLD_INSERT_LIBRARIES set.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162547 91177308-0d34-0410-b5e6-96231b3b80d8
Revert the erroneous changes made to Makefile.old in r162547
Remove a spare newline from asan_rtl.cc


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162548 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: improve memory allocator a bit


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162561 91177308-0d34-0410-b5e6-96231b3b80d8