summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
Commit message (Collapse)AuthorAgeFilesLines
* [sanitizer] Tweak sancov.py output.Evgeniy Stepanov2014-12-251-1/+1
| | | | llvm-svn: 224841
* [sanitizer] sancov.py: print status to stderrEvgeniy Stepanov2014-12-251-1/+1
| | | | llvm-svn: 224840
* [asan] Disable __sanitizer_cov_dump registration on Windows.Evgeniy Stepanov2014-12-251-0/+2
| | | | | | Looks like we can't use atexit() during ASan initialization on Windows. llvm-svn: 224839
* [asan] Allow enabling coverage at activation.Evgeniy Stepanov2014-12-258-68/+100
| | | | llvm-svn: 224838
* tsan: fix trace initialization during thread id reuseDmitry Vyukov2014-12-251-7/+5
| | | | | | | | | 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
* [asan] Support ASAN_ACTIVATION_OPTIONS.Evgeniy Stepanov2014-12-241-0/+6
| | | | | | | | 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
* [ASan/Win] Bandaid fix for PR22025 -- deadlocks when creating suspended threadsTimur Iskhodzhanov2014-12-241-15/+13
| | | | llvm-svn: 224823
* [sanitizer] Disable InternalMmapWithOffset test on OSX.Evgeniy Stepanov2014-12-241-1/+1
| | | | llvm-svn: 224822
* [sanitizer] Fix off-by-8x in direct coverage.Evgeniy Stepanov2014-12-241-2/+5
| | | | | | File mapping offset was calculated by offsetting (uptr *) instead of (char *). llvm-svn: 224821
* [sanitizer] Disable InternalMmapWithOffset test on Windows.Evgeniy Stepanov2014-12-241-0/+3
| | | | llvm-svn: 224820
* [sanitizer] mmap2 syscall works with 4096-byte units instead of bytes.Evgeniy Stepanov2014-12-242-21/+51
| | | | | | Ouch. llvm-svn: 224819
* [asan] change the coverage collection scheme so that we can easily emit ↵Kostya Serebryany2014-12-234-24/+70
| | | | | | coverage for the entire process as a single bit set, and if coverage_bitset=1 actually emit that bitset llvm-svn: 224789
* [asan] Fix line >80 chars.Evgeniy Stepanov2014-12-231-1/+2
| | | | llvm-svn: 224763
* [asan] Better error message in coverage.Evgeniy Stepanov2014-12-231-2/+2
| | | | llvm-svn: 224762
* tsan: fix styleDmitry Vyukov2014-12-231-3/+2
| | | | | | Usually we roll the variable declaration into the condition in cases like this. llvm-svn: 224755
* [Sanitizer] Make CommonFlags immutable after initialization.Alexey Samsonov2014-12-227-33/+57
| | | | | | | | | | | | | | | | | | | Summary: 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. Test Plan: regression test suite Reviewers: kcc, eugenis, glider Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6741 llvm-svn: 224736
* [Msan] Fix msan_test.cc inclusions to build the unit tests on FreeBSDViktor Kutuzov2014-12-221-6/+10
| | | | | | Differential Revision: http://reviews.llvm.org/D6757 llvm-svn: 224724
* AddressSanitizer: Abort after failed exec() and get rid of the allow_reexec ↵Kuba Brecka2014-12-224-17/+8
| | | | | | | | | | | | | | | | ASan flag As mentioned in https://code.google.com/p/address-sanitizer/issues/detail?id=365, when the re-exec that adds the required DYLD_INSERT_LIBRARIES variable fails, ASan currently continues to run, but things are broken (some memory can be overwritten, interceptors don't work, ...). This patch aborts if the execv() fails and prints an error message that DYLD_INSERT_LIBRARIES is required. It also removes the "alllow_reexec" flag, since using it causes the same issues. Reviewed at http://reviews.llvm.org/D6752 llvm-svn: 224712
* AddressSanitizer: Properly handle dispatch_source_set_cancel_handler with aKuba Brecka2014-12-221-0/+4
| | | | | | | | | | | | | | | | | | | | | NULL handler Per https://developer.apple.com/library/mac/documentation/Performance/Reference/GCD_libdispatch_Ref/index.html, the dispatch_source_set_cancel_handler() API *can* be called with a NULL handler. In that case, the libdispatch removes an already existing cancellation handler, if there was one. ASan's interceptor always creates a new block that always tries to call the original handler. In case the original block is NULL, a segmentation fault happens. Let's fix that by not wrapping a NULL-block at all. It looks like all the other libdispatch APIs (which we intercept) do *not* allow NULL. So it's really only the dispatch_source_set_cancel_handler one that needs this fix. Reviewed at http://reviews.llvm.org/D6747 llvm-svn: 224711
* [ASan] Fix the logic that decides whether we need to spawn a new ↵Alexander Potapenko2014-12-221-3/+3
| | | | | | llvm-symbolizer in asan_symbolize.py llvm-svn: 224710
* [Sanitizers] Intercept wcsnrtombs() on FreeBSDViktor Kutuzov2014-12-221-1/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D6755 llvm-svn: 224709
* [Msan] Fix uname() interception on FreeBSDViktor Kutuzov2014-12-221-4/+19
| | | | | | Differential Revision: http://reviews.llvm.org/D6738 llvm-svn: 224708
* tsan: reset stack0 in the first partition of thread traceDmitry Vyukov2014-12-221-1/+4
| | | | | | | stack0/mset0 contained bogus values from the previous thread that used the same id llvm-svn: 224702
* tsan: fix debugging outputDmitry Vyukov2014-12-221-2/+2
| | | | llvm-svn: 224701
* [Sanitizers] Intercept snprintf_l() on FreeBSDViktor Kutuzov2014-12-224-0/+56
| | | | | | Differential Revision: http://reviews.llvm.org/D6418 llvm-svn: 224700
* [Sanitizers] Intercept wordexp on FreeBSDViktor Kutuzov2014-12-221-1/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D6737 llvm-svn: 224699
* tsan: add acquire/release functions to java interfaceDmitry Vyukov2014-12-222-0/+38
| | | | | | they are required to handle synchronization on volatile/final fields llvm-svn: 224697
* [sanitizer] fix a performance regression in sanitizer coverage: move a small ↵Kostya Serebryany2014-12-203-19/+21
| | | | | | perf-critical function to a header. ALso set the coverage guard to 1 before the early return from CoverageData::Add llvm-svn: 224660
* [sanitizer] initialize two flas in SetCommonFlagsDefaultsKostya Serebryany2014-12-191-0/+2
| | | | llvm-svn: 224645
* [Sanitizer] Refactor CommonFlags interface. NFC.Alexey Samsonov2014-12-1910-96/+125
| | | | | | | | | | Add CommonFlags::SetDefaults() and CommonFlags::ParseFromString(), so that this object can be easily tested. Enforce that ParseCommonFlagsFromString() and SetCommonFlagsDefaults() work only with singleton CommonFlags, shared across all sanitizer runtimes. llvm-svn: 224617
* [ASan] Change activation strategy.Alexey Samsonov2014-12-197-36/+59
| | | | | | | | | | | Now ASan deactivation doesn't modify common or ASan-specific runtime flags. Flags stay constant after initialization, and "deactivation" instead stashes initialized runtime state, and deactivates the runtime. Activation then just restores the original state (possibly, overriden by some activation flags provided in system property on Android). llvm-svn: 224614
* [Sanitizer] Make Quarantine::Init slightly safer.Alexey Samsonov2014-12-191-6/+10
| | | | | | | ASan Quarantine can be reinitialized at activation/deactivation. Make max_size_/min_size_ atomic. llvm-svn: 224613
* [ASan] Introduce AllocatorOptions to configure allocator behavior.Alexey Samsonov2014-12-194-43/+81
| | | | | | | | | | | | | | | | | | | Summary: Reduce the dependency of allocator code on runtime flags. Instead, pass a bunch of options that configure allocator behavior at initialization or re-initialization. That would allow us to cleaner modify allocator behavior during a program execution when ASan is activated or de-activated. Test Plan: regression test suite Reviewers: kcc Subscribers: llvm-commits, eugenis Differential Revision: http://reviews.llvm.org/D6711 llvm-svn: 224605
* [ASan] Restrict the set of flags overriden at activation.Alexey Samsonov2014-12-191-26/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Change the way ASan flag parsing is performed at activation: instead of overwriting all ASan and common flags from the activation string, ASan will now only override a handful of whitelisted flags. This is a first step towards making runtime flags immutable after initialization. I plan to re-factor the activation stragegy to the following one: - Parse commandline flags. Override the defaults from compile definition, env var, etc. Flags are immutable at this point. - Initiailize the runtime from commandline flags. - If ASan needs to be started deactivated, stash the runtime state in "asan_deactivated_flags" and deactivate the runtime. - When ASan is activated, override "asan_deactivated_flags" with activation flags, and use it to re-activate the runtime. Test Plan: regression test suite Reviewers: eugenis, kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6709 llvm-svn: 224601
* [ASan] Move flag validation from ParseFlagsFromString() to InitializeFlags().Alexey Samsonov2014-12-191-5/+5
| | | | llvm-svn: 224600
* builtins: rely on the compiler for user label prefixSaleem Abdulrasool2014-12-191-12/+6
| | | | | | | | | | clang does not like the definition of builtins. In order to work around this, we use a SUN CC to redefine the generated name. However, this requires that we account for the user label prefix. Rather than hard coding that into the file, rely on the compiler to tell us the information and use the preprocessor to generate the name as we do in the assembly routines. NFC. llvm-svn: 224597
* [sanitizer] Rename InitIfLinkerInitialized to InitLinkerInitialized.Sergey Matveev2014-12-192-9/+9
| | | | llvm-svn: 224577
* tsan: intercept closedirDmitry Vyukov2014-12-191-0/+9
| | | | llvm-svn: 224575
* tsan: disable __tls_get_addr interceptorDmitry Vyukov2014-12-182-0/+16
| | | | | | see the added comments for details, it's messy llvm-svn: 224531
* tsan: fix data races between signal handler and sigactionDmitry Vyukov2014-12-181-17/+32
| | | | | | | signal handler reads sa_sigaction when a concurrent sigaction call can modify it as the result in could try to call SIG_DFL or a partially overwritten function pointer llvm-svn: 224530
* [Sanitizer] Fix GetRSS on Linux with non-4k pagesJay Foad2014-12-181-2/+2
| | | | | | | | | | | | | | | | | Summary: The numbers in /proc/self/statm are in pages, not in fixed 4k units. This fixes Linux/hard_rss_limit_mb_test.cc on my PowerPC64 box which has 64k pages. Reviewers: kcc, willschm Reviewed By: willschm Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6717 llvm-svn: 224522
* tsan: fix deadlock reportingDmitry Vyukov2014-12-181-0/+1
| | | | | | | currently deadlock detector reports effectively random stacks in report after flush because it looks at old edges with wrong stacks llvm-svn: 224519
* tsan: fix failing CHECK In deadlock detectorDmitry Vyukov2014-12-181-1/+4
| | | | | | and re-enable the test llvm-svn: 224518
* tsan: don't crash with NULL deref during reportingDmitry Vyukov2014-12-181-1/+3
| | | | | | | | tctx==NULL crash observed during deadlock reporting. There seems to be some bugs in the deadlock detector, but it is still useful to be more robust during reporting. llvm-svn: 224508
* tsan: disable flaky debug checkDmitry Vyukov2014-12-181-2/+3
| | | | | | see the comment for details llvm-svn: 224507
* Do not define CRT_HAS_128BIT for MIPS64Petar Jovanovic2014-12-181-1/+2
| | | | | | | | | | | Do not define it for MIPS64 until its backend supports it. See the bug report [1] for more information. [1] http://llvm.org/bugs/show_bug.cgi?id=20098 Differential Revision: http://reviews.llvm.org/D6703 llvm-svn: 224488
* [ASan] Always build shared ASan runtime on Linux.Alexey Samsonov2014-12-172-38/+40
| | | | | | | | | | | | | | | | | This commit changes the strategy for building shared ASan runtime and the way we test it: - COMPILER_RT_BUILD_SHARED_ASAN CMake option is removed. We now always build shared ASan runtime (it is the default on Android, Windows and Mac, and not the default on Linux and FreeBSD). - Platforms, which use static runtime by default now have "check-asan-dynamic" testsuite. This testsuite contains instrumented unit tests, and ASan lit tests, and runs them with shared ASan runtime. This testsuite is *not* a part of "check-asan" and *not* a part of "check-all", as adding 1000 more test cases, which duplicate existing ones is costly. However, you're welcome to add this command to your buildbot. llvm-svn: 224470
* [sanitizer] add CombinedAllocator::InitIfLinkerInitialized and use it in ↵Kostya Serebryany2014-12-172-7/+25
| | | | | | lsan: speeds up lsan start-up time by ~25% llvm-svn: 224469
* [sanitizer] allow -fsanitize-coverage=N w/ -fsanitize=leak, compiler-rt partKostya Serebryany2014-12-171-0/+6
| | | | llvm-svn: 224464
* [ASan] Move flag parsing logic to asan_flags.cc. NFC.Alexey Samsonov2014-12-176-277/+309
| | | | llvm-svn: 224450
OpenPOWER on IntegriCloud