Add override specifiers to Symbolizer methods. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223094 91177308-0d34-0410-b5e6-96231b3b80d8
[Tsan] Do not flush all streams on exit
Differential Revision: http://reviews.llvm.org/D6462


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223121 91177308-0d34-0410-b5e6-96231b3b80d8
[Tsan] Fix the atomic_race.cc test to pass on systems with high loads
Differential Revision: http://reviews.llvm.org/D6478


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223122 91177308-0d34-0410-b5e6-96231b3b80d8
Simplify Symbolizer::SymbolizePC() interface.

Return a linked list of AddressInfo objects, instead of using an array of
these objects as an output parameter. This simplifies the code in callers
of this function (especially TSan).

Fix a few memory leaks from internal allocator, when the returned
AddressInfo objects were not properly cleared.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223145 91177308-0d34-0410-b5e6-96231b3b80d8
Add missing #include to fix Android build.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223157 91177308-0d34-0410-b5e6-96231b3b80d8
Replace InternalScopedBuffer<char> with InternalScopedString where applicable.

Summary: No functionality change.

Test Plan: make check-all

Reviewers: kcc

Reviewed By: kcc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223164 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] fix four asan tests to run in use-after-return mode 

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223181 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Re-enable one test.

It has been fixed a long time ago.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223226 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Add one more test for the handling of stack origins.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223229 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Fix stale_stack_leak.cc test in ASan-UAR mode.

This test does an intentional use-after-return, but this is not the focus of
the test, so ignore it.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223230 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Change the way origin ids are built.

Previously, all origin ids were "chained" origins, i.e values of
ChainedOriginDepot. This added a level of indirection for simple
stack and heap allocation, which were represented as chains of
length 1. This costs both RAM and CPU, but provides a joined 2**29
origin id space. It also made function (any instrumented function)
entry non-async-signal-safe, but that does not really matter because
memory stores in track-origins=2 mode are not async-signal-safe anyway.

With this change, the type of the origin is encoded in origin id.
See comment in msan_origin.h for more details. This reduces chained and stack
origin id range to 2**28 each, but leaves extra 2**31 for heap origins.

This change should not have any user-visible effects.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223233 91177308-0d34-0410-b5e6-96231b3b80d8
ASan CMakeLists.txt: fix bad indent; NFC

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223258 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] allow -fsanitize-coverage=N together with -fsanitize=memory, compiler-rt part

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223314 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Put the coverage files for coverage-levels.cc into a temporary dir.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223355 91177308-0d34-0410-b5e6-96231b3b80d8
CMake: build DLLs in the right directory and include them in the 'install' target (PR21719)

When CMake builds a dynamic library on Windows, the .dll file's location is
determined by the RUNTIME_OUTPUT_DIRECTORY, which we were previously not
setting.

This means for example that clang_rt.asan_dynamic-i386.dll will get built
and installed in the same directory as the corresponding .lib file,
instead of being built in the bin/ directory and not installed at all.

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223387 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan, LSan] Improve tracking of thread creation.

In the current scheme of things, the call to ThreadStart() in the child
thread is not synchronized with the parent thread. So, if a pointer is passed to
pthread_create, there may be a window of time during which this pointer will not
be discoverable by LSan. I.e. the pthread_create interceptor has already
returneed and thus the pointer is no longer on the parent stack, but we don't
yet know the location of the child stack. This has caused bogus leak reports
(see http://llvm.org/bugs/show_bug.cgi?id=21621/).

This patch makes the pthread_create interceptor wait until the child thread is
properly registered before returning.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223419 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: protect trace memory range on startup

so that user does not map something there ahead of us



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

this test is flaky because of ASLR
app memory is 7e8000000000-800000000000,
there may or may not be a 1TB hole depending on
where ASLR will choose to map libraries



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223469 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Fix Win build following r223419.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223477 91177308-0d34-0410-b5e6-96231b3b80d8
[LSan] Rewrite the test from r223419 to not use C++11.

This was causing build failures on llvm-clang-lld-x86_64-centos-6.5 for some
reason. Anyway, the new way is better because we no longer rely on std::thread
implementation details.

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