Commit Graph

5038 Commits

Author SHA1 Message Date
Kuba Brecka 1a03ccd848 [asan] Adding a regression test for https://code.google.com/p/address-sanitizer/issues/detail?id=368
llvm-svn: 225484
2015-01-09 00:26:45 +00:00
Kostya Serebryany 8cc4002df2 [asan] make a test consume 2x less RAM (we observe flaky bot failures that seem like OOMs)
llvm-svn: 225478
2015-01-08 23:37:09 +00:00
Alexey Samsonov a04ca22edf Fix memory leaks in GetListOfModules() users.
llvm-svn: 225472
2015-01-08 22:31:14 +00:00
Alexey Samsonov b40fd1b24e [Sanitizer] Remove the hardcoded limit of address ranges in LoadedModule.
This should fix https://code.google.com/p/address-sanitizer/issues/detail?id=368.

llvm-svn: 225469
2015-01-08 22:03:05 +00:00
Viktor Kutuzov e01a595dad [Sanitizers] Fix internal_lseek() to work on FreeBSD
Differential Revision: http://reviews.llvm.org/D6825

llvm-svn: 225443
2015-01-08 13:28:22 +00:00
Renato Golin ea56f08b3f XFAIL AArch64 UBsan test, just like ARM
llvm-svn: 225370
2015-01-07 20:03:47 +00:00
Kostya Serebryany 7ad02fca09 [asan] add flag quarantine_size_mb, deprecate quarantine_size
llvm-svn: 225337
2015-01-07 02:37:52 +00:00
Alexey Samsonov 7eba6dfdaa [TSan] Fix Go build.
llvm-svn: 225336
2015-01-07 02:12:41 +00:00
Alexey Samsonov 03499e920b [Sanitizer] Change the runtime flag representation.
This mirrors r225239 to all the rest sanitizers:
ASan, DFSan, LSan, MSan, TSan, UBSan.

Now the runtime flag type, name, default value and
description is located in the single place in the
.inc file.

llvm-svn: 225327
2015-01-07 00:38:00 +00:00
Kostya Serebryany 7e85a9216e [asan] add a flag soft_rss_limit_mb
llvm-svn: 225323
2015-01-06 23:53:32 +00:00
Alexey Samsonov 6239ebc1c2 [Sanitizer] Improve unit tests in COMPILER_RT_DEBUG=ON mode.
Propagate -DSANITIZER_DEBUG definition to unit tests.
Make sure unit tests depend on compiler-rt headers.

llvm-svn: 225298
2015-01-06 20:58:40 +00:00
Alexey Samsonov ea04032144 Use -DSANITIZER_DEBUG=1 if COMPILER_RT_DEBUG=ON, now that PR22083 is fixed.
llvm-svn: 225293
2015-01-06 20:25:34 +00:00
Kostya Serebryany 4e781371d1 [ubsan] disable coverage-levels.cc on darwin until we can investigate what's wrong there.
llvm-svn: 225281
2015-01-06 18:48:49 +00:00
Jay Foad a566693334 [asan] Bump the self-imposed stack limit from 128k to 256k. PowerPC64
Linux has 64k pages, so the old limit was only two pages. With ASLR the
initial sp might be right at the start of the second page, so the stack
will immediately grow down into the first page; and if you use all pages
of a limited stack then asan hits a kernel bug to do with how stack
guard pages are reported in /proc/self/maps:
http://lkml.iu.edu//hypermail/linux/kernel/1501.0/01025.html

We should still fix the underlying problems, but in the mean time this
patch makes the test work with 64k pages as well as it does with 4k
pages.

llvm-svn: 225261
2015-01-06 10:01:15 +00:00
Alexey Samsonov bdbdd3fd4e [Sanitizer] Use COMMON_FLAG macro to describe common runtime flags.
Summary:
Introduce a single place where we specify flag type, name, default
value, and description. This removes a large amount of boilerplate
and ensures we won't leave flags uninitialized.

Test Plan: regression test suite

Reviewers: kcc

Subscribers: llvm-commits

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

llvm-svn: 225239
2015-01-06 02:44:05 +00:00
Kostya Serebryany fb42a5a292 [ubsan] partially enable -fsanitize-coverage=N with ubsan. It will work as usual in most cases but will not dump coverage on error with -fno-sanitize-recover (that'll be a separate fix)
llvm-svn: 225234
2015-01-06 01:31:23 +00:00
Kostya Serebryany e02839b60f [asan/tracing] write the trace using a sequence of internal_write calls instead of just one (otherwise files of > 2Gb are trunkated). Also a minor adjustment to the trace collection.
llvm-svn: 225230
2015-01-06 01:11:23 +00:00
Nick Kledzik 83a2d8ec73 Add 64-bit multiply functions to iOS arm64 compiler-rt dylib
llvm-svn: 225226
2015-01-06 00:27:21 +00:00
Saleem Abdulrasool 6e6c1c3ef2 tests: correct builtins test if built under -mthumb on ARM
The clear_cache and enable_execute_stack tests attempt to memcpy the definition
of a function into a buffer before executing the function.  The problem with
this approach is that on some targets (ARM with thumb mode compilation, MIPS
with MIPS16 codegen or uMIPS), you would use a pointer which is incorrect (it
would be off-by-one) due to the ISA selection being encoded into the address.
This ensures that the function address is retrieved correctly in all cases.

llvm-svn: 225215
2015-01-05 21:54:50 +00:00
Alexey Samsonov df3aeb8e71 Remove TSAN_DEBUG in favor of SANITIZER_DEBUG.
llvm-svn: 225111
2015-01-03 04:29:12 +00:00
Alexey Samsonov 3b1885448a Replace DCHECK with DCHECK_LE where appropriate.
llvm-svn: 225110
2015-01-03 04:29:05 +00:00
Kostya Serebryany 0f53d9a2ee [asan/tracing] extend the test a bit more, simplify the tracing code, add a guard page to trace array, fix the trace IDs before dumping
llvm-svn: 225108
2015-01-03 02:07:58 +00:00
Kostya Serebryany 86ced092f4 [asan] extend coverage-tracing.cc test
llvm-svn: 225107
2015-01-03 01:41:11 +00:00
Kostya Serebryany d421db05bb [asan] simplify the tracing code, make it use the same guard variables as coverage
llvm-svn: 225103
2015-01-03 00:54:43 +00:00
Alexey Samsonov c426c337ed Revert "Revert r224736: "[Sanitizer] Make CommonFlags immutable after initialization.""
Fix test failures by introducing CommonFlags::CopyFrom() to make sure
compiler doesn't insert memcpy() calls into runtime code.

Original commit message:
Protect CommonFlags singleton by adding const qualifier to
common_flags() accessor. The only ways to modify the flags are
SetCommonFlagsDefaults(), ParseCommonFlagsFromString() and
OverrideCommonFlags() functions, which are only supposed to be
called during initialization.

llvm-svn: 225088
2015-01-02 21:28:37 +00:00
Chandler Carruth 6173e869eb Revert r224736: "[Sanitizer] Make CommonFlags immutable after initialization."
We've got some internal users that either aren't compatible with this or
have found a bug with it. Either way, this is an isolated cleanup and so
I'm reverting it to un-block folks while we investigate. Alexey and
I will be working on fixing everything up so this can be re-committed
soon. Sorry for the noise and any inconvenience.

llvm-svn: 225079
2015-01-02 09:59:38 +00:00
Rafael Espindola 0dfd240068 Avoid building compiler-rt with LTO.
During a LTO we still need to build a compiler_rt with regular object files
in the .a.

llvm-svn: 225049
2014-12-31 18:20:52 +00:00
Kostya Serebryany 77c5c1a66d [asan] fix coverage between fork() and exec(): reinitialize the guards after fork()
llvm-svn: 225016
2014-12-30 23:16:12 +00:00
Kostya Serebryany a7ee2734cf [asan] add flag coverage_pcs. When false, the coverage is not dumped as PCs. Useful e.g. if the user only needs coverage is bitset
llvm-svn: 225002
2014-12-30 19:55:04 +00:00
David Blaikie 63ac92ca28 Reapply debug info changes now that more precise column information is available.
(recommitting as the Clang patch is back in with the latest fix -
hopefully it sticks)

llvm-svn: 225001
2014-12-30 19:54:25 +00:00
Kostya Serebryany aa185bfc4b [asan] change _sanitizer_cov_module_init to accept int* instead of int**
llvm-svn: 224999
2014-12-30 19:29:28 +00:00
Timur Iskhodzhanov a023e06618 Follow-up to r224987: fix a lint warning
llvm-svn: 224988
2014-12-30 15:30:19 +00:00
Timur Iskhodzhanov 64fc8e4a5a [ASan/Win] Sort the list of modules when we fail to reserve the shadow memory range
llvm-svn: 224987
2014-12-30 14:44:12 +00:00
Alexey Samsonov 93c064968d Revert "UBSan: Teach isDerivedFromAtOffset and findBaseAtOffset about vbases"
This reverts commit r221445. This change leads to false positives
reports from -fsanitize=vptr. See original commit thread for more
details.

llvm-svn: 224972
2014-12-30 00:33:50 +00:00
David Blaikie b7373cd639 Revert "Reapply debug info changes now that r224385 has been recommitted to clang (in r224941)"
Asserting when building compiler-rt when using a gcc host compiler.
Reverting while I investigate.

This reverts commit r224942.

llvm-svn: 224969
2014-12-29 23:48:46 +00:00
Alexey Samsonov e585e738d4 Remove darwin_fat.mk.
Summary:
Its seems to be replaced by clang_darwin.mk in the Makefile-based
build, and is only referenced in unittest scripts, which are
broken for a long time now.

Test Plan: n/a

Reviewers: bob.wilson

Subscribers: llvm-commits

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

llvm-svn: 224946
2014-12-29 19:21:59 +00:00
David Blaikie 90b6344c56 Reapply debug info changes now that r224385 has been recommitted to clang (in r224941)
llvm-svn: 224942
2014-12-29 18:19:36 +00:00
Chandler Carruth 11fb7a49ae [cmake/multilib] Support multilib libdir suffixes by applying the
LLVM_LIBDIR_SUFFIX variable to one place in the cmake file.

This is all that I had to do to get everything from compiler-rt working
for me, but there may be more work required if folks are relying on more
parts of compiler-rt. Notably, I'm mostly using it for the sanitizers.

llvm-svn: 224928
2014-12-29 12:26:30 +00:00
Kuba Brecka c52f300698 [sanitizer-common] Fixing the ASan test build failure on OS X
The change in r224819 started using internal_unlink in a sanitizer_common unit test. For some reason, internal_unlink is not defined in sanitizer_mac.cc, fixing that.

llvm-svn: 224910
2014-12-29 02:18:59 +00:00
Daniel Jasper 1e8eafd6c8 Escape ? to silence GCC warning about trigraphs.
llvm-svn: 224863
2014-12-26 18:21:34 +00:00
Evgeniy Stepanov 9e609426a7 [sanitizer] Treat \r, \n, \t as flag separators.
llvm-svn: 224858
2014-12-26 16:09:15 +00:00
Evgeniy Stepanov ef0f244594 [asan] Fix possibly uninitialized coverage flag.
llvm-svn: 224857
2014-12-26 16:07:33 +00:00
Timur Iskhodzhanov a04b33b9de [ASan/Win] Add basic support for MemoryRangeIsAvailable and DumpProcessMap to make it easier to debug startup shadow mapping failures
llvm-svn: 224856
2014-12-26 14:28:32 +00:00
Evgeniy Stepanov 103084691d [asan] Bump coverage size limit on 32-bit platforms.
This increases the limit from 4M locations to 16M, reserving
64Mb virtual memory. Chrome has >5M unique coverage locations with coverage=3.

llvm-svn: 224855
2014-12-26 13:54:11 +00:00
Evgeniy Stepanov da02effd9e [asan] Extend coverage test.
llvm-svn: 224854
2014-12-26 12:51:31 +00:00
Evgeniy Stepanov 05dc4be0dc [asan] Allow enabling coverage at activation.
This is a re-commit of r224838 + r224839, previously reverted in r224850.
Test failures were likely (still can not reproduce) caused by two lit tests
using the same name for an intermediate build target.

llvm-svn: 224853
2014-12-26 12:32:32 +00:00
Timur Iskhodzhanov b8373bc119 [ASan/Win] Suppress error messaging when Abort() is called
This will prevent ASan bots from hanging / timing out

llvm-svn: 224852
2014-12-26 12:25:54 +00:00
Evgeniy Stepanov f8c7e25560 Revert r224838, r224839.
Flaky failures on the build bots.

llvm-svn: 224850
2014-12-26 10:19:56 +00:00
Evgeniy Stepanov b723834d82 [sanitizer] Tweak sancov.py output.
llvm-svn: 224841
2014-12-25 16:03:24 +00:00
Evgeniy Stepanov 01b922d9f2 [sanitizer] sancov.py: print status to stderr
llvm-svn: 224840
2014-12-25 16:01:09 +00:00