[Sanitizers] Intercept wordexp on FreeBSD
Differential Revision: http://reviews.llvm.org/D6737


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


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



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224701 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: reset stack0 in the first partition of thread trace

stack0/mset0 contained bogus values from the previous thread
that used the same id



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224702 91177308-0d34-0410-b5e6-96231b3b80d8
[Msan] Fix uname() interception on FreeBSD
Differential Revision: http://reviews.llvm.org/D6738


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


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224709 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Fix the logic that decides whether we need to spawn a new llvm-symbolizer in asan_symbolize.py


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224710 91177308-0d34-0410-b5e6-96231b3b80d8
AddressSanitizer: Properly handle dispatch_source_set_cancel_handler with a
NULL handler

Per
https://developer.apple.com/library/mac/documentation/Performance/Reference/GCD_libdispatch_Ref/index.html,
the dispatch_source_set_cancel_handler() API *can* be called with a NULL
handler. In that case, the libdispatch removes an already existing cancellation
handler, if there was one. ASan's interceptor always creates a new block that
always tries to call the original handler. In case the original block is NULL,
a segmentation fault happens. Let's fix that by not wrapping a NULL-block at
all.

It looks like all the other libdispatch APIs (which we intercept) do *not*
allow NULL. So it's really only the dispatch_source_set_cancel_handler one that
needs this fix.

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




git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224711 91177308-0d34-0410-b5e6-96231b3b80d8
AddressSanitizer: Abort after failed exec() and get rid of the allow_reexec ASan flag

As mentioned in
https://code.google.com/p/address-sanitizer/issues/detail?id=365, when the
re-exec that adds the required DYLD_INSERT_LIBRARIES variable fails, ASan
currently continues to run, but things are broken (some memory can be
overwritten, interceptors don't work, ...). This patch aborts if the execv()
fails and prints an error message that DYLD_INSERT_LIBRARIES is required. It
also removes the "alllow_reexec" flag, since using it causes the same issues.

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




git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224712 91177308-0d34-0410-b5e6-96231b3b80d8
[Msan] Fix msan_test.cc inclusions to build the unit tests on FreeBSD
Differential Revision: http://reviews.llvm.org/D6757


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224724 91177308-0d34-0410-b5e6-96231b3b80d8
[Sanitizer] Make CommonFlags immutable after initialization.

Summary:
Protect CommonFlags singleton by adding const qualifier to
common_flags() accessor. The only ways to modify the flags are
SetCommonFlagsDefaults(), ParseCommonFlagsFromString() and
OverrideCommonFlags() functions, which are only supposed to be
called during initialization.

Test Plan: regression test suite

Reviewers: kcc, eugenis, glider

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224736 91177308-0d34-0410-b5e6-96231b3b80d8
Change the CMake build to generate full debugging info when COMPILER_RT_DEBUG=ON

The compiler-rt CMake build currently uses -gline-tables-only for all builds. While this makes the debugger correctly map source files, debugging of the runtime libraries in general is pretty tough, because you don't see any local variables, parameters, etc. Let's allow emitting full debugging info by setting COMPILER_RT_DEBUG=ON.

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



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

Usually we roll the variable declaration into the condition in cases like this.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224755 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Better error message in coverage.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224762 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Fix line >80 chars.


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