summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* [Sanitizer] Try to fix sanitizer_libc_test on FreeBSD.Alexey Samsonov2015-07-311-8/+3
| | | | llvm-svn: 243797
* [asan] Only link liblog on Android when it exists.Evgeniy Stepanov2015-07-241-1/+1
| | | | | | With r242975, liblog is only used on certain older platforms. llvm-svn: 243139
* [sanitizer] Implement logging to syslog.Evgeniy Stepanov2015-07-231-1/+2
| | | | | | | | | | | | | | | | | Previously, Android target had a logic of duplicating all sanitizer output to logcat. This change extends it to all posix platforms via the use of syslog, controlled by log_to_syslog flag. Enabled by default on Android, off everywhere else. A bit of cmake magic is required to allow Printf() to call a libc function. I'm adding a stub implementation to support no-libc builds like dfsan and safestack. This is a second attempt. I believe I've fixed all the issues that prompted the revert: Mac build, and all kinds of non-CMake builds (there are 3 of those). llvm-svn: 243051
* Revert r242975.Evgeniy Stepanov2015-07-231-2/+1
| | | | | | Breaks Mac build. llvm-svn: 242978
* [sanitizer] Implement logging to syslog.Evgeniy Stepanov2015-07-221-1/+2
| | | | | | | | | | | | | Previously, Android target had a logic of duplicating all sanitizer output to logcat. This change extends it to all posix platforms via the use of syslog, controlled by log_to_syslog flag. Enabled by default on Android, off everywhere else. A bit of cmake magic is required to allow Printf() to call a libc function. I'm adding a stub implementation to support no-libc builds like dfsan and safestack. llvm-svn: 242975
* [asan] Fix sanitizer_allocator_test on AArch64.Evgeniy Stepanov2015-07-171-0/+2
| | | | llvm-svn: 242582
* [asan] Fix SanitizerCommon.PthreadDestructorIterations test on Android L.Evgeniy Stepanov2015-06-291-2/+2
| | | | | | | On Android L, TSD destructors run 8 times instead of 4. Back to 4 times on the current master branch (as well as on K). llvm-svn: 240992
* [asan] Link sanitizer_common tests on Android as -pie.Evgeniy Stepanov2015-06-261-0/+4
| | | | llvm-svn: 240825
* [sanitizer_common] Added VS-style output for source locationsFilipe Cabecinhas2015-06-041-14/+44
| | | | | | | | | | | | | | | | | | | | | Summary: With this patch, we have a flag to toggle displaying source locations in the regular style: file:line:column or Visual Studio style: file(line,column) This way, they get picked up on the Visual Studio output window and one can double-click them to get to that file location. Reviewers: samsonov, rnk Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10113 llvm-svn: 239000
* Add descriptive names to sanitizer entries in /proc/self/maps. Helps debugging.Evgeniy Stepanov2015-05-291-0/+1
| | | | | | | | | | | | | | | | | | 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
* Disable exceptions with Clang on Windows in lib/sanitizer-common/testsReid Kleckner2015-05-051-2/+7
| | | | | | | While I'm here, fix a copy-paste bug so we get debug info for these tests. llvm-svn: 236505
* Split Mprotect into MmapNoAccess and MprotectNoAccess to be more portableTimur Iskhodzhanov2015-04-101-1/+1
| | | | | | | 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
* Move more POSIX-specific functions to sanitizer_posix.hTimur Iskhodzhanov2015-04-091-0/+1
| | | | llvm-svn: 234482
* Introduce CloseFile to be used instead of internal_close on non-POSIXTimur Iskhodzhanov2015-04-091-3/+3
| | | | llvm-svn: 234481
* Move some POSIX-specific functions from sanitizer_libc.h to a new ↵Timur Iskhodzhanov2015-04-081-1/+1
| | | | | | sanitizer_posix.h llvm-svn: 234418
* [Sanitizers] Make OpenFile more portableTimur Iskhodzhanov2015-04-081-10/+7
| | | | llvm-svn: 234410
* [ASan] Unify handling of loaded modules between POSIX and WindowsTimur Iskhodzhanov2015-04-061-3/+1
| | | | | | Reviewed at http://reviews.llvm.org/D8805 llvm-svn: 234150
* [sanitizer] Fix file access modes in SanitizerCommon.InternalMmapWithOffset ↵Alexander Potapenko2015-03-231-2/+2
| | | | | | and SanitizerCommon.FileOps llvm-svn: 232972
* [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
* Adding the implementation of atos and dladdr symbolizers for OS X.Kuba Brecka2015-03-121-0/+9
| | | | | | | | 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
* [asan] more fixes for x32, patches by H.J. LuKostya Serebryany2015-03-031-11/+11
| | | | llvm-svn: 231174
* Symbolizer refactoring: ExtractToken and friendsKuba Brecka2015-03-022-0/+50
| | | | | | Reviewed at http://reviews.llvm.org/D7867 llvm-svn: 231027
* asan: fix signal handling during stoptheworldDmitry Vyukov2015-03-021-0/+10
| | | | | | | | | | | 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
* [Sanitizer] Refactor SuppressionContext class.Alexey Samsonov2015-02-201-73/+33
| | | | | | | | | | | | | | 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
* [LSan] [MIPS] adding support of LSan for mips64/mips64el archMohit K. Bhakkad2015-02-191-0/+8
| | | | | | | | | | | | Patch by Sagar Thakur Reviewers: petarj, earthdok, kcc. Subscribers: samsonov, dsanders, mohit.bhakkad, Anand.Takale, llvm-commits. Differential Revision: http://reviews.llvm.org/D7013 llvm-svn: 229830
* Revert "Remove unused function."Alexey Samsonov2015-01-311-0/+8
| | | | | | This reverts commit r227633. SetEnv was prematurely deleted. llvm-svn: 227665
* Remove unused function.Alexey Samsonov2015-01-301-8/+0
| | | | llvm-svn: 227633
* [sanitizer] Make unrecognized flags not fatal.Evgeniy Stepanov2015-01-191-2/+7
| | | | | | Print a warning at verbosity=1 and higher instead of dying immediately. llvm-svn: 226458
* [sanitizer] Flag parser rewrite.Evgeniy Stepanov2015-01-151-25/+55
| | | | | | | 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
* Fix memory leaks in GetListOfModules() users.Alexey Samsonov2015-01-081-0/+1
| | | | llvm-svn: 225472
* [Sanitizers] Fix internal_lseek() to work on FreeBSDViktor Kutuzov2015-01-081-2/+5
| | | | | | Differential Revision: http://reviews.llvm.org/D6825 llvm-svn: 225443
* Remove TSAN_DEBUG in favor of SANITIZER_DEBUG.Alexey Samsonov2015-01-032-3/+3
| | | | llvm-svn: 225111
* [sanitizer] Treat \r, \n, \t as flag separators.Evgeniy Stepanov2014-12-261-0/+3
| | | | llvm-svn: 224858
* [sanitizer] Disable InternalMmapWithOffset test on OSX.Evgeniy Stepanov2014-12-241-1/+1
| | | | llvm-svn: 224822
* [sanitizer] Disable InternalMmapWithOffset test on Windows.Evgeniy Stepanov2014-12-241-0/+3
| | | | llvm-svn: 224820
* [sanitizer] mmap2 syscall works with 4096-byte units instead of bytes.Evgeniy Stepanov2014-12-241-18/+46
| | | | | | Ouch. llvm-svn: 224819
* [Sanitizers] Intercept snprintf_l() on FreeBSDViktor Kutuzov2014-12-221-0/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D6418 llvm-svn: 224700
* [Sanitizer] Refactor CommonFlags interface. NFC.Alexey Samsonov2014-12-191-0/+18
| | | | | | | | | | 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
* [Sanitizer] Introduce Allocator::may_return_null bool flag.Alexey Samsonov2014-12-121-11/+7
| | | | | | | | | | | | | | | | | | | | Summary: Turn "allocator_may_return_null" common flag into an Allocator::may_return_null bool flag. We want to make sure that common flags are immutable after initialization. There are cases when we want to change this flag in the allocator at runtime: e.g. in unit tests and during ASan activation on Android. Test Plan: regression test suite, real-life applications Reviewers: kcc, eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6623 llvm-svn: 224148
* [mips] [test] Enable COMPILER_RT_INCLUDE_TESTS for MIPSKumar Sukhani2014-12-123-35/+31
| | | | | | | | Enabling COMPILER_RT_INCLUDE_TESTS and updating tests/sanitizer_allocator_test.cc to remove Allocator64 related tests for MIPS. Reviewed By: samsonov llvm-svn: 224101
* Implement AddressSanitizer suppressions.Kuba Brecka2014-12-051-1/+9
| | | | | | | | Adds 3 new suppression types, "interceptor_name", "interceptor_via_fun", "interceptor_via_lib". Reviewed at http://reviews.llvm.org/D6280. llvm-svn: 223508
* Add a HasSuppressionType method into SuppressionContextKuba Brecka2014-11-291-0/+10
| | | | | | | | Extending SuppressionContext to add a HasSuppressionType method that tells whether a certain suppression type is currently used or not. It's a step to implement issue suppressions for ASan, see http://reviews.llvm.org/D6280. Reviewed at http://reviews.llvm.org/D6443 llvm-svn: 222954
* [Sanitizer] Introduce generic stack frame rendering machineryAlexey Samsonov2014-11-053-36/+123
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Change StackDepot interface to use StackTrace more extensivelyAlexey Samsonov2014-10-261-27/+33
| | | | llvm-svn: 220637
* [Sanitizer] Make StackTrace a lightweight reference to array of PCs, andAlexey Samsonov2014-10-262-26/+21
| | | | | | | | | | | | | | | | | | | | | | introduce a BufferedStackTrace class, which owns this array. Summary: This change splits __sanitizer::StackTrace class into a lightweight __sanitizer::StackTrace, which doesn't own array of PCs, and BufferedStackTrace, which owns it. This would allow us to simplify the interface of StackDepot, and eventually merge __sanitizer::StackTrace with __tsan::StackTrace. Test Plan: regression test suite. Reviewers: kcc, dvyukov Reviewed By: dvyukov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5985 llvm-svn: 220635
* Fix checks for Android.Dan Albert2014-10-201-2/+2
| | | | | | | | | | | | __ANDROID__ is a define that comes from the toolchain when building for Android targets. ANDROID has a different meaning. ANDROID is defined for _every_ Android build, including those done for host modules. For host modules, we want to build the regular Linux sanitizers and builtins, not the one for Android devices. This hasn't been a problem until now because we only just started building the sanitizers for the host. llvm-svn: 220203
* [compiler-rt] compiler-rt's CMake append_if function clashes with LLVM's, ↵Kuba Brecka2014-10-151-4/+4
| | | | | | | | | | let's rename it to append_list_if Doing s/append_if/append_list_if/, no functional change. http://reviews.llvm.org/D5739 llvm-svn: 219860
* [sanitizer] Fix a crash in FP unwinder on ARM.Evgeniy Stepanov2014-10-141-5/+32
| | | | | | | | | | | | | This change fixes 2 issues in the fast unwinder from r217079: * A crash if a frame pointer points below current stack head, but inside the current thread stack limits. That memory may be unmapped. A check for this was lost in r217079. * The last valid stack frame (the first one with an invalid next frame pointer) is always interpreted as a GCC layout frame. This results in garbled last PC in the (expected) case when the last frame has LLVM layout. llvm-svn: 219683
* [sanitizer] Android build cleanup.Evgeniy Stepanov2014-09-291-16/+22
| | | | | | | | | | | | * Detect Android toolchain target arch and set correct runtime library name. * Merged a lot of Android and non-Android code paths. * Android is only supported in standalone build of compiler-rt now. * Linking lsan-common in ASan-Android (makes lsan annotations work). * Relying on -fsanitize=address linker flag when building tests (again, unification with non-Android path). * Runtime library moved from lib/asan to lib/linux. llvm-svn: 218605
* PR20721: Don't let UBSan print inaccessible memoryAlexey Samsonov2014-09-171-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud