summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve SUMMARY reporting in sanitizers.Alexey Samsonov2015-03-173-10/+8
| | | | | | | | | Make sure SUMMARY is always reported unless print_summary flag is set to false, even if symbolizer is unavailable or report stack trace is empty. If file/line info for PC can't be evaluated, print module name/offset like we do in stack trace. llvm-svn: 232567
* [sanitizer] change the format of coverage dump: instead of always dumping ↵Kostya Serebryany2015-03-172-38/+48
| | | | | | 32-bit offsets dump 32-bit offsets on 32-bit arch and 64-bit offsets on 64-bit arch. Also add the 'bits' parameter to sancov.py. This is a user-visible interface change. llvm-svn: 232555
* asan: remove left-over code from submitted in rev r232501Dmitry Vyukov2015-03-171-7/+0
| | | | | | | __sanitizer_cov_hint is part of a different functionality and was not intended to be submitted. llvm-svn: 232506
* asan: optimization experimentsDmitry Vyukov2015-03-171-0/+7
| | | | | | | | | | | | | | | | | | | | The experiments can be used to evaluate potential optimizations that remove instrumentation (assess false negatives). Instead of completely removing some instrumentation, you set Exp to a non-zero value (mask of optimization experiments that want to remove instrumentation of this instruction). If Exp is non-zero, this pass will emit special calls into runtime (e.g. __asan_report_exp_load1 instead of __asan_report_load1). These calls make runtime terminate the program in a special way (with a different exit status). Then you run the new compiler on a buggy corpus, collect the special terminations (ideally, you don't see them at all -- no false negatives) and make the decision on the optimization. The exact reaction to experiments in runtime is not implemented in this patch. It will be defined and implemented in a subsequent patch. http://reviews.llvm.org/D8198 llvm-svn: 232501
* [Sanitizers] Fix sanitizers to build on FreeBSD.Viktor Kutuzov2015-03-121-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D8175 llvm-svn: 232072
* Adding the implementation of atos and dladdr symbolizers for OS X.Kuba Brecka2015-03-127-60/+313
| | | | | | | | They are currently still *not* used, "llvm-symbolizer" is still the default symbolizer on OS X. Reviewed at http://reviews.llvm.org/D6588 llvm-svn: 232026
* [sanitizer] fix instrumentation with -mllvm ↵Kostya Serebryany2015-03-101-1/+2
| | | | | | -sanitizer-coverage-block-threshold=0 to actually do something useful. llvm-svn: 231736
* Symbolizer refactoring: Merge common parts of POSIXSymbolizer and WinSymbolizerKuba Brecka2015-03-096-147/+130
| | | | | | Reviewed at http://reviews.llvm.org/D8105 llvm-svn: 231680
* Adding sanitizer_symbolizer_win.h to CMakeLists.txtKuba Brecka2015-03-071-0/+1
| | | | llvm-svn: 231562
* Symbolizer refactoring: Make WinSymbolizer use SymbolizerTool interfaceKuba Brecka2015-03-063-113/+179
| | | | | | Reviewed at http://reviews.llvm.org/D8089 llvm-svn: 231478
* asan: fix comment formattingDmitry Vyukov2015-03-062-3/+3
| | | | | | As per comments in http://reviews.llvm.org/D8032 llvm-svn: 231457
* Print out which symbolizer are we using when verbosity >= 2Kuba Brecka2015-03-051-0/+6
| | | | | | Reviewed at http://reviews.llvm.org/D8087 llvm-svn: 231428
* [sanitizer] Reconstruct the function that dumps block/edge coverage, ↵Kostya Serebryany2015-03-051-73/+76
| | | | | | hopefully making it more robust. Also increase the allowed coverage size on 32-bit. llvm-svn: 231413
* tsan: fix signal handling during stop-the-worldDmitry Vyukov2015-03-052-75/+96
| | | | | | | | | | | | | | | | | | | | | Long story short: stop-the-world briefly resets SIGSEGV handler to SIG_DFL. This breaks programs that handle and continue after SIGSEGV (namely JVM). See the test and comments for details. This is reincarnation of reverted r229678 (http://reviews.llvm.org/D7722). Changed: - execute TracerThreadDieCallback only on tracer thread - reset global data in TracerThreadSignalHandler/TracerThreadDieCallback - handle EINTR from waitpid Add 3 new test: - SIGSEGV during leak checking - StopTheWorld operation during signal storm from an external process - StopTheWorld operation when the program generates and handles SIGSEGVs http://reviews.llvm.org/D8032 llvm-svn: 231367
* Symbolizer refactoring: Link symbolizer tools into a fallback chainKuba Brecka2015-03-052-14/+34
| | | | | | Reviewed at http://reviews.llvm.org/D8049 llvm-svn: 231361
* [sanitizer] add a run-time flag to dump the coverage counter bitsetKostya Serebryany2015-03-052-0/+27
| | | | llvm-svn: 231343
* [sanitizer] when dumping coverage bitset, dump seperate file for every ↵Kostya Serebryany2015-03-043-25/+66
| | | | | | module, instead of dumping a single combined bitset llvm-svn: 231319
* Exclude LLVM sources from lint check.Alexey Samsonov2015-03-041-4/+0
| | | | | | | Checking files from different repository is not nice, and LLVM code follows its own style guide anyway. llvm-svn: 231289
* [sanitizer] Since x32 runs under 64-bit kernel, GetKernelAreaSize should ↵Kostya Serebryany2015-03-041-2/+2
| | | | | | return 0 llvm-svn: 231283
* [asan] more fixes for x32, patches by H.J. LuKostya Serebryany2015-03-031-11/+11
| | | | llvm-svn: 231174
* [sanitizer/coverage] Add AFL-style coverage counters (search heuristic for ↵Kostya Serebryany2015-03-031-1/+93
| | | | | | | | | | | | | | | | | | | | | | | | | fuzzing). Introduce -mllvm -sanitizer-coverage-8bit-counters=1 which adds imprecise thread-unfriendly 8-bit coverage counters. The run-time library maps these 8-bit counters to 8-bit bitsets in the same way AFL (http://lcamtuf.coredump.cx/afl/technical_details.txt) does: counter values are divided into 8 ranges and based on the counter value one of the bits in the bitset is set. The AFL ranges are used here: 1, 2, 3, 4-7, 8-15, 16-31, 32-127, 128+. These counters provide a search heuristic for single-threaded coverage-guided fuzzers, we do not expect them to be useful for other purposes. Depending on the value of -fsanitize-coverage=[123] flag, these counters will be added to the function entry blocks (=1), every basic block (=2), or every edge (=3). Use these counters as an optional search heuristic in the Fuzzer library. Add a test where this heuristic is critical. llvm-svn: 231166
* Symbolizer refactoring: Unify access to symbolizer tools from POSIXSymbolizerKuba Brecka2015-03-032-80/+50
| | | | | | Reviewed at http://reviews.llvm.org/D8029 llvm-svn: 231162
* Symbolizer refactoring: Turn FillAddressAndModuleInfo into FillModuleInfoKuba Brecka2015-03-035-12/+7
| | | | | | Reviewed at http://reviews.llvm.org/D8020 llvm-svn: 231061
* Symbolizer refactoring: Make LibbacktraceSymbolizer adopt the SymbolizerTool ↵Kuba Brecka2015-03-023-49/+46
| | | | | | | | interface Reviewed at http://reviews.llvm.org/D7971 llvm-svn: 231032
* Symbolizer refactoring: ExtractToken and friendsKuba Brecka2015-03-025-39/+89
| | | | | | Reviewed at http://reviews.llvm.org/D7867 llvm-svn: 231027
* Symbolizer refactoring: Move internals to separate filesKuba Brecka2015-03-027-234/+282
| | | | | | Reviewed at http://reviews.llvm.org/D7972 llvm-svn: 231014
* [Sanitizer] Fix StripPathPrefix function and improve test case.Alexey Samsonov2015-03-021-6/+6
| | | | llvm-svn: 230986
* asan: fix windows build after commit 230978Dmitry Vyukov2015-03-021-0/+17
| | | | llvm-svn: 230980
* asan: fix signal handling during stoptheworldDmitry Vyukov2015-03-026-4/+129
| | | | | | | | | | | The problem is that without SA_RESTORER flag, kernel ignores the handler. So tracer actually did not setup any handler. Add SA_RESTORER flag when setting up handlers. Add a test that causes SIGSEGV in stoptheworld callback. Move SignalContext from asan to sanitizer_common to print better diagnostics about signal in the tracer thread. http://reviews.llvm.org/D8005 llvm-svn: 230978
* Revert r229678 "tsan: fix signal handling during stop-the-world"Hans Wennborg2015-02-281-42/+50
| | | | | | | This was causing Chromium's browser_tests to flakily segfault during leak check. llvm-svn: 230874
* Symbolizer refactoring: SymbolizerTool and better interfaceKuba Brecka2015-02-282-60/+87
| | | | | | Reviewed at: http://reviews.llvm.org/D7936 llvm-svn: 230842
* [compiler-rt] Symbolizer refactoring: Abstract SymbolizerProcess betterKuba Brecka2015-02-272-43/+38
| | | | | | Reviewed at http://reviews.llvm.org/D7889 llvm-svn: 230749
* [compiler-rt] Allow suppression file to be relative to the location of the ↵Anna Zaks2015-02-276-4/+77
| | | | | | | | | | executable The ASanified executable could be launched from different locations. When we cannot find the suppression file relative to the current directory, try to see if the specified path is relative to the location of the executable. llvm-svn: 230723
* [Sanitizer] Print column number in SUMMARY line if it's available.Alexey Samsonov2015-02-273-23/+22
| | | | llvm-svn: 230721
* Fix >80 line after r230530.Kuba Brecka2015-02-251-1/+2
| | | | llvm-svn: 230541
* [compiler-rt] Symbolizer refactoring: Move SymbolizerProcess interface to headerKuba Brecka2015-02-252-183/+194
| | | | | | Reviewed at http://reviews.llvm.org/D7868 llvm-svn: 230530
* [compiler-rt] Symbolizer refactoring: Move string parsing into separate ↵Kuba Brecka2015-02-251-46/+65
| | | | | | | | functions Reviewed at http://reviews.llvm.org/D7869 llvm-svn: 230529
* Address post-commit feedback on r230344: Don't use weak hooks on Sanitizer ↵Timur Iskhodzhanov2015-02-251-1/+1
| | | | | | Go build for Windows llvm-svn: 230507
* [ASan/Win] Add support for sanitizer allocator hooks, __asan_default_options ↵Timur Iskhodzhanov2015-02-241-1/+1
| | | | | | and __asan_on_error llvm-svn: 230344
* Allow sanitizer to work with "old" kernel headersRenato Golin2015-02-243-1/+16
| | | | | | | | | | | | | | Sanitizers work on ancient kernels and were depending on types existing. When those types were removed, the sanitizer build broke. See bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59009 for more information. This patch fixes it by isolating the need for those types only when the feature is actually needed, thus allowing one to compile the kernel with or without that change, irrespective of its version. Patch by Christophe Lyon. llvm-svn: 230324
* Try to unbreak sanitizer-x86_64-linux-autoconf after r230318Kuba Brecka2015-02-241-0/+1
| | | | | | | | | | The buildbot failed to build with error: variable ‘enable_fp’ set but not used [-Werror=unused-but-set-variable] let's add a `(void)enable_fp;`. llvm-svn: 230323
* Fix the ASan ioctl.cc test when using COMPILER_RT_DEBUG=OnKuba Brecka2015-02-241-0/+6
| | | | | | | | | | In debug mode (COMPILER_RT_DEBUG=On), we still build with -fomit-frame-pointer and wrap_ioctl doesn't set up a proper stack frame. In release mode it does, because ioctl_common_pre gets inlined into wrap_ioctl and it uses the COMMON_INTERCEPTOR_READ_RANGE macro which in the end calls GET_CURRENT_FRAME and that forces the compiler to generate a stack frame for the function. Not having a proper stack frame breaks the unwinder. This patch forces to generate a frame pointer (via ENABLE_FRAME_POINTER macro). Reviewed at http://reviews.llvm.org/D7815 llvm-svn: 230318
* [ASan] Disable strict init-order checking if dlopen() is called.Alexey Samsonov2015-02-241-0/+6
| | | | | | | | | | | | | | | | Revise the fix to https://code.google.com/p/address-sanitizer/issues/detail?id=178: always disable strict init-order checking the first time dlopen() is called: at this point shared library is allowed to access globals defined in the main executable, as they are guaranteed to be initialized. Revise the test cases: * simplify init-order-dlopen.cc test case: make it Linux-specific (there's no strict init-order checking on other platforms anyway), and single-threaded. * reinforce init-order-pthread-create.cc test case: make sure that init-order checker would produce a false positive unless we turn it off at the moment we call pthread_create(). llvm-svn: 230288
* Unix/BSD system calls are prefixed with SYS_ on FreeBSD and MacIsmail Pazarbasi2015-02-221-2/+2
| | | | | | | | Also, __syscall form should be used when one or more of the parameters is a 64-bit argument to ensure that argument alignment is correct. llvm-svn: 230183
* [Sanitizer] Refactor SuppressionContext class.Alexey Samsonov2015-02-204-157/+85
| | | | | | | | | | | | | | SuppressionContext is no longer a singleton, shared by all sanitizers, but a regular class. Each of ASan, LSan, UBSan and TSan now have their own SuppressionContext, which only parses suppressions specific to that sanitizer. "suppressions" flag is moved away from common flags into tool-specific flags, so the user now may pass ASAN_OPTIONS=suppressions=asan_supp.txt LSAN_OPIONS=suppressions=lsan_supp.txt in a single invocation. llvm-svn: 230026
* [Sanitizer] Remove multiline comment to silence GCC warning. NFC.Alexey Samsonov2015-02-201-2/+1
| | | | llvm-svn: 229948
* [sanitizer] when dumping the basic block trace, also dump the module names. ↵Kostya Serebryany2015-02-201-5/+18
| | | | | | Patch by Laszlo Szekeres llvm-svn: 229940
* [Sanitizer] Drop LibIgnore dependency on SuppressionContext. NFC.Alexey Samsonov2015-02-192-21/+14
| | | | | | | | Let each LibIgnore user (for now it's only TSan) manually go through SuppressionContext and pass ignored library templates to LibIgnore. llvm-svn: 229924
* [Sanitizer] Move TemplateMatch() to sanitizer_common.cc. NFC.Alexey Samsonov2015-02-194-44/+43
| | | | llvm-svn: 229923
* [Sanitizers] Move the common sanitizer interface from ↵Timur Iskhodzhanov2015-02-194-37/+62
| | | | | | | | sanitizer_internal_defs.h to a new sanitizer_interface_internal.h file Reviewed at http://reviews.llvm.org/D7758 llvm-svn: 229858
OpenPOWER on IntegriCloud