Commit Graph

4356 Commits

Author SHA1 Message Date
Peter Collingbourne 75e259ed95 [dfsan] Export dfsan_get_label_info function with C linkage.
llvm-svn: 225692
2015-01-12 20:40:30 +00:00
Viktor Kutuzov b4b05017cf [Msan] Fix use of mmap(MAP_ANONYMOUS) in the unit tests on FreeBSD
Differential Revision: http://reviews.llvm.org/D6929

llvm-svn: 225688
2015-01-12 20:18:38 +00:00
Viktor Kutuzov 6aba5098fd [Msan] Fix tests reading /proc files on FreeBSD
Differential Revision: http://reviews.llvm.org/D6926

llvm-svn: 225686
2015-01-12 20:15:33 +00:00
Timur Iskhodzhanov 00ede84084 [ASan] Move the shadow on Windows 32-bit from 0x20000000 to 0x40000000
llvm-svn: 225641
2015-01-12 17:38:58 +00:00
Evgeniy Stepanov 3f2e761826 [asan] Fix uninit in coverage.
pc_fd was not initialized to (-1) on some code paths, resulting in the program
erroneously closing stdin when reinitializing coverage.

llvm-svn: 225637
2015-01-12 17:13:20 +00:00
Ehsan Akhgari d918614586 Fix two extra semicolon warnings
Reviewers: timurrrr

Subscribers: llvm-commits

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

llvm-svn: 225635
2015-01-12 17:03:02 +00:00
Jay Foad 335c08e56c [ASan] Handle SIGBUS on Linux.
Summary:
On Linux in some situations we can get SIGBUS instead of SIGSEGV on
stack overflow, so asan should handle SIGBUS as well as SIGSEGV.

https://code.google.com/p/address-sanitizer/issues/detail?id=369

Reviewers: samsonov, glider

Reviewed By: glider

Subscribers: glider, llvm-commits

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

llvm-svn: 225630
2015-01-12 13:46:37 +00:00
Roman Divacky 0c9c0c5a6d Add FreeBSD support for __clear_cache.
llvm-svn: 225610
2015-01-11 18:21:11 +00:00
Alexey Samsonov 95674c8181 Remove AsanInterceptsSignal in favor of (equivalent) IsDeadlySignal.
llvm-svn: 225556
2015-01-09 23:03:31 +00:00
Kostya Serebryany 96fc9a2537 [sanitizer] use the right memory order
llvm-svn: 225546
2015-01-09 21:01:34 +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
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 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
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 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
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
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
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 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
Evgeniy Stepanov 300d29a75d [asan] Disable __sanitizer_cov_dump registration on Windows.
Looks like we can't use atexit() during ASan initialization on Windows.

llvm-svn: 224839
2014-12-25 15:11:00 +00:00
Evgeniy Stepanov be9a53fec6 [asan] Allow enabling coverage at activation.
llvm-svn: 224838
2014-12-25 14:26:45 +00:00
Dmitry Vyukov bda655004e tsan: fix trace initialization during thread id reuse
The current code leaves the first event in the trace part uninitialized
(from the previous thread). It can cause unpredictable behavior
during stack/mutexset restoration.
Initialize the first event to a fake harmless memory access.

llvm-svn: 224834
2014-12-25 10:32:25 +00:00
Evgeniy Stepanov cb2f6d4314 [asan] Support ASAN_ACTIVATION_OPTIONS.
This is mostly useful for testing, as the only other way of specifying
activation options (Android system property) is system-wide and affects
concurrently running tests.

llvm-svn: 224824
2014-12-24 16:58:50 +00:00
Timur Iskhodzhanov ced288f822 [ASan/Win] Bandaid fix for PR22025 -- deadlocks when creating suspended threads
llvm-svn: 224823
2014-12-24 16:14:16 +00:00
Evgeniy Stepanov 5a09b2cdeb [sanitizer] Disable InternalMmapWithOffset test on OSX.
llvm-svn: 224822
2014-12-24 13:59:35 +00:00