Commit Graph

5828 Commits

Author SHA1 Message Date
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
Kostya Serebryany b6804dbf43 [sanitizer] fix the Mac build (hopefully)
llvm-svn: 244099
2015-08-05 18:56:42 +00:00
Renato Golin 4481fe0f1f [AArch64] Fixes broken bot fue to TSAN patch
Patch by Adhemerval Zanella.

llvm-svn: 244088
2015-08-05 18:34:20 +00:00
Kostya Serebryany dd8b3952b8 [libFuzzer] add weak hooks for strcmp
llvm-svn: 244083
2015-08-05 18:20:54 +00:00
Kostya Serebryany 823e85c37e [libFuzzer/DFSan] add more __sanitizer callbacks to dfsan blacklist
llvm-svn: 244082
2015-08-05 18:20:15 +00:00
Hans Wennborg 92e6412f29 Try to fix sanitizer_win.cc compile error on 64-bit after r243895
llvm-svn: 244077
2015-08-05 17:55:26 +00:00
Adhemerval Zanella d7984710ae [tsan] Enable tsan for aarch64
This patch enabled TSAN for aarch64 with 39-bit VMA layout.  As defined by
tsan_platform.h the layout used is:

0000 4000 00 - 0200 0000 00: main binary
2000 0000 00 - 4000 0000 00: shadow memory
4000 0000 00 - 5000 0000 00: metainfo
5000 0000 00 - 6000 0000 00: -
6000 0000 00 - 6200 0000 00: traces
6200 0000 00 - 7d00 0000 00: -
7d00 0000 00 - 7e00 0000 00: heap
7e00 0000 00 - 7fff ffff ff: modules and main thread stack

Which gives it about 8GB for main binary, 4GB for heap and 8GB for
modules and main thread stack.

Most of tests are passing, with the exception of:

 * ignore_lib0, ignore_lib1, ignore_lib3 due a kernel limitation for
   no support to make mmap page non-executable.

 * longjmp tests due missing specialized assembly routines.

These tests are xfail for now.

The only tsan issue still showing is:

  rtl/TsanRtlTest/Posix.ThreadLocalAccesses

Which still required further investigation.  The test is disable for
aarch64 for now.

llvm-svn: 244055
2015-08-05 15:17:59 +00:00
Adhemerval Zanella 975998bf6a [asan] Enable asan for aarch64
This patch enables asan for aarch64/linux.  It marks it as 'unstable-release',
since some tests are failing due either kernel missing support of non-executable
pages in mmap or environment instability (infinite loop in juno reference
boards).

It sets decorate_proc_maps test to require stable-release, since the test expects
the shadow memory to not be executable and the support for aarch64 is only
added recently by Linux (da141706aea52c1a9 - 4.0).

It also XFAIL static_tls test for aarch64 linker may omit the __tls_get_addr call
as a TLS optimization.

llvm-svn: 244054
2015-08-05 15:13:33 +00:00
Tanya Lattner bba51dc31f Update references to new lists.llvm.org mailing lists.
llvm-svn: 244002
2015-08-05 03:58:00 +00:00
Naomi Musgrave 2551b62931 Runtime check of poisoning derived class members.
Summary: Simple test case to verify that an instance of a derived class with virtual base is properly poisoned

Reviewers: eugenis, kcc

Subscribers: cfe-commits

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

modified test to be more concise, and check the local pointer to the destroyed object

revised test to not examine padding- only explicit object members

llvm-svn: 243913
2015-08-03 23:01:19 +00:00
Reid Kleckner 646386e779 [asan] Print VAs instead of RVAs for module offsets on Windows
Summary:
This is consistent with binutils and ASan behavior on other platforms,
and makes it easier to use llvm-symbolizer with WinASan. The
--relative-address flag to llvm-symbolizer is also no longer needed.

An RVA is a "relative virtual address", meaning it is the address of
something inside the image minus the base of the mapping at runtime.

A VA in this context is an RVA plus the "preferred base" of the module,
and not a real runtime address. The real runtime address of a symbol
will equal the VA iff the module is loaded at its preferred base at
runtime.

On Windows, the preferred base is stored in the ImageBase field of one
of the PE file header, and this change adds the necessary code to
extract it. On Linux, this offset is typically included in program and
section headers of executables.

ELF shared objects typically use a preferred base of zero, meaning the
smallest p_vaddr field in the program headers is zero. This makes it so
that PIC and PIE module offsets come out looking like RVAs, but they're
actually VAs. The difference between them simply happens to be zero.

Reviewers: samsonov, majnemer

Subscribers: llvm-commits

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

llvm-svn: 243895
2015-08-03 19:51:18 +00:00
Kuba Brecka fe17cee960 [asan] Fix dyld version detection on OS X
We currently have a dyld check in DyldNeedsEnvVariable that detects whether we are on a new OS X (10.11+) where we don't need to re-exec. For iOS simulator, we have a dlsym() hack that checks for a specific symbol, but this turns out to be fragile and problematic, because dlsym can sometimes call malloc(), which is not a good idea this early in the process runtime.

Let's instead of this do a direct comparison of dyld's version, which is exported in a public symbol `dyldVersionNumber`.

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

llvm-svn: 243879
2015-08-03 14:48:59 +00:00
Evgeniy Stepanov c86e7cfee9 [asan] Link tests with ld.gold on Android.
ld.bfd fails to find dependencies of asan runtime library w/o an
extra -rpath-link pointing to usr/lib under the sysroot. Gold does
not have this problem.

llvm-svn: 243802
2015-08-01 00:01:23 +00:00
Alexey Samsonov 25ac9311d0 [ASan] Fix two tests on FreeBSD: alloca.h is missing there.
llvm-svn: 243800
2015-07-31 23:57:06 +00:00
Alexey Samsonov 1e156011d1 [Sanitizer] Try to fix sanitizer_libc_test on FreeBSD.
llvm-svn: 243797
2015-07-31 23:02:51 +00:00
Evgeniy Stepanov fef29821a7 [asan] Fix wrong __ANDROID_API__ preprocessor condition.
This fixes report symbolization on L devices when building for API
level 21 or 22.

llvm-svn: 243787
2015-07-31 21:35:15 +00:00
Alexey Samsonov 356ac539c3 [CMake] Don't build libc++ with MSan-with-calls instrumentation.
Instead, refactor the build rules so that we build libc++ with MSan for
each supported architecture.

llvm-svn: 243785
2015-07-31 21:15:34 +00:00
Filipe Cabecinhas 698e8cf845 [UBSan] Test: Move coverage-levels.cc out of Linux directory
Summary:
This test is working on other platforms.

Reviewers: samsonov, emaste

Subscribers: llvm-commits

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

llvm-svn: 243771
2015-07-31 18:18:07 +00:00