summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common
Commit message (Collapse)AuthorAgeFilesLines
...
* [asan/win] Use TerminateProcess when we want to exit abnormallyReid Kleckner2016-11-091-1/+2
| | | | | | | | ExitProcess still runs some code which can lead to ASan interceptors running after CHECK failure. This can lead to deadlock if it CHECK fails again. Avoid that mess by really exiting immediately. llvm-svn: 286395
* tsan: set disable_coredump=0 by default for GoDmitry Vyukov2016-10-281-1/+1
| | | | | | | | | | | Go maps shadow memory lazily, so we don't have the huge multi-TB mapping. Virtual memory consumption is proportional to normal memory usage. Also in Go core dumps are enabled explicitly with GOTRACEBACK=crash, if user explicitly requests a core that must be on purpose. So don't disable core dumps by default. llvm-svn: 285451
* tsan: always define SANITIZER_GODmitry Vyukov2016-10-2810-25/+29
| | | | | | | | | | | | | | | | | | | | | | Currently we either define SANITIZER_GO for Go or don't define it at all for C++. This works fine with preprocessor (ifdef/ifndef/defined), but does not work for C++ if statements (e.g. if (SANITIZER_GO) {...}). Also this is different from majority of SANITIZER_FOO macros which are always defined to either 0 or 1. Always define SANITIZER_GO to either 0 or 1. This allows to use SANITIZER_GO in expressions and in flag default values. Also remove kGoMode and kCppMode, which were meant to be used in expressions, but they are not defined in sanitizer_common code, so SANITIZER_GO become prevalent. Also convert some preprocessor checks to C++ if's or ternary expressions. Majority of this change is done mechanically with: sed "s#ifdef SANITIZER_GO#if SANITIZER_GO#g" sed "s#ifndef SANITIZER_GO#if \!SANITIZER_GO#g" sed "s#defined(SANITIZER_GO)#SANITIZER_GO#g" llvm-svn: 285443
* sanitizer_common: fix description of disable_coredump flagDmitry Vyukov2016-10-281-3/+3
| | | | | | | s/disable_core/disable_coredump/ Add missing space in text. llvm-svn: 285401
* tsan: fix windows buildDmitry Vyukov2016-10-283-1/+5
| | | | | | | | | | | | | | | | | | | | | Currently fails with: C:\workdir\compiler-rt\lib\tsan\go>gcc -c -o race_windows_amd64.syso gotsan.cc -I..\rtl -I..\.. -I..\..\sanitizer_common -I..\..\..\include -m64 -Wall -fno-exceptions -fno-rtti -DSANITIZER_GO -Wno-error=at tributes -Wno-attributes -Wno-format -Wno-maybe-uninitialized -DSANITIZER_DEBUG=0 -O3 -fomit-frame-pointer -std=c++11 gotsan.cc:9229:0: warning: ignoring #pragma comment [-Wunknown-pragmas] #pragma comment(linker, "/alternatename:__sanitizer_print_memory_profile=__sanitizer_default_print_memory_profile") // NOLINT ^ gotsan.cc: In function 'void __sanitizer_print_memory_profile(int)': gotsan.cc:9226:17: error: redefinition of 'void __sanitizer_print_memory_profile(int)' extern "C" void __sanitizer_print_memory_profile(int top_percent) {} ^ gotsan.cc:6898:6: note: 'void __sanitizer_print_memory_profile(int)' previously defined here void __sanitizer_print_memory_profile(int top_percent) { Remove __sanitizer_print_memory_profile from Go build, it is not needed. llvm-svn: 285400
* [sanitizers] Set Darwin specific linker and compiler flags for all testsAnna Zaks2016-10-261-0/+5
| | | | | | | | | | | | | | | | Looks like we are missing these flags only in tsan and sanitizer-common. This results in linker warnings in some settings as it can cause the Unit tests to be built with a different SDK version than that was used to build the runtime. For example, we are not setting the minimal deployment target on the tests but are setting the minimal deployment target for the sanitizer library, which leads to the following warning on some bots: ld: warning: object file (sanitizer_posix_test.cc.i386.o) was built for newer OSX version (10.12) than being linked (10.11). Differential Revision: https://reviews.llvm.org/D25860 https://reviews.llvm.org/D25352 llvm-svn: 285255
* scripts: Document existing problems with the symbolizer build script.Peter Collingbourne2016-10-241-0/+6
| | | | | | | | | | Reviewers: eugenis, vitalybuka Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D25846 llvm-svn: 285013
* [sanitizers] support strict_string_checks for strncmpKostya Serebryany2016-10-211-2/+2
| | | | llvm-svn: 284901
* adding new symbols to llvm-symbolizer symbol testMike Aizatsky2016-10-201-0/+3
| | | | llvm-svn: 284773
* [sanitizers] -Wno-macro-redefined for libc++ buildVitaly Buka2016-10-141-1/+1
| | | | llvm-svn: 284258
* Make lsan complain loudly when running under ptraceKostya Serebryany2016-10-131-1/+3
| | | | | | | | | | | | | | | | | | Summary: LeakSanitizer does not work with ptrace but currently it will print warnings (only under verbosity=1) and then proceed to print tons of false reports. This patch makes lsan fail hard under ptrace with a verbose message. https://github.com/google/sanitizers/issues/728 Reviewers: eugenis, vitalybuka, aizatsky Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D25538 llvm-svn: 284171
* [ESan] [MIPS] Fix workingset-signal-posix.cpp on MIPSSagar Thakur2016-10-061-1/+1
| | | | | | | | | Used uptr for __sanitizer_kernel_sigset_t.sig to avoid byte order issues on big endian systems Reviewd by bruening. Differential: D24332 llvm-svn: 283438
* [ESan][MIPS] Adds support for MIPS64Sagar Thakur2016-10-065-3/+42
| | | | | | | | | With this patch 12 out of 13 tests are passing. Reviewed by zhaoqin. Differential: D23799 llvm-svn: 283435
* [asan] Fixup: Switch to using dynamic shadow offset on iOSAnna Zaks2016-10-051-1/+1
| | | | | | Address lint comments. llvm-svn: 283378
* [asan] Reapply: Switch to using dynamic shadow offset on iOSAnna Zaks2016-10-053-6/+54
| | | | | | | | The VM layout is not stable between iOS version releases, so switch to dynamic shadow offset. Differential Revision: https://reviews.llvm.org/D25218 llvm-svn: 283375
* Revert "[asan] Switch to using dynamic shadow offset on iOS"Anna Zaks2016-10-053-43/+5
| | | | | | | | This reverts commit b2af965b7924ad793b313996a96633bb72daf629. Revert as these changes broke a Chromium buildbot. llvm-svn: 283349
* [asan] Switch to using dynamic shadow offset on iOSAnna Zaks2016-10-043-5/+43
| | | | | | | | The VM layout is not stable between iOS version releases, so switch to dynamic shadow offset. Differential Revision: https://reviews.llvm.org/D25218 llvm-svn: 283240
* [sanitizer-coverage] remove stale code, second attempt after failed r282994Kostya Serebryany2016-10-041-24/+0
| | | | llvm-svn: 283185
* Revert "[sanitizer-coverage] remove stale code" at it breaks Windows bot.Vitaly Buka2016-10-041-0/+24
| | | | | | This reverts commit r282994. llvm-svn: 283183
* Support configurable path to LLVM srcVitaly Buka2016-10-041-4/+3
| | | | llvm-svn: 283166
* [sanitizer-coverage] remove stale codeKostya Serebryany2016-10-011-24/+0
| | | | llvm-svn: 282994
* [compiler-rt] Add support for the dynamic shadow allocationEtienne Bergeron2016-09-303-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch is adding support for dynamic shadow allocation. This is a merge and re-commit of the following patches. ``` [compiler-rt] Fix Asan build on Android https://reviews.llvm.org/D24768 [compiler-rt] Add support for the dynamic shadow allocation https://reviews.llvm.org/D23363 ``` This patch needed to re-land at the same time: ``` [asan] Support dynamic shadow address instrumentation https://reviews.llvm.org/D23354 ``` Reviewers: rnk, zaks.anna Subscribers: tberghammer, danalbert, kubabrecka, dberris, chrisha, llvm-commits Differential Revision: https://reviews.llvm.org/D25104 llvm-svn: 282882
* Remove Google specific code.Vitaly Buka2016-09-291-7/+0
| | | | llvm-svn: 282808
* Don't use internal symbolizer if we are in process of reporting Out-of-Memory.Vitaly Buka2016-09-295-16/+40
| | | | | | Reviewed by eugenis offline, as reviews.llvm.org is down. llvm-svn: 282805
* Add symbols introduced with -m32 buildVitaly Buka2016-09-291-0/+3
| | | | llvm-svn: 282695
* Limit script to sanitizers as SCUDO does not pass tests if we add symbolizerVitaly Buka2016-09-291-1/+1
| | | | llvm-svn: 282694
* Move verbose clang binaries detectionVitaly Buka2016-09-291-12/+11
| | | | llvm-svn: 282682
* Add build script for symbolizer which can be linked into instrumented process.Vitaly Buka2016-09-284-0/+567
| | | | | | | | | | Reviewers: eugenis Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24974 llvm-svn: 282617
* [lsan] [aarch64] Fix calculating TLS areaStrahinja Petrovic2016-09-281-1/+4
| | | | | | | This patch fixes calculating begin of TLS area on AARCH64. Differential Revision: https://reviews.llvm.org/D24454 llvm-svn: 282571
* [sanitizer_common] Delete some copy/move methods in InternalScopedBufferVedant Kumar2016-09-271-8/+8
| | | | | | Differential Revision: https://reviews.llvm.org/D24811 llvm-svn: 282548
* revert 282085, 281909, they broke 32-bit dynamic ASan and the ↵Nico Weber2016-09-213-28/+0
| | | | | | sanitizer-windows bot llvm-svn: 282096
* Fix typo in comment [NFC]Etienne Bergeron2016-09-211-1/+1
| | | | llvm-svn: 282092
* [XRay] ARM 32-bit no-Thumb support in compiler-rtDean Michael Berris2016-09-201-1/+2
| | | | | | | | | | | | This is a port of XRay to ARM 32-bit, without Thumb support yet. This is one of 3 commits to different repositories of XRay ARM port. The other 2 are: https://reviews.llvm.org/D23931 (LLVM) https://reviews.llvm.org/D23932 (Clang test) Differential Revision: https://reviews.llvm.org/D23933 llvm-svn: 281971
* [compiler-rt] Add support for the dynamic shadow allocationEtienne Bergeron2016-09-193-0/+28
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch is adding the needed code to compiler-rt to support dynamic shadow. This is to support this patch: https://reviews.llvm.org/D23354 It's adding support for using a shadow placed at a dynamic address determined at runtime. The dynamic shadow is required to work on windows 64-bits. Reviewers: rnk, kcc, vitalybuka Subscribers: kubabrecka, dberris, llvm-commits, chrisha Differential Revision: https://reviews.llvm.org/D23363 llvm-svn: 281909
* [sanitizer] rename __sanitizer_symbolize_data to ↵Kostya Serebryany2016-09-191-2/+2
| | | | | | __sanitizer_symbolize_global (to avoid conflict with another definition) llvm-svn: 281902
* [sanitizer] add __sanitizer_symbolize_data (can only print the names of the ↵Kostya Serebryany2016-09-193-4/+52
| | | | | | globals for now) llvm-svn: 281886
* [asan] fix window buildKostya Serebryany2016-09-151-0/+2
| | | | llvm-svn: 281679
* [asan] provide dummy implementations for __sanitizer_cov_trace_pc_*Kostya Serebryany2016-09-151-0/+6
| | | | llvm-svn: 281677
* [asan] Reenable 64-bit allocator on android/aarch64.Evgeniy Stepanov2016-09-152-16/+39
| | | | | | This is a re-commit of r281371, with updated tests. llvm-svn: 281674
* [sanitizer] Fixup 2: Do not introduce __sanitizer namespace globallyAnna Zaks2016-09-151-0/+1
| | | | | | This got committed by mistake. Should fix some bots. llvm-svn: 281668
* [compiler-rt] Remove the system includes from __sanitizer namespaceAnna Zaks2016-09-151-2/+2
| | | | llvm-svn: 281658
* [compiler-rt] Do not introduce __sanitizer namespace globallyAnna Zaks2016-09-1514-19/+44
| | | | | | | | | | | | The definitions in sanitizer_common may conflict with definitions from system headers because: The runtime includes the system headers after the project headers (as per LLVM coding guidelines). lib/sanitizer_common/sanitizer_internal_defs.h pollutes the namespace of everything defined after it, which is all/most of the sanitizer .h and .cc files and the included system headers with: using namespace __sanitizer; // NOLINT This patch solves the problem by introducing the namespace only within the sanitizer namespaces as proposed by Dmitry. Differential Revision: https://reviews.llvm.org/D21947 llvm-svn: 281657
* [sanitizers] DLAddr Symbolizer should fail if demangle failsAnna Zaks2016-09-151-1/+2
| | | | | | | This can case crashes in high verbosity mode when demangling fails. Not including a test case since this is hard to reproduce. llvm-svn: 281656
* [sanitizer] Test the allocator with the ASan win64 memory constantsReid Kleckner2016-09-151-2/+2
| | | | | | | | These got out of sync and the tests were failing for me locally. We assume a 47 bit address space in ASan, so we should do the same in the tests. llvm-svn: 281622
* Really fix the Windows sanitizer buildReid Kleckner2016-09-151-0/+12
| | | | | | | | | | Don't list __sanitizer_print_memory profile as an INTERFACE_FUNCTION. It is not exported by ASan; it is exported by user code. Move the weak definition from asan_win.cc to sanitizer_win.cc to fix the ubsan tests. llvm-svn: 281619
* [sanitizer] Fix darwin Go tsan build by unifying r281567 and r281553.Ahmed Bougacha2016-09-152-8/+7
| | | | | | Avoid redefining the weak stub when building gotsan.cc llvm-svn: 281576
* [sanitizer] one more attempt to fix things with ↵Kostya Serebryany2016-09-151-1/+1
| | | | | | __sanitizer_print_memory_profile llvm-svn: 281574
* Define the weak symbol added by r281546 on mac.Ahmed Bougacha2016-09-151-0/+8
| | | | | | 'weak' doesn't behave like it does on linux. llvm-svn: 281567
* [tsan] fix tsan build by adding a dummy __sanitizer_print_memory_profileKostya Serebryany2016-09-141-1/+1
| | | | llvm-svn: 281553
* [asan] add heap_profile=1 to asan to periodically print the heap profile. So ↵Kostya Serebryany2016-09-143-1/+16
| | | | | | far this is a very basic heap-profile functionality llvm-svn: 281546
OpenPOWER on IntegriCloud