summaryrefslogtreecommitdiffstats
path: root/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
...
* [asan] Support ASAN_ACTIVATION_OPTIONS.Evgeniy Stepanov2014-12-242-1/+15
| | | | | | | | 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-242-15/+40
| | | | 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-242-4/+27
| | | | | | 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] Disable one test on Android.Evgeniy Stepanov2014-12-241-0/+2
| | | | | | It used to pass by chance and started failing on recent Android builds. llvm-svn: 224818
* [ASan] Fix asan_preload_test-2 on PowerPC64 LinuxJay Foad2014-12-241-2/+2
| | | | | | | | | | | | | | | | | Summary: This test failed because clang compiled the call to memset() into a single sth instruction, instead of a call. Fix it by using write() instead of memset(). Reviewers: kcc, samsonov, garious, eugenis Reviewed By: eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6776 llvm-svn: 224812
* [asan] change the coverage collection scheme so that we can easily emit ↵Kostya Serebryany2014-12-236-28/+82
| | | | | | 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
* Change the CMake build to generate full debugging info when COMPILER_RT_DEBUG=ONKuba Brecka2014-12-231-1/+1
| | | | | | | | The compiler-rt CMake build currently uses -gline-tables-only for all builds. While this makes the debugger correctly map source files, debugging of the runtime libraries in general is pretty tough, because you don't see any local variables, parameters, etc. Let's allow emitting full debugging info by setting COMPILER_RT_DEBUG=ON. Reviewed at http://reviews.llvm.org/D6764 llvm-svn: 224749
* [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-222-1/+53
| | | | | | | 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-224-0/+83
| | | | | | they are required to handle synchronization on volatile/final fields llvm-svn: 224697
* log-path_test testcase - make the invalid path more invalidKuba Brecka2014-12-221-2/+2
| | | | | | | | The ASan test/asan/TestCases/log-path_test.cc testcase uses /INVALID as an invalid path and expects that the program will not be allowed to create or write to that file. This actually is a valid writable path on one of my setups. Let's make the path more invalid. Reviewed at http://reviews.llvm.org/D6727 llvm-svn: 224694
* [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
* [lsan] Add debug output to leak_check_before_thread_started.cc.Sergey Matveev2014-12-191-2/+1
| | | | | | Trying to investigate why this test is flaky. llvm-svn: 224580
* [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
* [asan] Test BB- and edge- level coverage on Android.Evgeniy Stepanov2014-12-191-5/+81
| | | | llvm-svn: 224572
* [asan] Add tests for direct (mmap-ed) mode for BB- and edge-level coverage.Evgeniy Stepanov2014-12-191-2/+41
| | | | llvm-svn: 224571
* [asan] Resurrect sanitize-coverage test on Android.Evgeniy Stepanov2014-12-192-5/+5
| | | | | | | The test got silently disabled because of a typo in the lit config. Also, compiler flags have changed (asan-coverage -> fsanitize-coverage). llvm-svn: 224569
* tsan: add an additional test for signal handlersDmitry Vyukov2014-12-181-0/+52
| | | | | | | the test passes now, but signal handling during thread creation and shutdown is tricky llvm-svn: 224532
* 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-182-17/+106
| | | | | | | 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
* Fix suppressions file usageFilipe Cabecinhas2014-12-1815-32/+32
| | | | | | | | | | | | | | | | | | Summary: Always quote suppressions files given to *_OPTIONS. This will make it not break when given full Windows paths (otherwise, parsing would stop after the drive's letter + ':'). Also fix one or two cases where the suppression files' extensions were not *.supp. Reviewers: samsonov, kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6680 llvm-svn: 224529
* [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-182-32/+6
| | | | | | and re-enable the test llvm-svn: 224518
* tsan: disable the test even harderDmitry Vyukov2014-12-181-9/+36
| | | | | | | | | | | | | | | | currently it fails in cmake build with weird errors: /tmp/real_deadlock_detector_stress_test-68a5ae.o: In function `__clang_call_terminate': /ssd/src/llvm/projects/compiler-rt/test/tsan/real_deadlock_detector_stress_test.cc:(.text.__clang_call_terminate[__clang_call_terminate]+0x12): undefined reference to `__cxa_begin_catch' /ssd/src/llvm/projects/compiler-rt/test/tsan/real_deadlock_detector_stress_test.cc:(.text.__clang_call_terminate[__clang_call_terminate]+0x17): undefined reference to `std::terminate()' /tmp/real_deadlock_detector_stress_test-68a5ae.o: In function `std::vector<int, std::allocator<int> >::_M_check_len(unsigned long, char const*) const': /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_vector.h:1339: undefined reference to `std::__throw_length_error(char const*)' /tmp/real_deadlock_detector_stress_test-68a5ae.o: In function `__gnu_cxx::new_allocator<int>::allocate(unsigned long, void const*)': /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/ext/new_allocator.h:102: undefined reference to `std::__throw_bad_alloc()' /tmp/real_deadlock_detector_stress_test-68a5ae.o:(.eh_frame+0x63): undefined reference to `__gxx_personality_v0' clang-3.5: error: linker command failed with exit code 1 (use -v to see invocation) llvm-svn: 224511
* tsan: add a stress test for deadlock detectorDmitry Vyukov2014-12-181-0/+188
| | | | | | currently disabled because fails llvm-svn: 224509
OpenPOWER on IntegriCloud