[asan] Runtime support for asan-instrument-allocas which enables instrumentation of variable-sized dynamic allocas. Patch by Max Ostapenko.

Reviewed at http://reviews.llvm.org/D6055


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222520 91177308-0d34-0410-b5e6-96231b3b80d8
sanitizer_common: fix function w/o return
When SANITIZER_USES_CANONICAL_LINUX_SYSCALLS the function misses return statement.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222532 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Allow the users of SymbolizationLoop to make use of the --dsym_hint 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
[ASan] Get fake stack code working with GCC 4.8.2.

Summary:
TestCases/Linux/heavy_uar_test.cc was failing on my
PowerPC64 box with GCC 4.8.2, because the compiler recognised
a memset-like loop and turned it into a call to memset, which
got intercepted by __asan_memset, which got upset because it was
being called on an address in high shadow memory.

Use break_optimization to stop the compiler from doing this.

Reviewers: kcc, samsonov

Reviewed By: kcc

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6266

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222572 91177308-0d34-0410-b5e6-96231b3b80d8
Don't make check-sanitizer depend on profile on Windows

We don't build the profiling library on Windows, so CMake warns that the
target doesn't exist.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222588 91177308-0d34-0410-b5e6-96231b3b80d8
Try to fix ARM buildbots

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222619 91177308-0d34-0410-b5e6-96231b3b80d8
[compiler-rt] Make the MSAN wmemset intercepter call wmemset instead of memset. Fixes PR 21579

Summary:
Exactly what the title says. I've tested this change against the libc++ test failures and it solves all of them. The check-msan rule also still passes.
I'm not sure why it called memset originally. 

I can add tests if requested but currently there are no tests involving wide chars and they are a c++11 features.

Reviewers: kcc, eugenis

Reviewed By: eugenis

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6352

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222673 91177308-0d34-0410-b5e6-96231b3b80d8
[asan/coverage] change the way asan coverage instrumentation is done: instead of setting the guard to 1 in the generated code, pass the pointer to guard to __sanitizer_cov and set it there. No user-visible functionality change expected

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222675 91177308-0d34-0410-b5e6-96231b3b80d8
[TSan] Deflake test

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222699 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Improvements for asan deactivated mode: disable asan activation for runtime library on Linux, disable malloc checks.

Reviewed in http://reviews.llvm.org/D6265


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222732 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Fix leak tests on 64-bit targets other than x86-64 (take two)

Summary:
First, remove lit configuration that sets ASAN_OPTIONS to detect_leaks=1
because this is already the default when leak detection is supported.
This removes a bit of duplication between various lit.cfg files.

Second, add a new feature 'leak-detection' if we're targetting x86_64
(not i386) on Linux.

Third, change a couple of tests that need leak detection to require the
new 'leak-detection' feature.

Reviewers: kcc, earthdok, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6396

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222738 91177308-0d34-0410-b5e6-96231b3b80d8
[Asan] Pack signal context into a structure
Differential Revision: http://reviews.llvm.org/D6148


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222756 91177308-0d34-0410-b5e6-96231b3b80d8
[Sanitizers] Intercept __tls_get_addr() and shmctl() on FreeBSD
Differential Revision: http://reviews.llvm.org/D6384


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222757 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Remove leftover MSanDR bits in tests.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222762 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Fix typo in test

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222800 91177308-0d34-0410-b5e6-96231b3b80d8
[Sanitizer] Bump kMaxPathLength to 4096 and use it more extensively instead of hardcoded constants

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222803 91177308-0d34-0410-b5e6-96231b3b80d8
[Msan] Check returning value of DTLS_Get()
Differential Revision: http://reviews.llvm.org/D6403


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222818 91177308-0d34-0410-b5e6-96231b3b80d8
[Msan] Exclude non-FreeBSD interceptors on FreeBSD
Differential Revision: http://reviews.llvm.org/D6404


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222822 91177308-0d34-0410-b5e6-96231b3b80d8
[Asan] Fix the heavy_uar_test.cc test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D6406


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222826 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Disable preload tests on Android.

They don't test what they claim to because LD_PRELOAD applies to "not" instead
of the actual test binary. And all Android tests run with LD_PRELOAD anyway.


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