summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_flags.h
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [sanitizer] Remove unnecessary attribute hidden.Evgeniy Stepanov2017-11-101-3/+1
| | | | | | | | | This should fix windows build of compiler-rt broken in r317943. The attribute is unnecessary because since GetMaxVirtualAddress was split in two, we no longer use common_flags() in the ifunc resolver context. llvm-svn: 317948
* [asan] Use dynamic shadow on 32-bit Android.Evgeniy Stepanov2017-11-101-1/+3
| | | | | | | | | | | | | | | | | | | Summary: The following kernel change has moved ET_DYN base to 0x4000000 on arm32: https://marc.info/?l=linux-kernel&m=149825162606848&w=2 Switch to dynamic shadow base to avoid such conflicts in the future. Reserve shadow memory in an ifunc resolver, but don't use it in the instrumentation until PR35221 is fixed. This will eventually let use save one load per function. Reviewers: kcc Subscribers: aemerson, srhines, kubamracek, kristof.beyls, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D39393 llvm-svn: 317943
* [compiler-rt] Replace allow_user_segv_handler=0 with kHandleSignalExclusiveVitaly Buka2017-05-251-0/+1
| | | | | | | | | | | | | | Summary: allow_user_segv_handler had confusing name did not allow to control behavior for signals separately. Reviewers: eugenis, alekseyshl, kcc Subscribers: llvm-commits, dberris, kubamracek Differential Revision: https://reviews.llvm.org/D33371 llvm-svn: 303941
* [compiler-rt] Switch handle_<signal> flags from bool to enum.Vitaly Buka2017-05-191-0/+5
| | | | | | | | | | | | Summary: We are going to make it tri-state and remove allow_user_segv_handler. Reviewers: eugenis, alekseys, kcc Subscribers: kubamracek, dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D33159 llvm-svn: 303464
* [sancov] common flags initialization.Mike Aizatsky2016-03-181-0/+5
| | | | | | | | | | | | Summary: Introducing InitializeCommonFlags accross all sanitizers to simplify common flags management. Setting coverage=1 when html_cov_report is requested. Differential Revision: http://reviews.llvm.org/D18273 llvm-svn: 263820
* Introduce stats and stats_client libraries.Peter Collingbourne2016-01-161-0/+2
| | | | | | | | | This is part of a new statistics gathering feature for the sanitizers. See clang/docs/SanitizerStats.rst for further info and docs. Differential Revision: http://reviews.llvm.org/D16176 llvm-svn: 257972
* [sanitizer] Implement include_if_exists with process name substitution.Evgeniy Stepanov2015-07-211-1/+1
| | | | | | | | | include_if_exists=/path/to/sanitizer/options reads flags from the file if it is present. "%b" in the include file path (for both variants of the flag) is replaced with the basename of the main executable. llvm-svn: 242853
* [asan] Warn if unsupported flags are used at activation.Evgeniy Stepanov2015-01-201-0/+1
| | | | llvm-svn: 226563
* [sanitizer] Flag parser rewrite.Evgeniy Stepanov2015-01-151-16/+3
| | | | | | | The new parser is a lot stricter about syntax, reports unrecognized flags, and will make it easier to implemented some of the planned features. llvm-svn: 226169
* [Sanitizer] Use COMMON_FLAG macro to describe common runtime flags.Alexey Samsonov2015-01-061-39/+3
| | | | | | | | | | | | | | | | | Summary: Introduce a single place where we specify flag type, name, default value, and description. This removes a large amount of boilerplate and ensures we won't leave flags uninitialized. Test Plan: regression test suite Reviewers: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6851 llvm-svn: 225239
* Revert "Revert r224736: "[Sanitizer] Make CommonFlags immutable after ↵Alexey Samsonov2015-01-021-1/+13
| | | | | | | | | | | | | | | | initialization."" Fix test failures by introducing CommonFlags::CopyFrom() to make sure compiler doesn't insert memcpy() calls into runtime code. Original commit message: 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. llvm-svn: 225088
* Revert r224736: "[Sanitizer] Make CommonFlags immutable after initialization."Chandler Carruth2015-01-021-11/+1
| | | | | | | | | | We've got some internal users that either aren't compatible with this or have found a bug with it. Either way, this is an isolated cleanup and so I'm reverting it to un-block folks while we investigate. Alexey and I will be working on fixing everything up so this can be re-committed soon. Sorry for the noise and any inconvenience. llvm-svn: 225079
* [asan] add flag coverage_pcs. When false, the coverage is not dumped as PCs. ↵Kostya Serebryany2014-12-301-0/+1
| | | | | | Useful e.g. if the user only needs coverage is bitset llvm-svn: 225002
* [asan] change the coverage collection scheme so that we can easily emit ↵Kostya Serebryany2014-12-231-0/+1
| | | | | | coverage for the entire process as a single bit set, and if coverage_bitset=1 actually emit that bitset llvm-svn: 224789
* [Sanitizer] Make CommonFlags immutable after initialization.Alexey Samsonov2014-12-221-1/+11
| | | | | | | | | | | | | | | | | | | 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
* [Sanitizer] Refactor CommonFlags interface. NFC.Alexey Samsonov2014-12-191-3/+12
| | | | | | | | | | 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] new flag: hard_rss_limit_mbKostya Serebryany2014-12-161-0/+1
| | | | llvm-svn: 224353
* [Sanitizer] Introduce "stack_trace_format" runtime flag.Alexey Samsonov2014-11-061-0/+1
| | | | | | | | | | | | | | | | This flag can be used to specify the format of stack frames - user can now provide a string with placeholders, which should be printed for each stack frame with placeholders replaced with actual data. For example "%p" will be replaced by PC, "%s" will be replaced by the source file name etc. "DEFAULT" value enforces default stack trace format currently used in all the sanitizers except TSan. This change also implements __sanitizer_print_stack_trace interface function in TSan. llvm-svn: 221469
* Add runtime flag 'symbolize_inline_frames' to disable symbolization of ↵Alexey Samsonov2014-10-241-0/+1
| | | | | | inlined frames done in llvm-symbolizer llvm-svn: 220582
* [asan] Add fast_unwind_on_check flag.Evgeniy Stepanov2014-10-141-0/+1
| | | | | | | | | Allows to specify the unwinder to use for CHECK failures. Previous behaviour was to use the "fatal" unwinder. As compiler-rt is built without frame pointers, only the slow unwinder really makes sense here, and it is the default. llvm-svn: 219677
* Revert r217616. Problems and complexity it introduces negate its benefitAlexey Samsonov2014-09-121-3/+0
| | | | llvm-svn: 217652
* [UBSan] Parse common flags from UBSAN_OPTIONS runtime variable even ifAlexey Samsonov2014-09-111-0/+3
| | | | | | UBSan is combined with ASan. llvm-svn: 217616
* [Sanitizer] Make disable_coredump a common flag and use it in TSanAlexey Samsonov2014-08-121-0/+1
| | | | llvm-svn: 215479
* [Sanitizer] Make "suppressions" and "print_suppressions" common runtime flags.Alexey Samsonov2014-07-301-0/+2
| | | | | | No functionality change. llvm-svn: 214343
* [sanitizer] Add coverage_dir flag.Evgeniy Stepanov2014-05-291-0/+1
| | | | llvm-svn: 209815
* [asancov] Write coverage directly to a memory-mapped file.Evgeniy Stepanov2014-05-271-0/+1
| | | | | | | | | | | This way does not require a __sanitizer_cov_dump() call. That's important on Android, where apps can be killed at arbitrary time. We write raw PCs to disk instead of module offsets; we also write memory layout to a separate file. This increases dump size by the factor of 2 on 64-bit systems. llvm-svn: 209653
* [asan] Respect personality in kernel area detector, patch by Yuri GribovKostya Serebryany2014-05-141-0/+1
| | | | llvm-svn: 208760
* [asan] Move the "coverage" flag to common flags.Sergey Matveev2014-05-121-0/+1
| | | | | | The implementation lives in sanitizer_common and will need to access that flag. llvm-svn: 208566
* [asan] added internal flag mmap_limit_mbKostya Serebryany2014-04-141-0/+1
| | | | llvm-svn: 206178
* [asan] fix a leak in __tls_get_addr handler; introduce a run-time flag to ↵Kostya Serebryany2014-04-041-0/+1
| | | | | | disable this handler completely; remove a workaround for a bug fixed in glibc llvm-svn: 205617
* [libsanitizer] Add descriptions for the common flags.Alexander Potapenko2014-03-211-35/+0
| | | | | | | Use new(allocator_for_flags) instead of allocator_for_flags.Allocate() Fix the description output format a bit. llvm-svn: 204484
* [libsanitizer] Introduce flag descriptions.Alexander Potapenko2014-03-201-4/+11
| | | | | | | | | Extend ParseFlag to accept the |description| parameter, add dummy values for all existing flags. As the flags are parsed their descriptions are stored in a global linked list. The tool can later call __sanitizer::PrintFlagDescriptions() to dump all the flag names and their descriptions. Add the 'help' flag and make ASan, TSan and MSan print the flags if 'help' is set to 1. llvm-svn: 204339
* tsan: yet another attempt to fix pthread_cond interceptorsDmitry Vyukov2014-03-171-0/+2
| | | | | | | | | | | Make behavior introduced in r202820 conditional (under legacy_pthread_cond flag). The new issue that we've hit with the satellite pthread_cond_t struct is that pthread_condattr_getpshared does not work (satellite data is not shared between processes). The idea is that most processes do not use pthread 2.2.5. The rare ones that use (2.2.5 is dated by 2002) must specify legacy_pthread_cond=1 on their own risk. llvm-svn: 204032
* [sanitizer] Add a flag to enable/disable report colorization.Evgeniy Stepanov2014-02-261-0/+2
| | | | llvm-svn: 202249
* [sanitizer] add iterators to bit vectors; make bit vector operations use ↵Kostya Serebryany2014-02-141-0/+2
| | | | | | little stack; add common flag 'detect_deadlocks' llvm-svn: 201405
* [sanitizer] Use mmap to zero-fill large shadow regions.Evgeniy Stepanov2014-02-141-0/+4
| | | | | | | | | | This is covered by existing ASan test. This does not change anything for TSan by default (but provides a flag to change the threshold size). Based on a patch by florent.bruneau here:   https://code.google.com/p/address-sanitizer/issues/detail?id=256 llvm-svn: 201400
* [Sanitizer] Teach external symbolizer to work with addr2line if ↵Alexey Samsonov2014-02-121-0/+4
| | | | | | llvm-symbolizer is unavailable. Allow this mode in TSan. llvm-svn: 201218
* tsan: fix Go buildDmitry Vyukov2014-01-311-2/+2
| | | | | | Go linker does not like function-static objects. llvm-svn: 200534
* [ASan] Move the signal handling-related flags to sanitizer_common.Alexander Potapenko2014-01-281-0/+8
| | | | | | This change is a part of refactoring intended to have common signal handling behavior in all tools. llvm-svn: 200295
* Sanitize printf functions.Alexey Samsonov2014-01-211-0/+2
| | | | | | | | | | Intercept and sanitize arguments passed to printf functions in ASan and TSan (don't do this in MSan for now). The checks are controlled by runtime flag (off by default for now). Patch http://llvm-reviews.chandlerc.com/D2480 by Yuri Gribov! llvm-svn: 199729
* [Sanitizer] Always initialize a Symbolizer (even if 'symbolize' is false).Alexey Samsonov2013-12-171-2/+4
| | | | | | | | | If 'symbolize' flag is not set, we still want to transform virtual address to module+offset pair in the call to Symbolizer::SymbolizeCode(). See https://code.google.com/p/address-sanitizer/issues/detail?id=251 for more details. llvm-svn: 197491
* tsan: fix flags parsingDmitry Vyukov2013-11-271-2/+2
| | | | | | | | - running_on_valgrind was not parsed in some contexts - refactor code a bit - add comprehensive tests for flags parsing llvm-svn: 195831
* [Sanitizer] Improve external symbolizer behavior.Alexey Samsonov2013-11-261-1/+2
| | | | | | | | | 1) Don't start external symbolizer subprocess until we actually try to symbolize anything. 2) Allow to turn off external symbolizer by providing empty ?SAN_SYMBOLIZER_PATH environment variable. llvm-svn: 195771
* [Sanitizer] Add print_summary runtime flag to disable error summaries (UBSan ↵Alexey Samsonov2013-11-141-0/+2
| | | | | | doesn't need them) llvm-svn: 194685
* [Sanitizer] Specify a default value for each common runtime flagAlexey Samsonov2013-11-121-0/+1
| | | | llvm-svn: 194479
* tsan: move verbosity flag to CommonFlagsDmitry Vyukov2013-10-151-0/+2
| | | | llvm-svn: 192701
* tsan: use sanitizer::CommonFlags in tsanDmitry Vyukov2013-10-151-4/+5
| | | | llvm-svn: 192692
* [sanitizer] make the allocator crash instead of returning 0 on huge size ↵Kostya Serebryany2013-09-061-0/+2
| | | | | | (controlled by the allocator_may_return_null flag) llvm-svn: 190127
* [lsan] Add leak_check_at_exit flag.Sergey Matveev2013-08-011-0/+4
| | | | | | | | We needed a way to tell LSan to invoke leak checking only if __do_leak_check() is called explicitly. This can now be achieved by setting leak_check_at_exit=false. llvm-svn: 187578
OpenPOWER on IntegriCloud