[msan] Fix origin of deallocated memory.

MSan poisons deallocated memory but it used to give it an invalid origin value,
resulting in confusing reports. This change associates deallocation stack trace
with such memory.

Note that MSan does not have quarantine, and use-after-free detection is very
limited.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190781 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Check return value of main: compiler-rt tests.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190783 91177308-0d34-0410-b5e6-96231b3b80d8
Minor enhancements for sanitizer_common build rules

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190786 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Check that getSymbolizer() is defined. Turn magic mapping constants into named variables

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190787 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Split ASan unit tests into two different binaries:

(1) instrumented, i.e. compiled and linked with -fsanitize=address
(2) not instrumented, compiled w/o -fsanitize=address and linked with ASan runtime statically.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190788 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Don't link with pthread on Android

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190794 91177308-0d34-0410-b5e6-96231b3b80d8
Check the function we just called for errors, not an incoming argument. Noticed
by inspection.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190828 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] further speedup use-after-return: simplify deallocation of fake frames. ~ 20% speedup.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190852 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Link tests with -pie if ASan runtime uses zero-base shadow

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190853 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Enable fake stack test on Mac and Android, as no-instrumentation tests are now fixed

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190856 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Don't add SANITIZER_INTERFACE_ATTRIBUTE for internal ASan functions

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190860 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] add a run-time option detect_stack_use_after_return, add verbosity output for fake stack

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190932 91177308-0d34-0410-b5e6-96231b3b80d8
[tsan] No-op implementation of AnnotateMemoryIsInitialized.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190933 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: refactor internal IgnoreCtl interface



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190987 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: consistently use thr instead of cur_thread() in annotations implementation


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190988 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: prevent the following false positive due to __cxa_atexit

WARNING: ThreadSanitizer: data race (pid=29103)
  Write of size 8 at 0x7d64003bbf00 by main thread:
    #0 free tsan_interceptors.cc:477
    #1 __run_exit_handlers <null>:0 (libc.so.6+0x000000050cb7)

  Previous write of size 8 at 0x7d64003bbf00 by thread T78 (mutexes: write M9896):
    #0 calloc tsan_interceptors.cc:449
    #1 ...





git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190989 91177308-0d34-0410-b5e6-96231b3b80d8
asan/tsan/msan: use builtin atomic operations when available
this should fix episodic crashes on ARM/PPC
x86_32 is still broken



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190991 91177308-0d34-0410-b5e6-96231b3b80d8
[TSan] Fix -Wempty-body warning

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190993 91177308-0d34-0410-b5e6-96231b3b80d8
[MSan] Fix -Wempty-body warning

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190994 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] fix one more async-signal-safety issue with use-after-return

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