Commit Graph

5845 Commits

Author SHA1 Message Date
Reid Kleckner 4ca630be18 Fixup stale comment about supported OSs
llvm-svn: 245089
2015-08-14 20:01:27 +00:00
Reid Kleckner 14b7dde85f Move ASAN_OPTIONS setting from compile command to run command, fixes test on posix
llvm-svn: 245079
2015-08-14 18:29:00 +00:00
Reid Kleckner 89d994367a [windows] Fix or XFAIL remaining portable test failures and enable them
Summary:
This involved various fixes:

- Move a test that uses ulimit to Posix.

- Add a few "REQUIRES: shell" lines to tests using backtick subshell
  evaluation.

- The MSVC CRT buffers stdio if the output is a pipe by default. Some
  tests need that disabled to avoid interleaving test stdio with asan
  output.

- MSVC headers provide _alloca instead of alloca (go figure), so add a
  portability macro to the two alloca tests.

- XFAIL tests that rely on accurate symbols, we need to pass more flags
  to make that work.

- MSVC's printf implementation of %p uses upper case letters and doesn't
  add 0x, so do that manually.

- Accept "SEGV" or "access-violation" reports in crash tests.

Reviewers: samsonov

Subscribers: tberghammer, danalbert, llvm-commits, srhines

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

llvm-svn: 245073
2015-08-14 17:39:48 +00:00
Naomi Musgrave 0e7ac9ab2b Removed xfail, since test is passing in line with expanded dtor sanitizing functionality
Summary: Fixed test in response to buildbot failures from last night.

Reviewers: eugenis, kcc

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

llvm-svn: 244952
2015-08-13 20:54:05 +00:00
Chris Bieneman 361231ecd5 [CMake] Add experimental support for building compiler-rt for iOS
Summary:
This is a reunification of three separate reviews D11073, D11082, D11083.

Having them separate was not constructive even though the patches were smaller because it led to fragmented conversations, and this is really all about one change.

This patch incorporates feedback from samsonov, and refactors the hacky darwin code out of the root CMakeLists.txt and int config-ix.cmake.

Reviewers: zaks.anna, bogner, kubabrecka, chandlerc, samsonov

Subscribers: jevinskie, filcab, llvm-commits

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

llvm-svn: 244948
2015-08-13 20:38:16 +00:00
Alexey Samsonov ff1ca4af4b [UBSan] Enable 'help' option output, report unrecognized flags
Summary:
Let UBSan output flag description if 'help' options is provided.
Report unrecognized flags if verbosity mode is turned on.

Patch by Svetlana Ryabkova!

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

llvm-svn: 244946
2015-08-13 20:34:00 +00:00
Reid Kleckner afbb1a9523 Add more error logging to win/asan
llvm-svn: 244940
2015-08-13 20:10:54 +00:00
Reid Kleckner e4fabc9a87 Same fix as r244908 for sanitizer_win.cc instead of asan_win.cc
I forgot to audit lib/sanitizer_common for the same issue.  This fixes
writing out coverage files on exit.

llvm-svn: 244910
2015-08-13 16:40:54 +00:00
Reid Kleckner dd7b4406d1 Fix installation of the unhandled exception filter with r244767
Apparently /Zc:inline causes static globals in custom sections to be
discarded if they are unreferenced.

llvm-svn: 244908
2015-08-13 16:37:28 +00:00
Daniel Jasper 166d516603 Revert "Removed xfail, since test is passing in line with expanded dtor sanitizing functionality"
Still breaking the bot:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/19678/steps/ninja%20check-msan/logs/stdio

llvm-svn: 244873
2015-08-13 07:57:32 +00:00
Reid Kleckner 7d0f22e558 [windows] Fix deadlock on mmap failure due to CHECK recursion
Summary:
Printing a stacktrace acquires a spinlock, and the sanitizer spinlocks
aren't re-entrant. Avoid the problem by reusing the logic we already
have on Posix.

This failure mode is already exercised by the existing mmap_limit_mb.cc
test case. It will be enabled in a forthcoming change, so I didn't add
standalone tests for this change.

Reviewers: samsonov

Subscribers: llvm-commits

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

llvm-svn: 244840
2015-08-12 23:55:38 +00:00
Reid Kleckner 85220d0218 Use %env_asan_opts= substitution instead of 'env ASAN_OPTIONS=$ASAN_OPTIONS'
Summary:
The lit internal shell is used by default on Windows, and it does not
support bash variable expansion. Because bash variable expansion
interacts with tokenization, it is prohibitively difficult to make the
existing lit shell do general shell variable expansion.

The most common use of shell variables in the asan tests is to add
options to the default set of options set by lit.cfg. We can avoid the
need for variable expansion with a substitution that expands to 'env
ASAN_OPTIONS=<defaults:>'.

This has the side benefit of shortening the RUN lines, so it seemed
better than implementing limited variable expansion in lit.

Reviewers: samsonov, filcab

Subscribers: llvm-commits

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

llvm-svn: 244839
2015-08-12 23:50:12 +00:00
Reid Kleckner 3f3af2cf74 [windows] Always use the lit shell on Windows, even if bash is present
Summary:
This is consistent with LLVM and Clang. The lit shell isn't a complete
bash implementation, but its behavior is more easily reproducible.  This
fixes some ubsan test failures.

One ubsan test requires a shell currently, so I added "REQUIRES: shell",
and the other doesn't work on Windows because it prints a stack trace
and uses a linker that doesn't support DWARF. We can fix it eventually
through other means.

Reviewers: samsonov, pcc

Subscribers: yaron.keren, filcab, llvm-commits

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

llvm-svn: 244837
2015-08-12 23:49:52 +00:00
Reid Kleckner f787cdd031 Combine helper file into main test file with ifdefs
Keeping tests isolated to a single file is nice, and it was suggested in
post-commit review for r244827.

llvm-svn: 244833
2015-08-12 23:24:41 +00:00
Reid Kleckner e7ffbffaef Move tests that use unistd.h and pthread.h to TestCases/Posix
llvm-svn: 244827
2015-08-12 22:58:56 +00:00
Naomi Musgrave 93520f09c8 Removed xfail, since test is passing in line with expanded dtor sanitizing functionality
Summary: Fixed test in response to buildbot failures from last night.

Reviewers: eugenis, kcc

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

llvm-svn: 244818
2015-08-12 21:31:27 +00:00
Rafael Espindola cc45ee9a63 Try to fix the MSVC build now that we use /Zc:inline.
Thanks to Majnemer for the help.

llvm-svn: 244786
2015-08-12 18:09:44 +00:00
Daniel Jasper c2207c2791 Revert "Revised test to pass under updated dtor callback implementation"
This breaks the buildbot:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/19656

llvm-svn: 244724
2015-08-12 08:13:39 +00:00
Naomi Musgrave e9971acc0c Revised test to pass under updated dtor callback implementation
Summary: New implementation for dtor sanitizer callback poisons only class members, and emits poisoning callback before base dtor invoked.

Reviewers: eugenis, kcc

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

Explicit dtor invocation

llvm-svn: 244709
2015-08-12 01:15:28 +00:00
Chris Bieneman ba325eaa4c NFC. Fixing a red squiggly line in my editor.
llvm-svn: 244699
2015-08-11 23:31:43 +00:00
Reid Kleckner c1cd8dd4de Revert the rest of r244634, since it breaks the standalone build
compiler-rt can apparently be built without an installed copy of LLVM,
so we can't call its cmake code.

llvm-svn: 244647
2015-08-11 18:43:13 +00:00
Daniel Sanders 1f4bd3dd89 [ubsan][mips] Revise r243384 to avoid special casing big-endian mips.
Account for the case when uptr is 32-bit instead of trying to fix this case
using the little endian path.

llvm-svn: 244646
2015-08-11 18:40:02 +00:00
Reid Kleckner 0e58a9d82b Include sanitizer_posix.h to try to fix the mac build
Linux must pick it up transitively.

llvm-svn: 244645
2015-08-11 18:29:32 +00:00
Reid Kleckner 269d406a9d [windows] Use lld-link instead of lld-link2, the latter no longer exists
The test passed for me locally because I had a stale copy of
lld-link2.exe.

llvm-svn: 244638
2015-08-11 17:36:09 +00:00
Reid Kleckner b5093187f9 Revert part of the last cmake change, it broke configuring with libcxx on Linux for me
llvm-svn: 244635
2015-08-11 17:22:06 +00:00
Reid Kleckner d3bb924410 [cmake] Handle external source for lld and libcxx
As requested in post-commit review of r244549.

llvm-svn: 244634
2015-08-11 17:18:23 +00:00
Reid Kleckner 46ed25e199 [windows] Remove CHECK for strdup symbol that comes from the CRT
llvm-symbolizer isn't symbolizing it for some reason. I'll investigate.

llvm-svn: 244629
2015-08-11 16:56:26 +00:00
Reid Kleckner 9aec282de2 Speculative fix for Mac build
llvm-svn: 244623
2015-08-11 16:30:27 +00:00
Reid Kleckner 7d9e1e1259 [Windows] Use llvm-symbolizer before using dbghelp
Summary:
llvm-symbolizer understands both PDBs and DWARF, so it's a better bet if
it's available. It prints out the function parameter types and column
numbers, so I needed to churn the expected test output a bit.

This makes most of the llvm-symbolizer subprocessing code
target-independent. Pipes on all platforms use fd_t, and we can use the
portable ReadFromFile / WriteToFile wrappers in symbolizer_sanitizer.cc.
Only the pipe creation and process spawning is Windows-specific.

Please check that the libcdep layering is still correct. I don't know
how to reproduce the build configuration that relies on that.

Reviewers: samsonov

Subscribers: llvm-commits

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

llvm-svn: 244616
2015-08-11 15:51:40 +00:00
Filipe Cabecinhas 7317de6c15 [compiler-rt] Add SourceLocations for float_cast_overflow data.
Summary:
Compiler-rt part of http://reviews.llvm.org/D11757
I ended up making UBSan work with both the old version and the new
version of the float_cast_overflow data (instead of just erroring with
the previous version). The old version will try to symbolize its caller.

Now we compile the float_cast_overflow tests without -g, and make sure
we have the source file+line+column.

If you think I'm trying too hard to make sure we can still use both
versions, let me know.

Reviewers: samsonov, rsmith

Subscribers: llvm-commits

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

llvm-svn: 244567
2015-08-11 04:19:24 +00:00
Reid Kleckner 45ebaf1840 [cmake] Hoist check for LLD sources up into root CMakeLists.txt
We will use this for ASan on Windows soon. When the ELF port of LLD
matures, we can add other sanitizer integration tests to make sure they
work with LLD.

llvm-svn: 244549
2015-08-11 00:33:07 +00:00
Reid Kleckner a0f78fef74 [sanitizers] Use portable file read/write wrappers on process pipes
This fixes a minor error checking bug around calling
internal_read/write, and makes the code more portable for D11791.

llvm-svn: 244546
2015-08-11 00:30:22 +00:00
Reid Kleckner e96833e648 [Windows] Implement FileExists, ReadFromFile, and FindPathToBinary
Summary: These are needed to talk to llvm-symbolizer on Windows.

Reviewers: samsonov

Subscribers: llvm-commits

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

llvm-svn: 244533
2015-08-10 23:40:27 +00:00
Reid Kleckner c0120a3000 [Windows] Relax test case patterns to allow parameter lists
llvm-symbolizer will print parameter types.  Split out from D11791.

NFC

llvm-svn: 244522
2015-08-10 22:43:04 +00:00
Naomi Musgrave 8759aa3db1 test case for poisoning trivial members
Summary:
A virtual base class and derived class should only poison their
respective members upon destruction. In particular, trivial members should
be poisoned directly, non-trivial members should be poisoned by their
respective destructors, and references to non-trivial members should be
poisoned.

Reviewers: eugenis, kcc

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

Test case avoids casting to access members

Run configurations to reflect expected runtime failure on assertions.

Simplified access to internal members.

Updated internal member structure of base.

Revised assert in main to verify successful poisoning after dtor.

Verify address of pointer is poisoned.

Fixed assert err.

Cleaned up test by removing extraneous prints, asserts.

llvm-svn: 244521
2015-08-10 22:39:09 +00:00
Filipe Cabecinhas 2bbdbcb835 Fix typo.
llvm-svn: 244475
2015-08-10 18:26:29 +00:00
David Blaikie 57add8ddfb -Wdeprecated: Use noexcept rather than throw() where supported
Summary: I've copy/pasted the LLVM_NOEXCEPT definition macro goo from LLVM's Compiler.h. Is there somewhere I should put this in Compiler RT? Is there a useful header to define/share things like this?

Reviewers: samsonov

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

llvm-svn: 244453
2015-08-10 15:24:22 +00:00
Renato Golin 86474c7a1a [ASAN/AArch64] Disable forkpty tests until we can fix them
Reported in PR24400. Disable until it works, so we can keep the rest
tested and green.

llvm-svn: 244398
2015-08-08 15:47:17 +00:00
Evgeniy Stepanov aa91588b6c [asan] Try different values of the shadow gap start.
The number of unaccessible pages at the beginning of the address
space can differ between processes on the same machine. Try different
values at runtime to protect as much memory as possible.

llvm-svn: 244364
2015-08-07 22:38:44 +00:00
Evgeniy Stepanov 290d721070 [asan] Reduce shadow gap start on 32-bit Android.
This fixes an internal assertion failure when running out of
the address space in the large allocator.

llvm-svn: 244359
2015-08-07 21:17:46 +00:00
Renato Golin 827a40b944 [Compiler-RT] Disable TSAN on AArch64 temporarily
Until all problems with the buildbot can be identified and fixed.

llvm-svn: 244324
2015-08-07 15:41:43 +00:00
Renato Golin 2ab51bf13a [ASAN] Disable ManyThreadsTest in AArch64
This test was in an infinite loop in AArch64. We're investigating it
on PR24389, but I'm disabling it for now, so that we continue testing
everything else.

llvm-svn: 244316
2015-08-07 12:40:05 +00:00
Renato Golin 5da19695c5 [ASAN/AArch64] Make sure aarch64 is not stable-runtime
llvm-svn: 244263
2015-08-06 20:34:51 +00:00
Peter Collingbourne 01101b7b5f test: Use lld-link instead of lld-link2 as the LTO linker on Windows.
The old COFF linker has been removed and lld-link now refers to the new linker.

llvm-svn: 244243
2015-08-06 18:37:54 +00:00
Kostya Serebryany cc9fd3cbe9 [sanitizer] 2-nd attempt. Add the flag handle_sigfpe that is default true to handle SIGFPE crashes same as SIGSEV crashes, patch by Karl Skomski. This time the test is enabled only on x86-64 (it broke on ARM)
llvm-svn: 244234
2015-08-06 17:52:54 +00:00
Renato Golin 4ae2e1f575 Revert "[sanitizer] Add the flag handle_sigfpe that is default true to handle SIGFPE crashes same as SIGSEV crashes, patch by Karl Skomski"
This reverts commit r244136, it was breaking the ARM bots for too long. We should investigate it offline.

llvm-svn: 244210
2015-08-06 12:42:46 +00:00
Reid Kleckner 27dddfc118 Add flag to request codeview debug info on Windows
Needed after fixing PR22032.

llvm-svn: 244162
2015-08-05 22:48:26 +00:00
Kostya Serebryany ce1799a83f [sanitizer] Add the flag handle_sigfpe that is default true to handle SIGFPE crashes same as SIGSEV crashes, patch by Karl Skomski
llvm-svn: 244136
2015-08-05 21:19:11 +00:00
Renato Golin 12a7cdc3a0 [AArch64] Stable runtime required for proc maps test
llvm-svn: 244105
2015-08-05 19:45:26 +00:00
Alexey Samsonov 894d5821e7 [UBSan] Fix UBSan-vptr false positive.
Offset from vptr to the start of most-derived object can actually
be positive in some virtual base class vtables.

Patch by Stephan Bergmann!

llvm-svn: 244101
2015-08-05 19:35:46 +00:00