Don't forget to link in the C++-specific parts of the ubsan runtime when using the Makefile build system on Darwin.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177684 91177308-0d34-0410-b5e6-96231b3b80d8
ubsan: Pass floating-point arguments to the runtime by value if they fit the
value argument.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177689 91177308-0d34-0410-b5e6-96231b3b80d8
asan: fix lint warning about line length


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177709 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Fix an error on invalid deallocation in ASan allocator. When ASan checks if memory freed by user was indeed previously allocated, it first does an atomic write to presumed location of chunk header. This is wrong, as if the free is invalid, we may overwrite some valuable data (like other fields of the chunk header). Fix this by using atomic_compare_exchange instead.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177710 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] fix-up for r177634 on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177711 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Get rid of "using std::string" in msandr.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177714 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: work around FileCheck bug with empty outputs



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177715 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Place dlopen in an anon namespace.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177716 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Move test main and gtest include to separate files.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177718 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Change the way we report the alloca frame on stack-buff-overflow.

Before: the function name was stored by the compiler as a constant string
and the run-time was printing it.
Now: the PC is stored instead and the run-time prints the full symbolized frame.
This adds a couple of instructions into every function with non-empty stack frame,
but also reduces the binary size because we store less strings (I saw 2% size reduction).
This change bumps the asan ABI version to v3.

compiler-rt part, llvm part will follow.

Example of report (now):
==31711==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffa77cf1c5 at pc 0x41feb0 bp 0x7fffa77cefb0 sp 0x7fffa77cefa8
READ of size 1 at 0x7fffa77cf1c5 thread T0
    #0 0x41feaf in Frame0(int, char*, char*, char*) stack-oob-frames.cc:20
    #1 0x41f7ff in Frame1(int, char*, char*) stack-oob-frames.cc:24
    #2 0x41f477 in Frame2(int, char*) stack-oob-frames.cc:28
    #3 0x41f194 in Frame3(int) stack-oob-frames.cc:32
    #4 0x41eee0 in main stack-oob-frames.cc:38
    #5 0x7f0c5566f76c (/lib/x86_64-linux-gnu/libc.so.6+0x2176c)
    #6 0x41eb1c (/usr/local/google/kcc/llvm_cmake/a.out+0x41eb1c)
Address 0x7fffa77cf1c5 is located in stack of thread T0 at offset 293 in frame
    #0 0x41f87f in Frame0(int, char*, char*, char*) stack-oob-frames.cc:12  <<<<<<<<<<<<<< this is new
  This frame has 6 object(s):
    [32, 36) 'frame.addr'
    [96, 104) 'a.addr'
    [160, 168) 'b.addr'
    [224, 232) 'c.addr'
    [288, 292) 's'
    [352, 360) 'd'




git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177723 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: test that tsan explicitly says "race on vptr".
Requires llvm r177717.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177726 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Handle dlopen() failure in dlopen interceptor.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177728 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: return 0 on malloc() failure instead of crashing



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177741 91177308-0d34-0410-b5e6-96231b3b80d8
Band-aid fix for the Windows build caused by r177710. Long-term, atomic_compare_exchange_strong should be a template on Windows too...

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177745 91177308-0d34-0410-b5e6-96231b3b80d8
Revert 177745 as it was incorrect

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177746 91177308-0d34-0410-b5e6-96231b3b80d8
Build and install .syms files alongside sanitizer runtimes. These are used to
specify which symbols are exported to DSOs when the sanitizer is statically
linked into a binary.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177784 91177308-0d34-0410-b5e6-96231b3b80d8
[Sanitizer] Add basic test for atomic_compare_exchange implementation

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177851 91177308-0d34-0410-b5e6-96231b3b80d8
[Sanitizer] First effort to implement atomic_compare_exchange for 1-byte vars on Windows

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177854 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: add SetEnv() function that can be used in frontends



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177857 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: intercept setjmp/longjmp


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