UBSan: print 'undefined-behavior' instead of 'runtime-error' in report summary

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218264 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Fix one test on Android-L.

index() is deprecated.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218312 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] don't instrument module CTORs that may be run before asan.module_ctor. This fixes asan running together -coverage 

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218421 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] make sanitizer tests depend on libclang_rt.profile since we now have a test that uses -coverage

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218427 91177308-0d34-0410-b5e6-96231b3b80d8
Follow-up for r217523: fix the dependencies for standalone compiler-rt build.

Patch by Kuba Brecka (kuba.brecka@gmail.com)



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218444 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a mistake in r217762

Summary:
The extra macro definition needs to go into COMPILER_RT_GTEST_CFLAGS
in order to be used for gtests on MSVC2012.

Test Plan: This is part of the fixes necessary for the ASAN tests to pass with MSVC2012.

Reviewers: timurrrr

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218464 91177308-0d34-0410-b5e6-96231b3b80d8
Add support for intercepting functions from msvcr110.dll

Summary: This finishes support for ASAN on MSVC2012.

Test Plan: |ninja check-asan| passes locally with this on MSVC2012.

Reviewers: timurrrr

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218465 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] disable a test that uses -coverage on Android

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218475 91177308-0d34-0410-b5e6-96231b3b80d8
[compiler-rt] ASan debugging API for report info extraction and locating addresses

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

This patch is part of an effort to implement a more generic debugging API, as proposed in http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-July/074656.html, with first part reviewed at http://reviews.llvm.org/D4466. Now adding several new APIs: __asan_report_present, __asan_get_report_{pc,bp,sp,address,type,size,description}, __asan_locate_address. These return whether an asan report happened yet, the PC, BP, SP, address, access type (read/write), access size and bug description (e.g. "heap-use-after-free"), __asan_locate_address takes a pointer and tries to locate it, i.e. say whether it is a heap pointer, a global or a stack, or whether it's a pointer into the shadow memory. If global or stack, tries to also return the variable name, address and size. If heap, tries to return the chunk address and size. Generally these should serve as an alternative to "asan_describe_address", which only returns all the data in text form. Having an API to get these data could allow having debugging scripts/extensions that could show additional information about a variable/expression/pointer. Test cases in test/asan/TestCases/debug_locate.cc and test/asan/TestCasea/debug_report.cc.




git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218481 91177308-0d34-0410-b5e6-96231b3b80d8
[compiler-rt] fix failing debug_locate.cc test due to a leak

New test from r218481 fails on Linux due to LeakSanitizer reporting a leak, this patch frees the memory properly. 



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218483 91177308-0d34-0410-b5e6-96231b3b80d8
[compiler-rt] revert r218481 due to test failure on sanitizer-x86_64-linux 



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218501 91177308-0d34-0410-b5e6-96231b3b80d8
[UBSan] Adding support of MIPS32

Changed files: 
config-ix.cmake: Enabled UBSan for MIPS32
sanitizer_stacktrace.cc: Program counter for MIPS32 is four byte aligned
and a delay slot so subtracted PC by 8 for getting call site address.
cast-overflow.cpp: Added big endian support for this test case.

Patch by Sagar Thakur.

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


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218519 91177308-0d34-0410-b5e6-96231b3b80d8
[compiler-rt] recommit of r218481: ASan debugging API for report info extraction and locating addresses

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

Fixed a test case failure on 32-bit Linux, I did right shift on intptr_t, instead it should have been uintptr_t.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218538 91177308-0d34-0410-b5e6-96231b3b80d8
Effectively revert r217284 on Darwin due to issues with -gmlt there

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218545 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Fix SELinux setup on Android-K.

On pre-L devices SELinux is set up in such a way that zygote wrapper
has to be in system_file context, not zygote_exec.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218599 91177308-0d34-0410-b5e6-96231b3b80d8
[compiler-rt] Do not use ldrexd or strexd on v7M

The ldrexd and strexd instructions are undefined for the ARMv7M
architecture, so we cannot use them to implement the
__sync_fetch_and_*_8 builtins. There is no other way to implement
these without OS support, so this patch #ifdef's these functions out
for M-class architectures.

There are no tests as I cannot find any existing tests for these
builtins.

I used the __ARM_ARCH_PROFILE predefine because __ARM_FEATURE_LDREX is
deprecated and not set by clang.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218601 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizer] Android build cleanup.

* Detect Android toolchain target arch and set correct runtime library name.
* Merged a lot of Android and non-Android code paths.
* Android is only supported in standalone build of compiler-rt now.
* Linking lsan-common in ASan-Android (makes lsan annotations work).
* Relying on -fsanitize=address linker flag when building tests (again,
  unification with non-Android path).
* Runtime library moved from lib/asan to lib/linux.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218605 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] add a test for array cookie if the operator new is defined inside the class (the cookie should not be poisoned in such case); update the related comment in asan_poisoning.cc

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218620 91177308-0d34-0410-b5e6-96231b3b80d8
[UBSan] Use <machine/endian.h> on Darwin.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218662 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Re-enable lsan_annotations test on Android.

Was fixed by r218605.


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