Commit Graph

4716 Commits

Author SHA1 Message Date
Kostya Serebryany c9855da6d9 [asan] the run-time part of intra-object-overflow detector (-fsanitize-address-field-padding=1). Note that all of this is still experimental; don't use unless you are brave.
llvm-svn: 220013
2014-10-17 01:22:37 +00:00
Kostya Serebryany 87b70fc823 [asan] make sure coverage is dumped even if leaks are reported
llvm-svn: 219946
2014-10-16 18:59:07 +00:00
Renato Golin 6d41f7ae22 UBSAN stable runtime more generic with arm* targets
llvm-svn: 219924
2014-10-16 12:43:10 +00:00
Renato Golin 45abb8c969 Adds stable-runtime to ubsan to avoid broken ARM tests with asan
llvm-svn: 219906
2014-10-16 07:48:27 +00:00
Kuba Brecka 14c0c5901d [compiler-rt] compiler-rt's CMake append_if function clashes with LLVM's, let's rename it to append_list_if
Doing s/append_if/append_list_if/, no functional change.

http://reviews.llvm.org/D5739

llvm-svn: 219860
2014-10-15 22:47:54 +00:00
Will Schmidt a286594237 [compiler-rt] Enable ASAN for powerpc64le-linux
Whitespace update for lint check by myself (Will).  Otherwise code and comments by Peter Bergner, as previously seen on llvm-commits. 

    The following patch gets ASAN somewhat working on powerpc64le-linux.
    It currently assumes the LE kernel uses 46-bit addressing, which is
    true, but it doesn't solve the case for BE where it may be 44 or
    46 bits.  That can be fixed with a follow on patch.
    
    There are some test suite fails even with this patch that I haven't had
    time to solve yet, but this is better than the state it is in now.
    The limited debugging of those test suite fails seems to show that the
    address map for 46-bit addressing has changed and so we'll need to
    modify the shadow memory location slightly.  Again, that can be fixed
    with a follow on patch.

llvm-svn: 219827
2014-10-15 18:34:04 +00:00
Alexey Samsonov 76c875579a [CMake] Cleanup CMake rules after r219302. NFC.
llvm-svn: 219825
2014-10-15 18:23:57 +00:00
Alexey Samsonov 6c386e229b [UBSan] [MIPS] Adding support of UBSan for mipsel arch
Summary:
Changed files:
config-ix.cmake: Added mipsel to UBSAN_SUPPORTED_ARCH

Reviewers: rsmith, kcc, dsanders, petarj, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits, mohit.bhakkad, farazs, kumarsukhani

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

llvm-svn: 219822
2014-10-15 18:04:42 +00:00
Viktor Kutuzov 6b862f22e5 [Tsan] Fix the sunrpc.cc test to build on FreeBSD
Differential Revision: http://reviews.llvm.org/D5730

llvm-svn: 219791
2014-10-15 12:47:48 +00:00
Viktor Kutuzov adcf1ce904 [Tsan] Make the mutex_robust tests Linux-specific
Differential Revision: http://reviews.llvm.org/D5729

llvm-svn: 219790
2014-10-15 12:43:04 +00:00
Dmitry Vyukov 6373829449 tsan: fix false positive related to signals
Write interceptor calls malloc, which causes a false
unsafe-call-in-signal-handler report. See the test.

llvm-svn: 219784
2014-10-15 08:56:43 +00:00
Dmitry Vyukov a08a8dc01d tsan: use a different dir for llvm build
build is used as gtest temp build dir, and is cleared during every build

llvm-svn: 219783
2014-10-15 08:56:15 +00:00
Dmitry Vyukov f03e719f23 tsan: remove dead code
llvm-svn: 219779
2014-10-15 05:38:49 +00:00
Ed Maste 3ba162d2f9 Fix compiler-rt build on FreeBSD 10.1
We have to #define _WANT_RTENTRY to get struct rtentry, and add headers
that it depends on.

SIOCADDRT and SIOCDELRT also do not exist in FreeBSD 10.1 and were removed
in FreeBSD rev. 263203:

  Garbage collect long time obsoleted (or never used) stuff from routing
  API.

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

llvm-svn: 219722
2014-10-14 21:08:35 +00:00
Renato Golin 498b223eec Re-enable ASAN/UBSAN tests on ARM, with VFP3 they began to pass
When compiling with -mfpu=vfpv3, those tests began to pass, like the others
with "Illegal Instruction" error, so removing the XFAIL from them should
get the bot green (and have more tests!).

llvm-svn: 219721
2014-10-14 21:00:22 +00:00
Bob Wilson ca0a38e0ae Add complex multiply/divide functions to arm64 iOS libclang_rt libraries.
Clang r219557 introduces libcalls to complex multiply/divide functions.
Since these functions are not available in iOS for arm64 devices, add them to
the static libraries.

llvm-svn: 219715
2014-10-14 20:33:36 +00:00
Alexey Samsonov 37efdf0033 [UBSan] XFAIL test added in r219642 on Darwin
llvm-svn: 219699
2014-10-14 17:31:15 +00:00
Evgeniy Stepanov 9e984c5137 [sanitizer] Fix a crash in FP unwinder on ARM.
This change fixes 2 issues in the fast unwinder from r217079:
* A crash if a frame pointer points below current stack head, but
  inside the current thread stack limits. That memory may be
  unmapped. A check for this was lost in r217079.
* The last valid stack frame (the first one with an invalid next
  frame pointer) is always interpreted as a GCC layout frame. This
  results in garbled last PC in the (expected) case when the last
  frame has LLVM layout.

llvm-svn: 219683
2014-10-14 13:46:07 +00:00
Renato Golin 8fcae0b35e Fix silly commit to disable test on ARM
llvm-svn: 219681
2014-10-14 12:32:47 +00:00
Renato Golin 3743568735 Disable failing ASAN LongJump test on ARM
Updated the URL to reflect information on the problem as well as build the
case for ARM. This seems to be a wider problem, not ARM or PPC specific.

llvm-svn: 219680
2014-10-14 12:24:28 +00:00
Dmitry Vyukov 4eebdf22ef tsan: remove trailing whitespace
llvm-svn: 219678
2014-10-14 09:46:56 +00:00
Evgeniy Stepanov f518a4e774 [asan] Add fast_unwind_on_check flag.
Allows to specify the unwinder to use for CHECK failures. Previous behaviour
was to use the "fatal" unwinder.
As compiler-rt is built without frame pointers, only the slow unwinder
really makes sense here, and it is the default.

llvm-svn: 219677
2014-10-14 09:36:24 +00:00
Dmitry Vyukov ea2f3bffca tsan: refactor atexit handling
The current handling (manual execution of atexit callbacks)
is overly complex and leads to constant problems due to mutual ordering of callbacks.
Instead simply wrap callbacks into our wrapper to establish
the necessary synchronization.
Fixes issue https://code.google.com/p/thread-sanitizer/issues/detail?id=80

llvm-svn: 219675
2014-10-14 09:32:45 +00:00
Alexey Samsonov eb47d8a2c8 Sanitize upcasts and conversion to virtual base.
This change adds UBSan check to upcasts. Namely, when we
perform derived-to-base conversion, we:
1) check that the pointer-to-derived has suitable alignment
   and underlying storage, if this pointer is non-null.
2) if vptr-sanitizer is enabled, and we perform conversion to
   virtual base, we check that pointer-to-derived has a matching vptr.

llvm-svn: 219642
2014-10-13 23:59:00 +00:00
Filipe Cabecinhas 830c45e5de Fix minor typos in comments.
llvm-svn: 219632
2014-10-13 21:40:52 +00:00
Dmitry Vyukov 02ff8bb986 tsan: better reporting for virtual-call-after-free
Previously we said that it's a data race, which is confusing
if it happens in the same thread.

llvm-svn: 219600
2014-10-13 08:46:25 +00:00
Chandler Carruth 30bdfa7f99 [UBSan] Disable one run line of this test to allow the test as a whole
to pass in an opt build.

The test case in question does show UBSan catching the error, but it
doesn't then successfully set the exit code of the program. I'll let the
UBSan folks sort out why. It should reproduce trivially with an
optimized build.

llvm-svn: 219563
2014-10-11 06:49:00 +00:00
Alexey Samsonov 19c2e631bd [UBSan] Fix UBSan testcase for float->int conversion after LLVM r219542.
llvm-svn: 219559
2014-10-11 01:34:16 +00:00
Petar Jovanovic a1ac4b2f6a [asan][mips] Adding support of asan for mipsel arch
cmake/config-ix.cmake: Enabled building of asan for mipsel arch
test/asan/CMakeLists.txt: Enabled testing of asan for mipsel

Patch by Kumar Sukhani

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

llvm-svn: 219496
2014-10-10 13:46:55 +00:00
Renato Golin 1a8093c3a7 Disabling main() check on UBSAN, since the noreturn check is already made
llvm-svn: 219488
2014-10-10 10:26:14 +00:00
Viktor Kutuzov 4546519196 [Tsan] Do not use INTERCEPT_FUNCTION_VER() on FreeBSD
Differential Revision: http://reviews.llvm.org/D5708

llvm-svn: 219483
2014-10-10 07:11:58 +00:00
Viktor Kutuzov e3b6a6a379 [Tsan] Fix the getline_nohang.cc test to build on FreeBSD
Differential Revision: http://reviews.llvm.org/D5666

llvm-svn: 219482
2014-10-10 07:07:26 +00:00
Viktor Kutuzov 348758bbca [Tsan] Fix comments in the user_fopen.cc and user_malloc.cc tests
Related revision: http://reviews.llvm.org/D5670

llvm-svn: 219481
2014-10-10 07:01:52 +00:00
Viktor Kutuzov 918df1abd8 [Tsan] Make the user_fopen.cc and user_malloc.cc tests Linux-specific
Differential Revision: http://reviews.llvm.org/D5670

llvm-svn: 219478
2014-10-10 06:55:17 +00:00
Renato Golin e68963a986 XFAIL some more sanitiser ARMv7l tests
Some more tests failing on the ARMv7 buildbot.

llvm-svn: 219404
2014-10-09 11:34:40 +00:00
Viktor Kutuzov e17b55be69 [Tsan] Fix the signal_errno.cc and signal_malloc.cc tests to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D5669

llvm-svn: 219399
2014-10-09 09:40:02 +00:00
Viktor Kutuzov c2e274dc2c [Tsan] Fix the global_race tests to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D5668

llvm-svn: 219398
2014-10-09 09:35:25 +00:00
Viktor Kutuzov 27781f993d [Tsan] Fix the blacklist2.cc test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D5665

llvm-svn: 219397
2014-10-09 09:04:26 +00:00
Viktor Kutuzov bafaa7f6ba [Sanitizers] Intercept dlopen() and dlclose() on FreeBSD
Differential Revision: http://reviews.llvm.org/D5664

llvm-svn: 219396
2014-10-09 08:59:59 +00:00
Viktor Kutuzov 2ed7c9df7f [Tsan] Fix references to libc entities in tsan_interceptors.cc on FreeBSD
Differential Revision: http://reviews.llvm.org/D5663

llvm-svn: 219395
2014-10-09 08:56:22 +00:00
Renato Golin 1aaa4bcdd1 Mark sanitizer tests XFAIL on ARMv7
ASAN, UBSAN and profile tests that don't work with arm-linux-gnueabi and
android also don't work on armv7l-linux-gnueabihf. Some of the tests have
known causes, others not yet. In order to get a green bot, I'm disabling
those tests for now and will investigate when the priority rises.

llvm-svn: 219343
2014-10-08 21:13:23 +00:00
Ed Maste e4320f5e6a Remove bashisms and switch to /bin/sh
On a default FreeBSD install Bash is not installed and fdescfs is not
mounted.  Use plain sh functionality instead.

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

llvm-svn: 219333
2014-10-08 18:35:16 +00:00
Tim Northover 8897b8d21a AArch64: don't just hack arm64 support into compiler-rt.
We should check whether the compiler & linker support ARM64 before attempting
to build a version of compiler-rt for it. Otherwise things will go badly.

rdar://problem/18575597

llvm-svn: 219332
2014-10-08 18:34:30 +00:00
Tim Northover a5a06ad6fc AArch64: add support for ARM64 iOS versions of compiler-rt.
Just a dummy directory and a few sane choices in the Darwin SDK.

rdar://problem/18575597

llvm-svn: 219323
2014-10-08 17:28:37 +00:00
Renato Golin 34cb659103 Separating ARM/AArch64 Compiler-RT tests
Makes sure ARM bots don't run AArch64 and vice-versa, since not all
AArch64 systems can run AArch32 and no ARM hardware can run AArch64.

llvm-svn: 219304
2014-10-08 13:47:18 +00:00
Alexander Potapenko ff7456dd34 [ASan] Bump the minimum OSX version required to run ASan to 10.7.
llvm-svn: 219302
2014-10-08 12:41:11 +00:00
Lorenzo Martignoni 60ebffc12f Custom wrappers for DFSanitizing sprintf & snprintf.
Differential Revision: http://reviews.llvm.org/D5561

llvm-svn: 219293
2014-10-08 10:01:42 +00:00
Ed Maste 89b80fb022 Avoid bashisms and switch to /bin/sh
Bash may not be installed on some systems by default, like FreeBSD.

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

llvm-svn: 219231
2014-10-07 20:23:57 +00:00
Ed Maste 1419e9adb5 Run profile tests on FreeBSD
FreeBSD does not have libdl, so set it via lit.cfg instead of the test
input, as with asan.  Also remove it from Darwin test runs - it's not
necessary, but harmless there.

Add FreeBSD to the list of hosts to test.

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

llvm-svn: 219227
2014-10-07 19:24:24 +00:00
Yuri Gorshenin d6c04770c1 Fixed asan-asm-stacktrace-test.cc
Summary: Fixed asan-asm-stacktrace-test.cc. Now it's supported on x86_64 and added test run when no debug info is generated.

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

llvm-svn: 219200
2014-10-07 11:12:55 +00:00