summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* [Sanitizer coverage] Print out the error number if OpenFile failsTimur Iskhodzhanov2015-04-231-2/+4
| | | | llvm-svn: 235593
* Split Mprotect into MmapNoAccess and MprotectNoAccess to be more portableTimur Iskhodzhanov2015-04-101-2/+3
| | | | | | | On Windows, we have to know if a memory to be protected is mapped or not. On POSIX, Mprotect was semantically different from mprotect most people know. llvm-svn: 234602
* [ASan/Win] Add more support for file operationsTimur Iskhodzhanov2015-04-091-1/+1
| | | | llvm-svn: 234494
* Use WriteToFile instead of internal_write in non-POSIX codeTimur Iskhodzhanov2015-04-091-13/+13
| | | | llvm-svn: 234487
* Introduce CloseFile to be used instead of internal_close on non-POSIXTimur Iskhodzhanov2015-04-091-9/+9
| | | | llvm-svn: 234481
* Replace a hard-coded constant with a named oneTimur Iskhodzhanov2015-04-091-1/+1
| | | | llvm-svn: 234479
* Move some POSIX-specific functions from sanitizer_libc.h to a new ↵Timur Iskhodzhanov2015-04-081-5/+5
| | | | | | sanitizer_posix.h llvm-svn: 234418
* [Sanitizers] Make OpenFile more portableTimur Iskhodzhanov2015-04-081-27/+26
| | | | llvm-svn: 234410
* [sancov] Shrink pc array on Android back to 2**24.Evgeniy Stepanov2015-04-031-1/+2
| | | | | | Address space is a lot more constrained on 32-bit Android compared to Linux. llvm-svn: 234010
* [ASan/Win] Minor improvements towards enabling coverageTimur Iskhodzhanov2015-04-021-2/+0
| | | | llvm-svn: 233918
* [Sanitizer] Be consistent about separating ==%PID== and logged data.Alexey Samsonov2015-03-311-2/+2
| | | | | | See https://code.google.com/p/address-sanitizer/issues/detail?id=385. llvm-svn: 233720
* [Sanitizer RT] Put the Symbolizer module name string ownership in orderTimur Iskhodzhanov2015-03-311-5/+3
| | | | | | Reviewed at http://reviews.llvm.org/D8666 llvm-svn: 233687
* [Sanitizers coverage] Minor cleanup: reduce scope and visibility of one ↵Timur Iskhodzhanov2015-03-251-6/+6
| | | | | | method and one variable llvm-svn: 233212
* [sanitizer] instead of comparing pointers to module_names while initializing ↵Kostya Serebryany2015-03-231-10/+12
| | | | | | coverage do a proper strcmp and strdup. NFC llvm-svn: 233037
* [ASan] Distinguish between read, write and read-write file access modes in ↵Alexander Potapenko2015-03-231-3/+3
| | | | | | | | OpenFile. This is to fix mapping coverage files into memory on OSX. llvm-svn: 232936
* [sanitizer] change the sanitizer coverage format once again, this time ↵Kostya Serebryany2015-03-181-6/+22
| | | | | | adding a magic to the beginning of the file llvm-svn: 232679
* [sanitizer] add run-time a flag coverage_order_pcs. When true, the PCs are ↵Kostya Serebryany2015-03-181-6/+38
| | | | | | dumped in the order of their appearance llvm-svn: 232573
* [sanitizer] change the format of coverage dump: instead of always dumping ↵Kostya Serebryany2015-03-171-5/+4
| | | | | | 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
* [sanitizer] fix instrumentation with -mllvm ↵Kostya Serebryany2015-03-101-1/+2
| | | | | | -sanitizer-coverage-block-threshold=0 to actually do something useful. llvm-svn: 231736
* [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
* [sanitizer] add a run-time flag to dump the coverage counter bitsetKostya Serebryany2015-03-051-0/+24
| | | | llvm-svn: 231343
* [sanitizer] when dumping coverage bitset, dump seperate file for every ↵Kostya Serebryany2015-03-041-25/+58
| | | | | | module, instead of dumping a single combined bitset llvm-svn: 231319
* [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
* [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] add another workaround for PR 17409: when over a threshold emit ↵Kostya Serebryany2015-02-041-0/+5
| | | | | | coverage instrumentation as calls. llvm-svn: 228102
* [Sanitizers] Re-apply the fix ordering initialization of coverage and guard ↵Viktor Kutuzov2015-02-021-1/+3
| | | | | | | | | arrays Original commit: http://reviews.llvm.org/rL226440 Related review: http://reviews.llvm.org/D6892 llvm-svn: 227789
* [sanitizer] allow to reset the bb/edge coverage data inside the process ↵Kostya Serebryany2015-01-281-2/+21
| | | | | | while it is running (single-threaded). Also expose the current coverage set to the process. llvm-svn: 227387
* Revert r226440.Evgeniy Stepanov2015-01-271-3/+1
| | | | | | It was fixed the right way in r227195. llvm-svn: 227196
* [Sanitizers] Order initialization of coverage and guard arraysViktor Kutuzov2015-01-191-1/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D6892 llvm-svn: 226440
* [asan] Fix uninit in coverage.Evgeniy Stepanov2015-01-121-6/+30
| | | | | | | pc_fd was not initialized to (-1) on some code paths, resulting in the program erroneously closing stdin when reinitializing coverage. llvm-svn: 225637
* [asan/tracing] write the trace using a sequence of internal_write calls ↵Kostya Serebryany2015-01-061-13/+23
| | | | | | instead of just one (otherwise files of > 2Gb are trunkated). Also a minor adjustment to the trace collection. llvm-svn: 225230
* [asan/tracing] extend the test a bit more, simplify the tracing code, add a ↵Kostya Serebryany2015-01-031-8/+17
| | | | | | guard page to trace array, fix the trace IDs before dumping llvm-svn: 225108
* [asan] simplify the tracing code, make it use the same guard variables as ↵Kostya Serebryany2015-01-031-43/+17
| | | | | | coverage llvm-svn: 225103
* [asan] fix coverage between fork() and exec(): reinitialize the guards after ↵Kostya Serebryany2014-12-301-4/+20
| | | | | | fork() llvm-svn: 225016
* [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 _sanitizer_cov_module_init to accept int* instead of int**Kostya Serebryany2014-12-301-8/+11
| | | | llvm-svn: 224999
* [asan] Bump coverage size limit on 32-bit platforms.Evgeniy Stepanov2014-12-261-1/+1
| | | | | | | This increases the limit from 4M locations to 16M, reserving 64Mb virtual memory. Chrome has >5M unique coverage locations with coverage=3. llvm-svn: 224855
* [asan] Allow enabling coverage at activation.Evgeniy Stepanov2014-12-261-33/+63
| | | | | | | | This is a re-commit of r224838 + r224839, previously reverted in r224850. Test failures were likely (still can not reproduce) caused by two lit tests using the same name for an intermediate build target. llvm-svn: 224853
* Revert r224838, r224839.Evgeniy Stepanov2014-12-261-63/+33
| | | | | | Flaky failures on the build bots. llvm-svn: 224850
* [asan] Disable __sanitizer_cov_dump registration on Windows.Evgeniy Stepanov2014-12-251-0/+2
| | | | | | Looks like we can't use atexit() during ASan initialization on Windows. llvm-svn: 224839
* [asan] Allow enabling coverage at activation.Evgeniy Stepanov2014-12-251-33/+61
| | | | llvm-svn: 224838
* [sanitizer] Fix off-by-8x in direct coverage.Evgeniy Stepanov2014-12-241-2/+5
| | | | | | File mapping offset was calculated by offsetting (uptr *) instead of (char *). llvm-svn: 224821
* [asan] change the coverage collection scheme so that we can easily emit ↵Kostya Serebryany2014-12-231-23/+64
| | | | | | coverage for the entire process as a single bit set, and if coverage_bitset=1 actually emit that bitset llvm-svn: 224789
* [sanitizer] fix a performance regression in sanitizer coverage: move a small ↵Kostya Serebryany2014-12-201-3/+3
| | | | | | perf-critical function to a header. ALso set the coverage guard to 1 before the early return from CoverageData::Add llvm-svn: 224660
* Replace InternalScopedBuffer<char> with InternalScopedString where applicable.Alexey Samsonov2014-12-021-13/+11
| | | | | | | | | | | | | | | | Summary: No functionality change. Test Plan: make check-all Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6472 llvm-svn: 223164
* [Sanitizer] Bump kMaxPathLength to 4096 and use it more extensively instead ↵Alexey Samsonov2014-11-261-4/+4
| | | | | | of hardcoded constants llvm-svn: 222803
* [asan/coverage] change the way asan coverage instrumentation is done: ↵Kostya Serebryany2014-11-241-9/+14
| | | | | | instead of setting the guard to 1 in the generated code, pass the pointer to guard to __sanitizer_cov and set it there. No user-visible functionality change expected llvm-svn: 222675
* [asan] initial support for experimental basic-block tracing; also add tests ↵Kostya Serebryany2014-11-191-0/+97
| | | | | | for various levels of -fsanitize-coverage llvm-svn: 222291
OpenPOWER on IntegriCloud