summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_common.h
Commit message (Collapse)AuthorAgeFilesLines
...
* asan: fix 32-bit buildDmitry Vyukov2015-06-241-1/+1
| | | | llvm-svn: 240541
* tsan: don't print external PCs in reportsDmitry Vyukov2015-06-241-0/+4
| | | | | | They are meaningless. llvm-svn: 240539
* [ASan] Make binary name reader cross-platform.Yury Gribov2015-06-041-2/+4
| | | | | | Differential Revision: http://reviews.llvm.org/D10213 llvm-svn: 239020
* Add descriptive names to sanitizer entries in /proc/self/maps. Helps debugging.Evgeniy Stepanov2015-05-291-2/+3
| | | | | | | | | | | | | | | | | | This is done by creating a named shared memory region, unlinking it and setting up a private (i.e. copy-on-write) mapping of that instead of a regular anonymous mapping. I've experimented with regular (sparse) files, but they can not be scaled to the size of MSan shadow mapping, at least on Linux/X86_64 and ext3 fs. Controlled by a common flag, decorate_proc_maps, disabled by default. This patch has a few shortcomings: * not all mappings are annotated, especially in TSan. * our handling of memset() of shadow via mmap() puts small anonymous mappings inside larger named mappings, which looks ugly and can, in theory, hit the mapping number limit. llvm-svn: 238621
* [asan] Fall back to /proc/$PID/maps on Android L.Evgeniy Stepanov2015-05-061-0/+2
| | | | | | | | dl_iterate_phdr is somewhat broken in L (see the code for details). We add runtime OS version detection and fallback to /proc/maps on L or earlier. This fixes a number of ASan tests on L. llvm-svn: 236628
* Split Mprotect into MmapNoAccess and MprotectNoAccess to be more portableTimur Iskhodzhanov2015-04-101-1/+5
| | | | | | | 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
* Use RenameFile instead of internal_rename in non-POSIX codeTimur Iskhodzhanov2015-04-091-0/+3
| | | | llvm-svn: 234490
* Use WriteToFile instead of internal_write in non-POSIX codeTimur Iskhodzhanov2015-04-091-1/+5
| | | | llvm-svn: 234487
* Use ReadFromFile instead of internal_read in non-POSIX codeTimur Iskhodzhanov2015-04-091-0/+3
| | | | llvm-svn: 234485
* Introduce CloseFile to be used instead of internal_close on non-POSIXTimur Iskhodzhanov2015-04-091-0/+1
| | | | llvm-svn: 234481
* [Sanitizer RT] Get rid of internal_isattyTimur Iskhodzhanov2015-04-081-1/+3
| | | | llvm-svn: 234423
* [Sanitizers] Make OpenFile more portableTimur Iskhodzhanov2015-04-081-4/+6
| | | | llvm-svn: 234410
* [ASan] Unify handling of loaded modules between POSIX and WindowsTimur Iskhodzhanov2015-04-061-2/+5
| | | | | | Reviewed at http://reviews.llvm.org/D8805 llvm-svn: 234150
* [Sanitizer] Plug a leak in POSIXSymbolizer::FindModuleForAddressTimur Iskhodzhanov2015-03-261-0/+1
| | | | | | | | | It was happening when we looked up a PC for a module that was dlopen'ed/dlclose'd after the last time we fetched the list of modules Reviewed at http://reviews.llvm.org/D8618 llvm-svn: 233257
* [ASan] Distinguish between read, write and read-write file access modes in ↵Alexander Potapenko2015-03-231-1/+7
| | | | | | | | OpenFile. This is to fix mapping coverage files into memory on OSX. llvm-svn: 232936
* [sanitizer] add run-time a flag coverage_order_pcs. When true, the PCs are ↵Kostya Serebryany2015-03-181-0/+3
| | | | | | dumped in the order of their appearance llvm-svn: 232573
* [sanitizer] when dumping coverage bitset, dump seperate file for every ↵Kostya Serebryany2015-03-041-0/+1
| | | | | | module, instead of dumping a single combined bitset llvm-svn: 231319
* asan: fix signal handling during stoptheworldDmitry Vyukov2015-03-021-0/+17
| | | | | | | | | | | 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
* [compiler-rt] Allow suppression file to be relative to the location of the ↵Anna Zaks2015-02-271-0/+5
| | | | | | | | | | 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-271-3/+4
| | | | llvm-svn: 230721
* [Sanitizer] Move TemplateMatch() to sanitizer_common.cc. NFC.Alexey Samsonov2015-02-191-0/+1
| | | | llvm-svn: 229923
* [Sanitizers] Move the common sanitizer interface from ↵Timur Iskhodzhanov2015-02-191-2/+3
| | | | | | | | sanitizer_internal_defs.h to a new sanitizer_interface_internal.h file Reviewed at http://reviews.llvm.org/D7758 llvm-svn: 229858
* [ASan] Add use_madv_dontdump flag.Yury Gribov2015-02-031-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D7294 llvm-svn: 227959
* Revert "Remove unused function."Alexey Samsonov2015-01-311-0/+1
| | | | | | This reverts commit r227633. SetEnv was prematurely deleted. llvm-svn: 227665
* Remove unused function.Alexey Samsonov2015-01-301-1/+0
| | | | llvm-svn: 227633
* [asan] use MADV_NOHUGEPAGE for shadow to reduce the actual memory usageKostya Serebryany2015-01-211-0/+1
| | | | llvm-svn: 226636
* [asan] Allow changing verbosity in activation flags.Evgeniy Stepanov2015-01-201-2/+10
| | | | | | | This change removes some debug output in asan_flags.cc that was reading the verbosity level before all the flags were parsed. llvm-svn: 226566
* [sanitizer] Additional error checking.Evgeniy Stepanov2015-01-161-2/+2
| | | | llvm-svn: 226279
* Fix memory leaks in GetListOfModules() users.Alexey Samsonov2015-01-081-1/+2
| | | | llvm-svn: 225472
* [Sanitizer] Remove the hardcoded limit of address ranges in LoadedModule.Alexey Samsonov2015-01-081-11/+13
| | | | | | This should fix https://code.google.com/p/address-sanitizer/issues/detail?id=368. llvm-svn: 225469
* [asan] add a flag soft_rss_limit_mbKostya Serebryany2015-01-061-0/+6
| | | | llvm-svn: 225323
* [asan] fix coverage between fork() and exec(): reinitialize the guards after ↵Kostya Serebryany2014-12-301-7/+16
| | | | | | fork() llvm-svn: 225016
* [asan] Allow enabling coverage at activation.Evgeniy Stepanov2014-12-261-1/+4
| | | | | | | | 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-4/+1
| | | | | | Flaky failures on the build bots. llvm-svn: 224850
* [asan] Allow enabling coverage at activation.Evgeniy Stepanov2014-12-251-1/+4
| | | | llvm-svn: 224838
* [asan] new flag: hard_rss_limit_mbKostya Serebryany2014-12-161-0/+4
| | | | llvm-svn: 224353
* [asan] introduce __sanitizer_set_death_callback, deprecate ↵Kostya Serebryany2014-12-151-0/+1
| | | | | | __asan_set_death_callback llvm-svn: 224286
* [Sanitizer] Fix report_path functionality:Alexey Samsonov2014-12-111-8/+27
| | | | | | | | | | | | | | | | | | | | | | | Summary: - Make sure mmap() is never called inside RawWrite function. - Wrap a bunch of standalone globals in a ReportFile object. - Make sure accesses to these globals are thread-safe. - Fix report_path functionality on Windows, where __sanitizer_set_report_path() would break program. I've started this yak shaving in order to make "CommonFlags::mmap_limit_mb" immutable. Currently we drop this flag to zero before printing an error message. Test Plan: regression test suite Reviewers: kcc, glider Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6595 llvm-svn: 224031
* [asan] move GetRSS from tsan to sanitizer_commonKostya Serebryany2014-12-091-0/+1
| | | | llvm-svn: 223730
* [Sanitizer] Bump kMaxPathLength to 4096 and use it more extensively instead ↵Alexey Samsonov2014-11-261-2/+2
| | | | | | of hardcoded constants llvm-svn: 222803
* [ASan] Get fake stack code working with GCC 4.8.2.Jay Foad2014-11-211-0/+14
| | | | | | | | | | | | | | | | | | | | | Summary: TestCases/Linux/heavy_uar_test.cc was failing on my PowerPC64 box with GCC 4.8.2, because the compiler recognised a memset-like loop and turned it into a call to memset, which got intercepted by __asan_memset, which got upset because it was being called on an address in high shadow memory. Use break_optimization to stop the compiler from doing this. Reviewers: kcc, samsonov Reviewed By: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6266 llvm-svn: 222572
* [msan] Remove MSanDR and supporting code.Evgeniy Stepanov2014-11-181-17/+0
| | | | | | | | | | MSanDR is a dynamic instrumentation tool that can instrument the code (prebuilt libraries and such) that could not be instrumented at compile time. This code is unused (to the best of our knowledge) and unmaintained, and starting to bit-rot. llvm-svn: 222232
* Removed r221896, it seems to break build in various ways.Yury Gribov2014-11-131-3/+0
| | | | llvm-svn: 221912
* [ASan] Add process basename to log name and error message to simplify ↵Yury Gribov2014-11-131-0/+3
| | | | | | | | analysis of sanitized systems logs. Reviewed at http://reviews.llvm.org/D5724 llvm-svn: 221896
* [Sanitizer] Introduce generic stack frame rendering machineryAlexey Samsonov2014-11-051-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This commit introduces function __sanitizer::RenderFrame() that allows to render the contents of AddressInfo (essentially, symbolized stack frame) using the custom format string. This function can be used to implement stack frame formatting for both ThreadSanitizer and generic StackTrace::Print(), used in another places. This paves the way towards allowing user to control the format of stack frames, obtaining them in any format he desires, and/or enforcing the consistent output from all sanitizers. Test Plan: compiler-rt test suite Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6140 llvm-svn: 221409
* [Sanitizer] Get rid of unnecessary allocations in StripModuleName. NFC.Alexey Samsonov2014-11-041-3/+2
| | | | llvm-svn: 221287
* [UBSan] Optionally report summary in UBSan error reports.Alexey Samsonov2014-09-191-1/+1
| | | | | | | By default summary is not printed if UBSan is run in a standalone mode, but is printed if it's combined with another sanitizer (like ASan). llvm-svn: 218135
* PR20721: Don't let UBSan print inaccessible memoryAlexey Samsonov2014-09-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: UBSan needs to check if memory snippet it's going to print resides in addressable memory. Similar check might be helpful in ASan with dump_instruction_bytes option (see http://reviews.llvm.org/D5167). Instead of scanning /proc/self/maps manually, delegate this check to the OS kernel: try to write this memory in a syscall and assume that memory is inaccessible if the syscall failed (e.g. with EFAULT). Fixes PR20721. Test Plan: compiler-rt test suite Reviewers: eugenis, glider Reviewed By: glider Subscribers: emaste, ygribov, llvm-commits, glider, rsmith Differential Revision: http://reviews.llvm.org/D5253 llvm-svn: 217971
* [asan] Delay system log initialization on Android.Evgeniy Stepanov2014-09-151-0/+3
| | | | | | | Writing to system log requires libc interceptors to be initialized. Fixes crashes with verbosity=1 on newer Android builds. llvm-svn: 217764
* [TSan] Share the code the setup code calling getrlim/setrlim with ↵Alexey Samsonov2014-08-121-1/+3
| | | | | | sanitizer_common llvm-svn: 215481
OpenPOWER on IntegriCloud