summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan
Commit message (Collapse)AuthorAgeFilesLines
...
* [asan] Introduce new approach for ODR violation detection based on odr ↵Maxim Ostapenko2016-02-084-12/+79
| | | | | | | | | | | | | | indicator symbols. This is a compiler-rt part of this http://reviews.llvm.org/D15642 patch. Here, we add a new approach for ODR violation detection. Instead of using __asan_region_is_poisoned(g->beg, g->size_with_redzone) on global address (that would return false now due to using private alias), we can use new globally visible indicator symbol to perform the check. Differential Revision: http://reviews.llvm.org/D15644 llvm-svn: 260076
* Revert r259961, r259978, r259981.Nico Weber2016-02-073-123/+1
| | | | | | | | | | | | The "sanitizer-windows" buildbot has been failing for two days because of this: FAILED: cl.exe asan_report.cc asan_scariness_score.h(60) : error C2536: '__asan::ScarinessScore::__asan::ScarinessScore::descr' : cannot specify explicit initializer for arrays asan_scariness_score.h(60) : see declaration of '__asan::ScarinessScore::descr' llvm-svn: 260059
* [asan] properly report an un-aligned global variable instead of just crashingKostya Serebryany2016-02-061-1/+10
| | | | llvm-svn: 259979
* [asan] add an experimental feature that prints the scariness score of the ↵Kostya Serebryany2016-02-063-1/+123
| | | | | | error message. To enable it use ASAN_OPTIONS=print_scariness=1 llvm-svn: 259961
* [asan] When catching a signal caused by a memory access, print if it's a ↵Kostya Serebryany2016-02-041-2/+7
| | | | | | READ or a WRITE. This touches win/mac files which I have not tested, if a win/mac bot fails I'll try to quick-fix llvm-svn: 259741
* [asan] Remove redundant elifAnna Zaks2016-02-021-2/+0
| | | | | | This is a fixup to r259451. llvm-svn: 259588
* [asan] Fix internal CHECK failure on double free in recovery mode.Maxim Ostapenko2016-02-021-5/+13
| | | | | | | | This patches fixes https://github.com/google/sanitizers/issues/639 Differential Revision: http://reviews.llvm.org/D15807 llvm-svn: 259473
* [asan] Add iOS support.Anna Zaks2016-02-024-12/+27
| | | | llvm-svn: 259451
* Remove autoconf support for building runtime libraries.Chris Bieneman2016-01-261-29/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I am the punishment of God... If [autoconf] had not committed great sins, God would not have sent a punishment like me upon [it]." -Genghis Khan Reviewers: chandlerc, grosbach, bob.wilson, zaks.anna, kubabrecka, samsonov, echristo Subscribers: iains, llvm-commits Differential Revision: http://reviews.llvm.org/D16473 llvm-svn: 258863
* [asan] print an additional hint when reporting a container overflowKostya Serebryany2016-01-201-1/+13
| | | | llvm-svn: 258337
* [asan] Optionally print reproducer cmdline in ASan reports.Maxim Ostapenko2016-01-181-0/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D16070 llvm-svn: 258037
* [LSan] Ignore all allocations made inside pthread_create.Alexey Samsonov2016-01-161-1/+12
| | | | | | | | | | | | | Thread stack/TLS may be stored by libpthread for future reuse after thread destruction, and the linked list it's stored in doesn't even hold valid pointers to the objects, the latter are calculated by obscure pointer arithmetic. With this change applied, LSan test suite passes with "use_ld_allocations" flag defaulted to "false". It still requires more testing to check if the default can be switched. llvm-svn: 257975
* [LSan] Use __tls_get_addr interceptor to keep track of dynamic TLS.Alexey Samsonov2016-01-142-2/+10
| | | | | | | | | | | | | | | | | | | | Summary: We have a way to keep track of allocated DTLS segments: let's use it in LSan. Although this code is fragile and relies on glibc implementation details, in some cases it proves to be better than existing way of tracking DTLS in LSan: marking as "reachable" all memory chunks allocated directly by "ld". The plan is to eventually get rid of the latter, once we are sure it's safe to remove. Reviewers: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16164 llvm-svn: 257785
* Fix the cross compilation of unit tests. NFC (second attempt)Sumanth Gundapaneni2016-01-141-1/+6
| | | | | | | | | | | | | | | | With COMPILER_RT_INCLUDE_TESTS turned ON and in a cross compiling environment, the unit tests fail to link. This patch does the following changes >Rename COMPILER_RT_TEST_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS to reflect the way it's used. >Add COMPILER_RT_TEST_COMPILER_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to build/compile the unit tests >Add COMPILER_RT_UNITTEST_LINKFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to link the unit tests (if needed) Differential Revision: http://reviews.llvm.org/D16165 llvm-svn: 257783
* [Sanitizer] Pass proper values to DTLS_on_libc_memalign.Alexey Samsonov2016-01-141-1/+1
| | | | | | | Fix a surprising typo: the old code used to think that dynamic TLS segments were several times larger than they actually are. llvm-svn: 257722
* Revert r257686 "With COMPILER_RT_INCLUDE_TESTS turned ON and in a cross ↵Hans Wennborg2016-01-131-6/+1
| | | | | | | | | | | | | | | compiling" This broke the build. For example, from http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/1191/steps/cmake%20stage%201/logs/stdio: -- Compiler-RT supported architectures: aarch64 CMake Error at projects/compiler-rt/cmake/Modules/AddCompilerRT.cmake:170 (string): string sub-command REPLACE requires at least four arguments. Call Stack (most recent call first): projects/compiler-rt/lib/CMakeLists.txt:4 (include) llvm-svn: 257694
* With COMPILER_RT_INCLUDE_TESTS turned ON and in a cross compilingSumanth Gundapaneni2016-01-131-1/+6
| | | | | | | | | | | | | | | environment, the unit tests fail to link. This patch does the following changes >Rename COMPILER_RT_TEST_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS to reflect the way it's used. >Add COMPILER_RT_TEST_COMPILER_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to build/compile the unit tests >Add COMPILER_RT_UNITTEST_LINKFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to link the unit tests (if needed) Differential Revision:http://reviews.llvm.org/D15082 llvm-svn: 257686
* [sanitizers] Log all output to CrashReport on OS XAnna Zaks2016-01-061-3/+0
| | | | | | | | | | | Log all of sanitizers' output (not just ASan bug reports) to CrashReport, which simplifies diagnosing failed checks as well as other errors. This also allows to strip the color sequences early from the printed buffer, which is more efficient than what we had perviously. Differential Revision: http://reviews.llvm.org/D15396 llvm-svn: 256988
* [sancov] adding internal functionMike Aizatsky2016-01-051-0/+1
| | | | llvm-svn: 256806
* For the asan_symbolize.py script, use addr2line as the default systemDimitry Andric2015-12-291-1/+1
| | | | | | | symbolizer on FreeBSD too. This allows the asan-symbolize-bad-path.cc test to succeed. llvm-svn: 256578
* [asan] add option: handle_sigillKostya Serebryany2015-12-151-0/+2
| | | | llvm-svn: 255588
* [asan] Use atomic_uintptr_t instead of atomic_uint64_t in SuppressErrorReport.Yury Gribov2015-12-101-2/+2
| | | | | | | | | Some targets (e.g. Mips) don't have 64-bit atomics, so using atomic_uint64_t leads to build failures. Use atomic_uintptr_t to avoid such errors. Patch by Max Ostapenko. llvm-svn: 255242
* [asan] Suppress duplicated errors in ASan recovery mode.Yury Gribov2015-12-101-0/+17
| | | | | | | | Patch by Max Ostapenko. Differential Revision: http://reviews.llvm.org/D15080 llvm-svn: 255228
* asan_win_dynamic_runtime_thunk.cc: declare atexitHans Wennborg2015-12-091-0/+1
| | | | | | | MSVC apparently makes atexit available even without including stdlib.h, but clang-cl does not. This makes the file build also with clang-cl. llvm-svn: 255160
* Check multilib dir for asan_device_setup.Dan Albert2015-12-041-2/+7
| | | | | | | | | | Reviewers: eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15247 llvm-svn: 254789
* [asan] Remove the use of system properties on Android.Evgeniy Stepanov2015-12-042-13/+0
| | | | | | | | | | | | | System properties are not accessible through NDK (we've been using hacks to get to them) and they are unavailable during ASan initialization in .preinit_array. Use environment variables and files instead (ex. ASAN_OPTIONS=include_if_exists=/path). No test changes. This feature was not tested because the properties are system-wide and would conflict with the parallel test runner. Yet another reason to get rid of it. llvm-svn: 254783
* [ASan] Fix the links to bugs and wikipages.Alexander Potapenko2015-12-0410-16/+15
| | | | llvm-svn: 254735
* [ASan] Change the links in asa_flags.inc to point to GitHub.Alexander Potapenko2015-12-041-4/+4
| | | | llvm-svn: 254732
* [ASan] Retire mac_ignore_invalid_free, remove some dead code.Alexander Potapenko2015-12-044-31/+0
| | | | | | | | | | mac_ignore_invalid_free was helpful when ASan runtime used to intercept CFAllocator and sometimes corrupted its memory. This behavior had been long gone, and the flag was unused. This patch also deletes ReportMacCfReallocUnknown(), which was used by the CFAllocator realloc() wrapper. llvm-svn: 254722
* [tsan] Use re-exec method to enable interceptors on older versions of OS XKuba Brecka2015-12-035-198/+1
| | | | | | | | In AddressSanitizer, we have the MaybeReexec method to detect when we're running without DYLD_INSERT_LIBRARIES (in which case interceptors don't work) and re-execute with the environment variable set. On OS X 10.11+, this is no longer necessary, but to have ThreadSanitizer supported on older versions of OS X, let's use the same method as well. This patch moves the implementation from `asan/` into `sanitizer_common/`. Differential Revision: http://reviews.llvm.org/D15123 llvm-svn: 254600
* [asan] Correctly release memory allocated during early startup.Yury Gribov2015-12-011-2/+19
| | | | | | | | | | Calloc interceptor initially allocates memory from temp buffer (to serve dlsyms called during asan_init). There is a chance that some non-instrumented library (or executable) has allocated memory with calloc before asan_init and got pointer from the same temporary buffer which later caused problems with free. Inspired by https://github.com/google/sanitizers/issues/626 Differential Revision: http://reviews.llvm.org/D14979 llvm-svn: 254395
* [asan] Fix the deadlocks introduced by "On OS X, log reports to syslog and ↵Anna Zaks2015-11-201-10/+18
| | | | | | | | | | | | os_trace" commit [asan] On OS X, log reports to syslog and os_trace, has been reverted in r252076 due to deadlocks on earlier versions of OS X. Alexey has also noticed deadlocks in some corner cases on Linux. This patch, if applied on top of the logging patch (http://reviews.llvm.org/D13452), addresses the known deadlock issues. (This also proactively removes the color escape sequences from the error report buffer since we have to copy the buffer anyway.) Differential Revision: http://reviews.llvm.org/D14470 llvm-svn: 253689
* Reapply: [asan] On OS X, log reports to syslog and os_traceAnna Zaks2015-11-202-18/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When ASan currently detects a bug, by default it will only print out the text of the report to stderr. This patch changes this behavior and writes the full text of the report to syslog before we terminate the process. It also calls os_trace (Activity Tracing available on OS X and iOS) with a message saying that the report is available in syslog. This is useful, because this message will be shown in the crash log. For this to work, the patch makes sure we store the full report into error_message_buffer unconditionally, and it also strips out ANSI escape sequences from the report (they are used when producing colored reports). I've initially tried to log to syslog during printing, which is done on Android right now. The advantage is that if we crash during error reporting or the produced error does not go through ScopedInErrorReport, we would still get a (partial) message in the syslog. However, that solution is very problematic on OS X. One issue is that the logging routine uses GCD, which may spawn a new thread on its behalf. In many cases, the reporting logic locks threadRegistry, which leads to deadlocks. Reviewed at http://reviews.llvm.org/D13452 (In addition, add sanitizer_common_libcdep.cc to buildgo.sh to avoid build failures on Linux.) llvm-svn: 253688
* Tell clang-format that (most) sanitizers are written using Google style guide.Alexey Samsonov2015-11-191-0/+1
| | | | llvm-svn: 253608
* [ASan] Be consistent and refer to reported issues as "errors" in hints.Alexey Samsonov2015-11-181-3/+3
| | | | llvm-svn: 253406
* [asan] add an experimental flag protect_shadow_gap. If set to false, the ↵Kostya Serebryany2015-11-142-0/+3
| | | | | | shadow gap will not be mprotect-ed and all hell may break loose. But this makes CUDA's cuInit() pass. llvm-svn: 253108
* [asan] Fix silly error when reporting multiple ASan errors in parallel.Yury Gribov2015-11-131-2/+3
| | | | llvm-svn: 253022
* [Windows] Add exports for dll_host test broken by r252071 and r251071Reid Kleckner2015-11-111-0/+2
| | | | llvm-svn: 252784
* [Asan] Added missing hunk to previous commit.Yury Gribov2015-11-111-7/+2
| | | | llvm-svn: 252724
* [ASan] Enable optional ASan recovery.Yury Gribov2015-11-116-88/+188
| | | | | | Differential Revision: http://reviews.llvm.org/D12318 llvm-svn: 252723
* [compiler-rt] [asan] Use same shadow offset for aarch64Adhemerval Zanella2015-11-092-6/+0
| | | | | | | | This patch makes ASAN for aarch64 use the same shadow offset for all currently supported VMAs (39 and 42 bits). The shadow offset is the same for 39-bit (36). llvm-svn: 252497
* [ASan] Add two new functions to DLL thunk.Alexey Samsonov2015-11-061-0/+3
| | | | llvm-svn: 252359
* Revert "Reapply: [asan] On OS X, log reports to syslog and os_trace"Juergen Ributzka2015-11-042-25/+18
| | | | | | | Looks like this commit is deadlocking the ASAN tests on the green dragon bot (http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA/). llvm-svn: 252076
* Asan: utility function to determine first wrongly poisoned byte inMike Aizatsky2015-11-041-9/+16
| | | | | | | | container. Differential Revision: http://reviews.llvm.org/D14341 llvm-svn: 252071
* [tsan] Use malloc zone interceptors on OS X, part 1 (refactoring)Kuba Brecka2015-11-041-336/+39
| | | | | | | | TSan needs to use a custom malloc zone on OS X, which is already implemented in ASan. This patch is a refactoring patch (NFC) that extracts this from ASan into sanitizer_common, where we can reuse it in TSan. Reviewed at http://reviews.llvm.org/D14330 llvm-svn: 252052
* Revert "Apply modernize-use-default to compiler-rt."Alexey Samsonov2015-10-301-1/+1
| | | | | | | | | | | | This reverts commit r250823. Replacing at least some of empty constructors with "= default" variants is a semantical change which we don't want. E.g. __tsan::ClockBlock contains a union of large arrays, and it's critical for correctness and performance that we don't memset() these arrays in the constructor. llvm-svn: 251717
* Sanitizer: define WIN32_LEAN_AND_MEANSaleem Abdulrasool2015-10-292-0/+2
| | | | | | | | Define WIN32_LEAN_AND_MEAN before including Windows.h. This is already being done in some places. This does it more broadly. This permits building ASAN on Linux for Winndows, as well as reduces the amount of included declarations. llvm-svn: 251649
* Reapply: [asan] On OS X, log reports to syslog and os_traceAnna Zaks2015-10-282-18/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When ASan currently detects a bug, by default it will only print out the text of the report to stderr. This patch changes this behavior and writes the full text of the report to syslog before we terminate the process. It also calls os_trace (Activity Tracing available on OS X and iOS) with a message saying that the report is available in syslog. This is useful, because this message will be shown in the crash log. For this to work, the patch makes sure we store the full report into error_message_buffer unconditionally, and it also strips out ANSI escape sequences from the report (they are used when producing colored reports). I've initially tried to log to syslog during printing, which is done on Android right now. The advantage is that if we crash during error reporting or the produced error does not go through ScopedInErrorReport, we would still get a (partial) message in the syslog. However, that solution is very problematic on OS X. One issue is that the logging routine uses GCD, which may spawn a new thread on its behalf. In many cases, the reporting logic locks threadRegistry, which leads to deadlocks. Reviewed at http://reviews.llvm.org/D13452 (In addition, add sanitizer_common_libcdep.cc to buildgo.sh to avoid build failures on Linux.) llvm-svn: 251577
* [asan] Fix asan_device_setup script on KitKat.Evgeniy Stepanov2015-10-281-0/+2
| | | | | | | | | app_process32, when started via a shell script wrapper, needs a different security context to satisty SELinux. Patch by Abhishek Arya. llvm-svn: 251572
* Revert "[asan] On OS X, log reports to syslog and os_trace"Anna Zaks2015-10-272-25/+18
| | | | | | | | This reverts commit 251447. (Which caused failures on a Linux bot.) llvm-svn: 251467
OpenPOWER on IntegriCloud