tsan: address comments in r214912
See http://reviews.llvm.org/D4794



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216900 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: restructure signal handling to allow recursive handling
Fixes issue
https://code.google.com/p/thread-sanitizer/issues/detail?id=71



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216903 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: disable getpwent interceptors

There interceptors do not seem to be strictly necessary for tsan.
But we see cases where the interceptors consume 70% of execution time.
Memory blocks passed to fgetgrent_r are "written to" by tsan several times.
First, there is some recursion (getgrnam_r calls fgetgrent_r), and each
function "writes to" the buffer. Then, the same memory is "written to"
twice, first as buf and then as pwbufp (both of them refer to the same addresses).




git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216904 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: more precise handling of atexit callbacks
Fixes issue https://code.google.com/p/thread-sanitizer/issues/detail?id=74



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216906 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Fix origin_history_per_stack_limit=0 behavior.

It disables the per-stack limit.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217030 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: handle early signals
The second part of the fix of
https://code.google.com/p/thread-sanitizer/issues/detail?id=71



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217031 91177308-0d34-0410-b5e6-96231b3b80d8
Fix fast stack unwind on ARM to support code generated with GCC.

http://reviews.llvm.org/D4692

Patch by Maxim Ostapenko!


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217079 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] remove debug print

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217101 91177308-0d34-0410-b5e6-96231b3b80d8
Fixup test case after r217079

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217111 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] allow deadly signals to be received in signal handlers
(previously ASan would just crash upon the second SEGV)
Other tools do not use this code yet.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217137 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Make origin tracking fork-safe.

Chained origins make plain memory stores async-signal-unsafe.
We already disable it inside signal handlers.
This change grabs all origin-related locks before fork() and releases
them after fork() to avoid a deadlock in the child process.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217140 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Fix fork test on centos-6.5.

Missing <atomic> header.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217142 91177308-0d34-0410-b5e6-96231b3b80d8
Fix building sanitizer_linux_libcdep.cc on FreeBSD
Differential Revision: http://reviews.llvm.org/D5166


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217148 91177308-0d34-0410-b5e6-96231b3b80d8
Intercept _exit() for sanitizers' needs on FreeBSD
Differential Revision: http://reviews.llvm.org/D5171


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217156 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Remove the check for a double-SEGV from zero_page_pc.cc
Looks like the second crash doesn't happen on Mac.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217165 91177308-0d34-0410-b5e6-96231b3b80d8
profile: Avoid name collisions between instrumentation and runtime

The naming scheme we're using for counters in profile data shares a
prefix with some fixed names we use for the runtime, notably
__llvm_profile_data_begin and _end. Embarrassingly, this means a
function called begin() can't be instrumented.

This modifies the runtime names so as not to collide with the
instrumentation.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217166 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] trying to de-flake new_array_cookie_uaf_test.cc

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217177 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Remove the call to GetPageSizeCached from fast path of FastPoisonShadow

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217194 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] relax the assertion around array cookie load; still need to extract a reproducer where this assertion fails...

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217215 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] disable zero_page_pc.cc on Android.
Bug: https://code.google.com/p/address-sanitizer/issues/detail?id=336


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