Commit Graph

5565 Commits

Author SHA1 Message Date
Kostya Serebryany 8fd66a71c4 [asan/fuzzer] define a dummy weak __sanitizer_cov_trace_cmp
llvm-svn: 236907
2015-05-08 21:32:03 +00:00
Sergey Matveev 42cc8fa592 [sanitizer] Attempt to fix the test for missing coverage script.
llvm-svn: 236877
2015-05-08 16:30:01 +00:00
Sagar Thakur 3e493037be [TSan][MIPS] XFAIL long jump tests for MIPS64
Mark longjmp tests as XFAIL because longjmp assembly for mips is not yet implemented.

Reviewers: dsanders, dvyukov, samsonov
Subscribers: llvm-commits, mohit.bhakkad, jaydeep
Differential Revision: http://reviews.llvm.org/D9526

llvm-svn: 236847
2015-05-08 12:58:03 +00:00
Sagar Thakur 6c253006b8 [ASAN] Use regex for addresses in kernel_area.cc test
This test was failing on mips because mips addresses are 40-bit long.
Using regex for address solves this issue.

Reviewers: dsanders, kcc, samsonov
Subscribers: llvm-commits, mohit.bhakkad, jaydeep
Differential Revision: http://reviews.llvm.org/D9516

llvm-svn: 236844
2015-05-08 12:47:10 +00:00
Viktor Kutuzov b0d28db6f1 [Msan] Fix the report-demangling.cc test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D9554

llvm-svn: 236833
2015-05-08 12:10:46 +00:00
Viktor Kutuzov 7d5dfe1f34 [Msan] Make the obstack.cc test Linux-specific
Differential Revision: http://reviews.llvm.org/D9552

llvm-svn: 236831
2015-05-08 12:07:20 +00:00
Justin Bogner fa7525935b builtins: Implement the functions from stdatomic.h
Talking to John and Doug, we concluded that these functions from
stdatomic really do belong here in compiler-rt rather than in libc,
since the compiler owns stdatomic.h and these need to refer to
clang-specific builtins. Nonetheless, I've only added these on darwin
for now - other platforms should probably do the same unless their
libc does implement these functions.

llvm-svn: 236805
2015-05-08 05:39:05 +00:00
Alexey Samsonov 8e5e8fb2f3 [SanitizerCoverage] Upgrade lit tests to new -fsanitize-coverage= flags.
llvm-svn: 236796
2015-05-07 23:20:47 +00:00
Viktor Kutuzov d046d24461 Intercept scandir() on FreeBSD
Committed unreviewed with premission.

llvm-svn: 236720
2015-05-07 12:14:32 +00:00
Viktor Kutuzov 03a909f4b6 Intercept rand_r() on FreeBSD
Committed unreviewed with premission.

llvm-svn: 236719
2015-05-07 12:11:10 +00:00
Viktor Kutuzov 28c99980e6 [Msan] Make the mallinfo.cc test Linux-specific
Differential Revision: http://reviews.llvm.org/D9461

llvm-svn: 236718
2015-05-07 12:06:35 +00:00
Viktor Kutuzov bea3ca2abf [Msan] Make the ioctl_sound.cc test Linux-specific
Differential Revision: http://reviews.llvm.org/D9460

llvm-svn: 236717
2015-05-07 12:03:07 +00:00
Kostya Serebryany 13c03581ac Add dfsan_weak_hook_memcmp
Summary:
Add a weak hook to be called from dfsan's custom memcmp.
The primary user will be lib/Fuzzer.
If this works well we'll add more hooks (strcmp, etc).

Test Plan: Will be covered by lib/Fuzzer tests.

Reviewers: pcc

Reviewed By: pcc

Subscribers: llvm-commits

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

llvm-svn: 236679
2015-05-07 00:04:39 +00:00
Kostya Serebryany a86398e3fd Add api_list entries for the dfsan-based fuzzer
Summary: Add api_list entries for the dfsan-based fuzzer

Test Plan: covered by check-fuzzer

Reviewers: pcc

Reviewed By: pcc

Subscribers: llvm-commits

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

llvm-svn: 236657
2015-05-06 22:41:34 +00:00
Sergey Matveev a4cf7d71b8 [sanitizer] Restrict the missing coverage test to x86/x86_64.
Contrary to my hopes, it didn't magically work on other platforms.

llvm-svn: 236645
2015-05-06 21:50:42 +00:00
Sergey Matveev c2de346e48 [sanitizer] Extend sancov.py to show which PCs are missing from coverage.
Example usage:

sancov.py print a.out.1234.sancov | sancov.py missing a.out

llvm-svn: 236637
2015-05-06 20:48:29 +00:00
Evgeniy Stepanov 6153377219 [asan] Fall back to /proc/$PID/maps on Android L.
dl_iterate_phdr is somewhat broken in L (see the code for details).
We add runtime OS version detection and fallback to /proc/maps on L or earlier.
This fixes a number of ASan tests on L.

llvm-svn: 236628
2015-05-06 18:55:31 +00:00
Viktor Kutuzov 179ceff160 [Msan] Fix the mmap_below_shadow.cc test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D9462

llvm-svn: 236582
2015-05-06 09:31:33 +00:00
Viktor Kutuzov 385d3f2241 [Msan] Fix the ioctl_custom.cc test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D9459

llvm-svn: 236581
2015-05-06 09:28:48 +00:00
Viktor Kutuzov a26d2d4d5e [Msan] Fix the initgroups.cc test to build on FreeBSD
Differential Revision: http://reviews.llvm.org/D9458

llvm-svn: 236580
2015-05-06 09:26:35 +00:00
Viktor Kutuzov d04e0d7292 [Msan] Fix the ifaddrs.cc test to build and pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D9457

llvm-svn: 236579
2015-05-06 09:24:02 +00:00
Sagar Thakur 26f165b04e [ASan][MIPS] Fix null_deref.cc test on MIPS64
Symbol for pc used in ucontext->uc_mcontext was wrong.

Reviewers: dsanders, kcc, samsonov
Subscribers: llvm-commits, mohit.bhakkad, jaydeep
Differential Revision: http://reviews.llvm.org/D9246

llvm-svn: 236572
2015-05-06 06:53:09 +00:00
Sagar Thakur 1d2854477c [sanitizer][MIPS] Implement clone for MIPS
Reviewers: kcc, samsonov, earthdok
Subscribers: dsanders, jaydeep, Anand.Takale, mohit.bhakkad, llvm-commits
Differential Revision: http://reviews.llvm.org/D8318

llvm-svn: 236570
2015-05-06 05:38:21 +00:00
Evgeniy Stepanov ce29096614 [asan] Fix dynamic-runtime tests.
They are not part of check-all :(

This change adds sized-delete operators to the version list, and disables the
hack that excluded versioned symbols from the dynamic list - this is not an
issue in this case.

llvm-svn: 236559
2015-05-06 00:29:57 +00:00
Evgeniy Stepanov 8af114d93c [asan] Fix compiler-rt build.
i386 runtime library was accidentally using the x86_64 version script without a dependency.

llvm-svn: 236556
2015-05-05 23:13:50 +00:00
Evgeniy Stepanov e8b9d791c2 [asan] Use a version script to limit the symbols exported by the ASan shared runtime library.
llvm-svn: 236551
2015-05-05 22:51:35 +00:00
Kostya Serebryany f3343c5b38 [asan] fix IsDeadlySignal
llvm-svn: 236545
2015-05-05 21:38:50 +00:00
Evgeniy Stepanov 91960900f8 Build ASan runtime library with -z global on Android.
llvm-svn: 236537
2015-05-05 20:13:39 +00:00
Reid Kleckner 60bdf6e4c0 Disable exceptions with Clang on Windows in lib/sanitizer-common/tests
While I'm here, fix a copy-paste bug so we get debug info for these
tests.

llvm-svn: 236505
2015-05-05 16:52:50 +00:00
Dmitry Vyukov da6d5b919d tsan: add memory access functions that accept pc
This is required for Java support, as real PCs don't work for Java.

llvm-svn: 236484
2015-05-05 08:09:46 +00:00
Kostya Serebryany b044353bb2 [asan] under handle_abort=1 option intercept SIGABRT in addition to SIGSEGV/SIGBUS. Among other things this will allow to set up a death callback for SIGABRT and thus properly handle assert() in lib/Fuzzer
llvm-svn: 236474
2015-05-05 01:37:33 +00:00
Reid Kleckner 4fe30a06b1 Fix Windows coverage test with lit shell
llvm-svn: 236446
2015-05-04 19:41:58 +00:00
Reid Kleckner 3d6011fbef Disable exceptions for clang-compiled unittest code on Windows
llvm-svn: 236357
2015-05-01 22:23:56 +00:00
Derek Schuff de036eb170 Fix float->uint conversion for inputs less than 0
Summary:
The spec for these functions says that they should return 0 in this case but
this regressed in r234148. That revision essentially delegates the conversion
to the hardware, but that has different behavior on different platforms (e.g.
it is wrong on x86).

Also fix a typo in the name of __fixunsdfti

Test Plan: The existing unit tests now pass

Reviewers: joerg, howard.hinnant

Subscribers: llvm-commits

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

llvm-svn: 236319
2015-05-01 16:02:16 +00:00
Evgeniy Stepanov b0707833a1 [asancov] Fix coverage reserving 4x the necessary amount of memory on fork.
llvm-svn: 236294
2015-05-01 00:40:42 +00:00
Alexey Samsonov 085bede949 [UBSan] Make stacktrace-matching CHECK-lines in tests Linux-specific.
Darwin doesn't yet allow to print stack trace, as it lacks the slow
unwinder. This is one more attempt to fix vptr.cpp on Mac OS X.

llvm-svn: 236195
2015-04-30 01:21:57 +00:00
Justin Bogner 2d2faae647 profile: Use unique directory for tests that write default profile file
Fix a couple of new tests that were reverted because they were causing
intermittent test failures since they were writing the same default
"default.profraw" file. Fixed by creating a unique directory and
running tests in that directory.

Patch by Teresa Johnson. Thanks!

llvm-svn: 236168
2015-04-29 21:56:35 +00:00
Alexey Samsonov 3965cdeb39 [UBSan] Disable vptr.cpp on Darwin again.
llvm-svn: 236165
2015-04-29 21:51:23 +00:00
Alexey Samsonov 299c21474c [UBSan] Various improvements to vptr.cpp test case
* Remove __ubsan_default_options, so that test would work on Darwin
* Fix unintentional undefined behavior in the code (missing return)
* Build the test with -fno-sanitize-recover to distinguish expected
  failures and expected passes by return code.

llvm-svn: 236152
2015-04-29 20:39:12 +00:00
Alexey Samsonov ff46ebe5a4 [UBSan] Add a testcase for __ubsan_default_options() function.
llvm-svn: 236151
2015-04-29 20:39:10 +00:00
Ahmed Bougacha 69b5f93cb5 Re-XFAIL UBSan vptr testcase on darwin.
Partial revert of r235961; the test still fails on Green Dragon bots.

llvm-svn: 236135
2015-04-29 17:49:05 +00:00
Dmitry Vyukov 7d6d737693 tsan: add another test for setuid
llvm-svn: 236130
2015-04-29 17:22:43 +00:00
Renato Golin 0ac9031fa1 Revert 2 tests from "Tests for r236055."
This partially reverts commit r236056, as the two tests were using the same
names and, when executed in parallel, were having intermittent failures.

llvm-svn: 236101
2015-04-29 13:40:57 +00:00
Eric Christopher 4b3dd38ce0 Tests for r236055.
Patch by Teresa Johnson.

llvm-svn: 236056
2015-04-28 22:56:57 +00:00
Eric Christopher d641b53f93 This change is the first of 3 patches to add support for specifying
the profile output from the command line via -fprofile-instr-generate=<path>,
where the specified output path/file will be overridden by the
LLVM_PROFILE_FILE environment variable.

Several changes are made to the runtime to support this:

Add a new interface __llvm_profile_override_default_filename that will
set the profile output filename, but allows LLVM_PROFILE_FILE to override.
This is the interface used by the new option.

Refactor the pid-expansion done for LLVM_PROFILE_FILE into a separate
routine that can be shared by the various filename setting routines
(so that the filename from the option can also use the "%p" syntax).

Move the truncation into setFilename, and only truncate if there is a
new filename specified (to maintain support for appending to the same
profile file in the case of multiple shared objects built with profiling).

Move the handling for a NULL filename passed to __llvm_profile_set_filename and
__llvm_profile_override_default_filename into the new setFilenamePossiblyWithPid
routine. This now correctly resets the output file to default.profraw
instead of NULL.
The handling for a null LLVM_PROFILE_FILE (which should not reset) is done
by caller setFilenameFromEnvironment.

Patch by Teresa Johnson.

llvm-svn: 236055
2015-04-28 22:54:51 +00:00
Evgeniy Stepanov f483a8a9d0 [asan] Use dl_iterate_phdr on Android.
It's available on Android/ARM starting with API 21 (L).

llvm-svn: 236014
2015-04-28 18:50:32 +00:00
Dmitry Vyukov 25c94eb152 tsan: fix a bug memory access handling
We incorrectly replaced shadow slots
when the new value is not stronger than the old one.
The bug can lead to false negatives.
The bug was detected by Go race test suite:
https://github.com/golang/go/issues/10589

llvm-svn: 236008
2015-04-28 18:08:42 +00:00
Viktor Kutuzov 86e0249235 [Msan] Fix the getline.cc test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D9251

llvm-svn: 235975
2015-04-28 10:23:52 +00:00
Alexey Samsonov 09bff88fc4 [UBSan] Fix CMake rules for tests after r235954.
Make sure we don't run tests under TSan and MSan if they are
unavailable.

llvm-svn: 235962
2015-04-28 01:33:56 +00:00
Alexey Samsonov 4df0ebef47 Address old FIXMEs in UBSan test cases.
llvm-svn: 235961
2015-04-28 01:29:36 +00:00