Commit Graph

804 Commits

Author SHA1 Message Date
Kostya Serebryany cba49d4b04 [sanitizer] add run-time a flag coverage_order_pcs. When true, the PCs are dumped in the order of their appearance
llvm-svn: 232573
2015-03-18 00:23:44 +00:00
Alexey Samsonov c9d9610317 Improve SUMMARY reporting in sanitizers.
Make sure SUMMARY is always reported unless print_summary flag is set to
false, even if symbolizer is unavailable or report stack trace is empty.
If file/line info for PC can't be evaluated, print module name/offset
like we do in stack trace.

llvm-svn: 232567
2015-03-17 23:46:06 +00:00
Kostya Serebryany 9f1243ee49 [sanitizer] change the format of coverage dump: instead of always dumping 32-bit offsets dump 32-bit offsets on 32-bit arch and 64-bit offsets on 64-bit arch. Also add the 'bits' parameter to sancov.py. This is a user-visible interface change.
llvm-svn: 232555
2015-03-17 22:09:19 +00:00
Dmitry Vyukov 6bd917a31f asan: optimization experiments
The experiments can be used to evaluate potential optimizations that remove
instrumentation (assess false negatives). Instead of completely removing
some instrumentation, you set Exp to a non-zero value (mask of optimization
experiments that want to remove instrumentation of this instruction).
If Exp is non-zero, this pass will emit special calls into runtime
(e.g. __asan_report_exp_load1 instead of __asan_report_load1). These calls
make runtime terminate the program in a special way (with a different
exit status). Then you run the new compiler on a buggy corpus, collect
the special terminations (ideally, you don't see them at all -- no false
negatives) and make the decision on the optimization.

The exact reaction to experiments in runtime is not implemented in this patch.
It will be defined and implemented in a subsequent patch.

http://reviews.llvm.org/D8198

llvm-svn: 232501
2015-03-17 16:59:11 +00:00
Timur Iskhodzhanov d58230b9dc [ASan/Win] Fix a CHECK failure when an exception is thrown from a callback passed to BindIoCompletionCallback
This also simplifies how we handle QueueUserWorkItem

llvm-svn: 232499
2015-03-17 16:50:59 +00:00
Peter Collingbourne 3fc1563ad7 CFI: Make check-cfi depend on libLTO on Darwin.
llvm-svn: 232426
2015-03-16 22:00:04 +00:00
Peter Collingbourne 678e78ca95 CFI: Add test for bad cast checks.
llvm-svn: 232242
2015-03-14 02:42:39 +00:00
Peter Collingbourne ca1c7793b1 CFI: Add a test for distinguishing between non-overriding siblings.
llvm-svn: 232238
2015-03-14 01:35:33 +00:00
Viktor Kutuzov 281347aa59 [Tsan] Fix test.h to work on FreeBSD
Differential Revision: http://reviews.llvm.org/D8303

llvm-svn: 232167
2015-03-13 14:08:55 +00:00
Dmitry Vyukov b75212878f tsan: fix a bug in MetaMap::ResetRange
The bug was uncovered by NegativeTests.MmapTest from
data-race-test suite, so port it as well.

llvm-svn: 232032
2015-03-12 12:48:19 +00:00
Dmitry Vyukov a60829a1b6 tsan: fix crash during __tsan_java_move
Munmap interceptor did not reset meta shadow for the range,
and __tsan_java_move crashed because it encountered
non-zero meta shadow for the destination.

llvm-svn: 232029
2015-03-12 11:24:16 +00:00
Kuba Brecka 3c53266ca8 Make the UBSan coverage-levels.cc test be Linux specific
Reviewed at http://reviews.llvm.org/D8278

llvm-svn: 232025
2015-03-12 10:44:34 +00:00
Joerg Sonnenberger 91bd698eaf Refactor float to integer conversion to share the same code.
80bit Intel/PPC long double is excluded due to lacking support
for the abstraction. Consistently provide saturation logic.
Extend to long double on 128bit IEEE extended platforms.

Initial patch with test cases from GuanHong Liu.
Reviewed by Steve Canon.

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

llvm-svn: 231965
2015-03-11 21:13:56 +00:00
Timur Iskhodzhanov 81514e0660 [ASan/Win] Fix a CHECK failure when an exception is thrown from a callback passed to QueueUserWorkItem
llvm-svn: 231947
2015-03-11 17:47:10 +00:00
Dmitry Vyukov 2d78c6371d asan: fix leak test for power platform
Power is 64-bit but does not support leak detection,
so this test fails. Use the more robust leak-detection
predicate instead.

llvm-svn: 231782
2015-03-10 10:36:06 +00:00
Kostya Serebryany 48a4023f40 [sanitizer] fix instrumentation with -mllvm -sanitizer-coverage-block-threshold=0 to actually do something useful.
llvm-svn: 231736
2015-03-10 01:58:27 +00:00
Alexey Samsonov de34ec0193 Revert "Revert "[UBSan] Add testcases for -fsanitize=shift-base and -fsanitize=shift-exponent.""
Re-land r231151 now that -fsanitize=shift-base implementation should not
introduce undefined behavior.

llvm-svn: 231712
2015-03-09 21:50:40 +00:00
Joerg Sonnenberger 6d7cb4668f Avoid warnings on !PowerPC
llvm-svn: 231609
2015-03-08 21:08:39 +00:00
Joerg Sonnenberger 531cf7f491 Don't produce warnings on !PowerPC.
llvm-svn: 231608
2015-03-08 21:06:58 +00:00
Kostya Serebryany 136494c256 [asan] Fix 2 problems in nohugepage_test.
1. /proc/self/smaps may be bigger than 1 << 14.  On my machine, it is
26KB.
2. The read system call may return a partially filled buffer.  We need
to check the return value from read.

Patch by H.J. Lu

llvm-svn: 231502
2015-03-06 19:33:58 +00:00
Kuba Brecka da0204d05f Add a symbolizer testcase for closed stdin/stdout
Reviewed at http://reviews.llvm.org/D7973

llvm-svn: 231429
2015-03-05 23:41:47 +00:00
Kostya Serebryany 769ddaa2d4 [sanitizer] Reconstruct the function that dumps block/edge coverage, hopefully making it more robust. Also increase the allowed coverage size on 32-bit.
llvm-svn: 231413
2015-03-05 22:19:25 +00:00
Alexey Samsonov 4833452c0c Revert "[UBSan] Add testcases for -fsanitize=shift-base and -fsanitize=shift-exponent."
The test case fails on AArch64.

llvm-svn: 231410
2015-03-05 21:57:47 +00:00
Dmitry Vyukov 72f169797e tsan: fix signal handling during stop-the-world
Long story short: stop-the-world briefly resets SIGSEGV handler to SIG_DFL.
This breaks programs that handle and continue after SIGSEGV (namely JVM).
See the test and comments for details.

This is reincarnation of reverted r229678 (http://reviews.llvm.org/D7722).
Changed:
- execute TracerThreadDieCallback only on tracer thread
- reset global data in TracerThreadSignalHandler/TracerThreadDieCallback
- handle EINTR from waitpid

Add 3 new test:
- SIGSEGV during leak checking
- StopTheWorld operation during signal storm from an external process
- StopTheWorld operation when the program generates and handles SIGSEGVs

http://reviews.llvm.org/D8032

llvm-svn: 231367
2015-03-05 14:37:28 +00:00
Kostya Serebryany c1d6ab9a1e [sanitizer] add a run-time flag to dump the coverage counter bitset
llvm-svn: 231343
2015-03-05 02:48:51 +00:00
Alexey Samsonov f3761c36f2 [ASan] Fix asan-(32|64)-bits lit tests feature.
It broke down at some point, and all tests with
  REQUIRES: asan-(32|64)-bits
line stopped being executed. Restore the intended behavior.

llvm-svn: 231325
2015-03-05 00:33:11 +00:00
Kostya Serebryany 07aee9c2c6 [sanitizer] when dumping coverage bitset, dump seperate file for every module, instead of dumping a single combined bitset
llvm-svn: 231319
2015-03-04 23:41:55 +00:00
Kostya Serebryany 4bdf5ada18 [asan] more fixes for x32, patches by H.J. Lu
llvm-svn: 231174
2015-03-03 23:46:40 +00:00
Alexey Samsonov 987666d57c [UBSan] Add testcases for -fsanitize=shift-base and -fsanitize=shift-exponent.
llvm-svn: 231151
2015-03-03 22:15:44 +00:00
Alexey Samsonov 990864018f [Sanitizer] Run test/sanitizer_common lit tests on all supported architectures.
llvm-svn: 231025
2015-03-02 22:03:52 +00:00
Timur Iskhodzhanov 18cfba9fa4 [ASan/Win] Work around PR22545: call LLVM global_dtors in the MD atexit()
llvm-svn: 231000
2015-03-02 19:41:09 +00:00
Alexey Samsonov d06aa3dc00 [MSan] Remove explicit -m64 from RUN lines.
Target-specific flags should usually be configured by CMake/lit.

llvm-svn: 230999
2015-03-02 19:34:27 +00:00
Alexey Samsonov 3e40703ab5 [DFSan] Remove explicit -m64 from RUN lines.
Target-specific flags should usually be configured by CMake/lit.

llvm-svn: 230997
2015-03-02 19:34:06 +00:00
Alexey Samsonov 1ce8745b77 [Sanitizer] Restrict open_memstream to x86_64. Fixes PR22714.
llvm-svn: 230996
2015-03-02 19:34:02 +00:00
Alexey Samsonov 1be519876d [Sanitizer] Fix StripPathPrefix function and improve test case.
llvm-svn: 230986
2015-03-02 18:55:46 +00:00
Timur Iskhodzhanov 45ddd694fd [ASan/Win] Rename a test.
I came up with the original name trying to test a different issue and forgot to rename afterwards

llvm-svn: 230961
2015-03-02 14:49:44 +00:00
Hans Wennborg 521a941074 Revert r229678 "tsan: fix signal handling during stop-the-world"
This was causing Chromium's browser_tests to flakily segfault during
leak check.

llvm-svn: 230874
2015-02-28 22:18:11 +00:00
Alexey Samsonov 34dc40730a [ASan] debug_stacks.cc was passing on ARM by accident, disable this test there for now.
llvm-svn: 230833
2015-02-28 01:35:46 +00:00
Timur Iskhodzhanov 342f5dead0 [ASan/Win] Update test expectations after r230724
llvm-svn: 230755
2015-02-27 14:29:53 +00:00
Anna Zaks 2249049db2 [compiler-rt] Allow suppression file to be relative to the location of the executable
The ASanified executable could be launched from different locations. When we
cannot find the suppression file relative to the current directory, try to
see if the specified path is relative to the location of the executable.

llvm-svn: 230723
2015-02-27 03:12:19 +00:00
Alexey Samsonov 0b0cafc8fc [Sanitizer] Print column number in SUMMARY line if it's available.
llvm-svn: 230721
2015-02-27 02:29:25 +00:00
Alexey Samsonov 1c915782b9 [UBSan] Run all UBSan tests in 32-bit mode as well.
We build and support UBSan on 32-bit platforms. We should run tests
there as well. Fixes PR22683.

llvm-svn: 230662
2015-02-26 19:19:44 +00:00
Kostya Serebryany ba9422971c [asan] reenable odr-violation.cc test on non-x86-64 after confirming that it's fixed. PR22699
llvm-svn: 230573
2015-02-25 23:23:01 +00:00
Kostya Serebryany 497eeb598b [asan] restict no_asan_gen_globals.c test to 64-bit due to PR22682
llvm-svn: 230537
2015-02-25 20:19:23 +00:00
Peter Collingbourne 4be9b40091 CFI: Add a check-cfi-and-supported rule.
This rule works like check-cfi, but fails if the tests are unsupported.
This is useful to run on bots if we want to be sure that the tests aren't
silently being skipped.

llvm-svn: 230536
2015-02-25 20:14:05 +00:00
Kostya Serebryany 2a102cbc77 [asan] temporary disable the test on non-x86-64 while we are investigating PR22699
llvm-svn: 230516
2015-02-25 18:03:03 +00:00
Timur Iskhodzhanov 40d72d9a1f Reland r230019 - [ASan] Make the argument of '__sanitizer_annotate_contiguous_container' is not aligned error message easier to understand
This incorporates the fix for ARM architecture suggested by Renato Golin.

llvm-svn: 230506
2015-02-25 17:03:34 +00:00
Timur Iskhodzhanov 73e5951ed9 Fix duplicate test code introduced by running "patch -p0" twice
Sorry, SVN had some weird problems so I had to revert and reapply the patch
locally a couple of times and didn't notice I've added file contents to the same
file....

llvm-svn: 230505
2015-02-25 17:01:09 +00:00
Timur Iskhodzhanov 5c62af5bb1 Reland r230419 - add __asan_default_suppressions() hook with a fix for Windows
llvm-svn: 230501
2015-02-25 16:00:26 +00:00
Nico Weber d70bb8d8cb Revert 230419, 230425, 230432.
They don't build on Windows.
http://lab.llvm.org:8011/builders/sanitizer-windows/ went red for example.

llvm-svn: 230461
2015-02-25 04:39:21 +00:00