summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc
Commit message (Collapse)AuthorAgeFilesLines
* compiler-rt: Rename .cc file in lib/sanitizer_common to .cppNico Weber2019-07-311-121/+0
| | | | | | | | | | | See https://reviews.llvm.org/D58620 for discussion, and for the commands I ran. In addition I also ran for f in $(svn diff | diffstat | grep .cc | cut -f 2 -d ' '); do rg $f . ; done and manually updated (many) references to renamed files found by that. llvm-svn: 367463
* 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 low-hanging-fruit dead codeKostya Kortchinsky2018-04-171-8/+0
| | | | | | | | | | | | | | | | | Summary: Going through the dead code findings, the code removed in this CL appears to be pretty straightforward to remove, and seems to be some leftover from previous refactors. Reviewers: alekseyshl, eugenis Reviewed By: alekseyshl Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D45704 llvm-svn: 330190
* [ASan] Report illegal instruction exceptions in ASanReid Kleckner2016-08-031-5/+0
| | | | | | | | | | | | | | | | | | | Summary: Respect the handle_sigill common flag and handle_segv flags while we're at it. We still handle signals/exceptions differently on Unix and Windows. The installation process is tricky on Windows, and difficult to push down into sanitizer_common without concerning it with the different static/dynamic CRT models on Windows. Reviewers: kcc, etienneb Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23098 llvm-svn: 277621
* [sancov] common flags initialization.Mike Aizatsky2016-03-181-0/+6
| | | | | | | | | | | | 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-9/+36
| | | | | | | | | 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
* [asan] Read process name from /proc/self/cmdline on Linux.Evgeniy Stepanov2015-07-281-1/+1
| | | | | | | | | | Rename getBinaryBasename() to getProcessName() and, on Linux, read it from /proc/self/cmdline instead of /proc/self/exe. The former can be modified by the process. The main motivation is Android, where application processes re-write cmdline to a package name. This lets us setup per-application ASAN_OPTIONS through include=/some/path/%b. llvm-svn: 243473
* [sanitizer] Implement include_if_exists with process name substitution.Evgeniy Stepanov2015-07-211-17/+33
| | | | | | | | | 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
* [Sanitizer] Teach ReadFileToBuffer to distinguish empty file from ↵Alexey Samsonov2015-07-171-4/+3
| | | | | | | | | | | | | | | | inaccessible file. Summary: This fixes https://code.google.com/p/address-sanitizer/issues/detail?id=399 (sanitizers crash with empty suppression files). Reviewers: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11284 llvm-svn: 242594
* Use error_t rather than int in a couple of places where we handle filesTimur Iskhodzhanov2015-04-091-1/+1
| | | | llvm-svn: 234491
* tsan: add -Wno-maybe-uninitialized to mingw gcc build flagsDmitry Vyukov2015-02-181-1/+1
| | | | | | | As per discussion with David Blaikie here: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150216/260289.html llvm-svn: 229657
* tsan: fix compiler warningDmitry Vyukov2015-02-161-1/+1
| | | | | | | | mingw gcc complains: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized] Printf("Failed to read options from '%s': error %d\n", value, err); llvm-svn: 229392
* [Sanitizer] Add "final" specifier to FlagHandlerBase::Parse overrides. NFC.Alexey Samsonov2015-02-121-1/+1
| | | | llvm-svn: 228893
* [asan] Warn if unsupported flags are used at activation.Evgeniy Stepanov2015-01-201-4/+8
| | | | llvm-svn: 226563
* [sanitizer] Switch flag parsing to LowLevelAlloc.Evgeniy Stepanov2015-01-191-1/+1
| | | | | | | | | InternalAlloc is quite complex and its behavior may depend on the values of flags. As such, it should not be used while parsing flags. Sadly, LowLevelAlloc does not support deallocation of memory. llvm-svn: 226453
* [sanitizer] Adjust max read size in FlagHandlerIncludeHal Finkel2015-01-171-1/+2
| | | | | | | | | | | Setting the maximum read size in FlagHandlerInclude to 2^15 might be a good default, but causes the read to fail on systems with a page size larger than that (ReadFileToBuffer(...) will fail if the maximum allowed size is less than the value returned by GetPageSizeCached()). For example, on my PPC64/Linux system, GetPageSizeCached() returns 2^16. In case the page size is larger, use that instead. llvm-svn: 226368
* [sanitizer] Additional error checking.Evgeniy Stepanov2015-01-161-2/+3
| | | | llvm-svn: 226279
* [sanitizer] Implement include= option.Evgeniy Stepanov2015-01-151-0/+26
| | | | | | Allows loading sanitizer options from file. llvm-svn: 226175
* [sanitizer] Flag parser rewrite.Evgeniy Stepanov2015-01-151-140/+6
| | | | | | | 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-144/+7
| | | | | | | | | | | | | | | | | 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-0/+4
| | | | | | | | | | | | | | | | 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
* [asan] add flag coverage_pcs. When false, the coverage is not dumped as PCs. ↵Kostya Serebryany2014-12-301-0/+4
| | | | | | Useful e.g. if the user only needs coverage is bitset llvm-svn: 225002
* [sanitizer] Treat \r, \n, \t as flag separators.Evgeniy Stepanov2014-12-261-1/+1
| | | | llvm-svn: 224858
* [asan] change the coverage collection scheme so that we can easily emit ↵Kostya Serebryany2014-12-231-0/+4
| | | | | | coverage for the entire process as a single bit set, and if coverage_bitset=1 actually emit that bitset llvm-svn: 224789
* [sanitizer] initialize two flas in SetCommonFlagsDefaultsKostya Serebryany2014-12-191-0/+2
| | | | llvm-svn: 224645
* [Sanitizer] Refactor CommonFlags interface. NFC.Alexey Samsonov2014-12-191-73/+73
| | | | | | | | | | 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/+5
| | | | llvm-svn: 224353
* Removed r221896, it seems to break build in various ways.Yury Gribov2014-11-131-2/+2
| | | | llvm-svn: 221912
* [ASan] Add process basename to log name and error message to simplify ↵Yury Gribov2014-11-131-2/+2
| | | | | | | | analysis of sanitized systems logs. Reviewed at http://reviews.llvm.org/D5724 llvm-svn: 221896
* [Sanitizer] Introduce "stack_trace_format" runtime flag.Alexey Samsonov2014-11-061-0/+5
| | | | | | | | | | | | | | | | 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/+3
| | | | | | inlined frames done in llvm-symbolizer llvm-svn: 220582
* [asan] Add fast_unwind_on_check flag.Evgeniy Stepanov2014-10-141-0/+4
| | | | | | | | | 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-6/+0
| | | | llvm-svn: 217652
* [UBSan] Parse common flags from UBSAN_OPTIONS runtime variable even ifAlexey Samsonov2014-09-111-0/+6
| | | | | | UBSan is combined with ASan. llvm-svn: 217616
* [Sanitizer] Make disable_coredump a common flag and use it in TSanAlexey Samsonov2014-08-121-0/+5
| | | | llvm-svn: 215479
* [Sanitizer] Make "suppressions" and "print_suppressions" common runtime flags.Alexey Samsonov2014-07-301-0/+5
| | | | | | No functionality change. llvm-svn: 214343
* [Sanitizer] Remove SANITIZER_NEEDS_SEGV from shared sanitizer_common headers.Alexey Samsonov2014-07-091-0/+5
| | | | | | | | Otherwise, it can be accidentally redefined when we build specific sanitizer runtime. This definition should be provided only once - when we build sanitizer_common library. llvm-svn: 212663
* [asan] Default to memory-mapped coverage on Android.Evgeniy Stepanov2014-06-021-1/+1
| | | | | | The alternative (writing coverage at process exit) is nearly useless there. llvm-svn: 210024
* [sanitizer] Add coverage_dir flag.Evgeniy Stepanov2014-05-291-0/+4
| | | | llvm-svn: 209815
* [sanitizer] Require that options end with '='.Evgeniy Stepanov2014-05-291-2/+5
| | | | llvm-svn: 209814
* [asancov] Write coverage directly to a memory-mapped file.Evgeniy Stepanov2014-05-271-0/+5
| | | | | | | | | | | 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/+4
| | | | llvm-svn: 208760
* [asan] Move the "coverage" flag to common flags.Sergey Matveev2014-05-121-0/+4
| | | | | | The implementation lives in sanitizer_common and will need to access that flag. llvm-svn: 208566
* [asan] enable use_sigaltstack by default (this will provide verbose reports ↵Kostya Serebryany2014-04-241-1/+1
| | | | | | on stack-overflow instead of silently crashing with SEGV) llvm-svn: 207099
* [asan] enable LeakSanitizer (LSan) by default in asan. This only affects ↵Kostya Serebryany2014-04-221-1/+1
| | | | | | Linux x86_64. LSan has been used in various projects for more than half a year and we now consider it quite stable to be on by default. llvm-svn: 206896
* [sanitizer] enable check_printf by default for asan and tsan. We've been ↵Kostya Serebryany2014-04-221-1/+1
| | | | | | using this flag for a while and it seems to be stable enough for the rest of the world. llvm-svn: 206872
* [asan] added internal flag mmap_limit_mbKostya Serebryany2014-04-141-0/+3
| | | | llvm-svn: 206178
* [asan] fix a leak in __tls_get_addr handler; introduce a run-time flag to ↵Kostya Serebryany2014-04-041-0/+3
| | | | | | disable this handler completely; remove a workaround for a bug fixed in glibc llvm-svn: 205617
* Fix a VS compile-time warningTimur Iskhodzhanov2014-03-241-2/+1
| | | | | | warning C4345: behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized llvm-svn: 204597
* [libsanitizer] Add descriptions for the common flags.Alexander Potapenko2014-03-211-26/+60
| | | | | | | Use new(allocator_for_flags) instead of allocator_for_flags.Allocate() Fix the description output format a bit. llvm-svn: 204484
OpenPOWER on IntegriCloud