summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_common.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* Reapply r201910. MSVC gets __func__ defined explicitly, even though itJoerg Sonnenberger2014-02-261-1/+1
| | | | | | can't build anything here. llvm-svn: 202297
* Revert "Replace __FUNCTION__ with __func__, the latter being standard ↵Reid Kleckner2014-02-221-1/+1
| | | | | | | | | | | | C99/C++11." This reverts commit r201910. While __func__ may be standard in C++11, it was only recently added to MSVC in 2013 CTP, and LLVM supports MSVC 2012. __FUNCTION__ may not be standard, but it's *very* portable. llvm-svn: 201916
* Replace __FUNCTION__ with __func__, the latter being standard C99/C++11.Joerg Sonnenberger2014-02-211-1/+1
| | | | llvm-svn: 201910
* [Sanitizer] Replace Symbolizer::IsAvailable and ↵Alexey Samsonov2013-12-251-1/+1
| | | | | | | | Symbolizer::IsExternalAvailable with Symbolizer::CanReturnFileLineInfo. Remove now redundant checks in symbolizer initialization in TSan and MSan. llvm-svn: 198000
* [Sanitizers] Rename Symbolizer::SymbolizeCode to Symbolizer::SymbolizePCTimur Iskhodzhanov2013-12-181-1/+1
| | | | llvm-svn: 197569
* [sanitizer] Fix log_path behavior with StopTheWorld.Sergey Matveev2013-12-041-0/+7
| | | | | | | | | | | | | | | | Summary: Fix race on report_fd/report_fd_pid between the parent process and the tracer task. Reviewers: samsonov Reviewed By: samsonov CC: llvm-commits, kcc, dvyukov Differential Revision: http://llvm-reviews.chandlerc.com/D2306 llvm-svn: 196385
* Reapply asan coverage changes 194702-194704.Bob Wilson2013-11-151-0/+11
| | | | | | | | I still don't know what is causing our bootstrapped LTO buildbots to fail, but llvm r194701 seems to be OK and I can't imagine that these changes could cause the problem. llvm-svn: 194790
* Speculatively revert asan coverage changes 194702-194704.Bob Wilson2013-11-151-11/+0
| | | | | | | | | Apple's bootstrapped LTO builds have been failing, and these changes (along with llvm 194701) are the only things on the blamelist. I will either reapply these changes or help debug the problem, depending on whether this fixes the buildbots. llvm-svn: 194779
* [asan] Poor man's coverage that works with ASan (compiler-rt part)Kostya Serebryany2013-11-141-0/+11
| | | | llvm-svn: 194702
* [Sanitizer] Print symbolized stack frame using a single Printf() call.Alexey Samsonov2013-11-141-7/+11
| | | | | | | | This reduces the number of "write" syscalls performed to print a single stack frame description, and makes sanitizer output less intermixed with program output. Also, add a number of unit tests. llvm-svn: 194686
* [Sanitizer] Add print_summary runtime flag to disable error summaries (UBSan ↵Alexey Samsonov2013-11-141-0/+6
| | | | | | doesn't need them) llvm-svn: 194685
* [Sanitizer] Fix Go buildAlexey Samsonov2013-11-011-0/+2
| | | | llvm-svn: 193873
* [Sanitizer] Unify summary reporting across all sanitizers.Alexey Samsonov2013-11-011-5/+23
| | | | | | | | | | This change unifies the summary printing across sanitizers: now each tool uses specific version of ReportErrorSummary() method, which deals with symbolization of the top frame and formatting a summary message. This change modifies the summary line for ASan+LSan mode: now the summary mentions "AddressSanitizer" instead of "LeakSanitizer". llvm-svn: 193864
* Hoist the addition of the prefix "SUMMARY: " fromNick Lewycky2013-10-231-2/+3
| | | | | | __sanitizer_report_error_summary to ReportErrorSummary. llvm-svn: 193231
* tsan: be silent if verbosity=0Dmitry Vyukov2013-10-151-1/+0
| | | | | | | Currently tests fail with: Check failed: 'AAA' == 'AAA ==26017==Could not detach from thread 361395 (errno 3).' llvm-svn: 192711
* tsan: use sanitizer::CommonFlags in tsanDmitry Vyukov2013-10-151-9/+13
| | | | llvm-svn: 192692
* Refactor the usage of strip_path_prefix option and make it more consistent ↵Alexey Samsonov2013-10-041-3/+32
| | | | | | across sanitizers llvm-svn: 191943
* [Sanitizer] Refactor symbolization interface: use class instead of several ↵Alexey Samsonov2013-09-101-0/+21
| | | | | | functions. Move some code around to get rid of extra source files llvm-svn: 190410
* sanitizers: Make sure Visual Studio gets error reportsReid Kleckner2013-09-051-33/+6
| | | | | | | | | Visual Studio appears to close stderr before launching a non-console win32 program. This means we don't see any sanitizer reports. If stderr printing fails, call OutputDebugStringA to get the reports into the Visual Studio debugger console. llvm-svn: 190030
* [sanitizer] Handle Die() in StopTheWorld.Sergey Matveev2013-08-261-2/+6
| | | | | | | | | Handle calls to Die() from the tracer thread. Fixes a bug where a CHECK could fail in the tracer thread, resulting in a call to AsanDie. The tracer thread then exited and the parent process continued execution despite its address space being in an unusable state. llvm-svn: 189216
* [nolibc] Move all platforms to internal_getpid.Peter Collingbourne2013-05-171-4/+4
| | | | | | | | | | Before, we had an unused internal_getpid function for Linux, and a platform-independent GetPid function. To make the naming conventions consistent for syscall-like functions, the GetPid syscall wrapper in sanitizer_posix.cc is moved to sanitizer_mac.cc, and GetPid is renamed to internal_getpid, bringing the Linux variant into use. llvm-svn: 182132
* [nolibc] Begin moving sanitizer_common's libc-dependent code to a separate ↵Peter Collingbourne2013-05-171-7/+2
| | | | | | | | | | | | | | | | library Introduce a new object library, RTSanitizerCommonLibc, which will contain the subset of sanitizer_common with libc dependencies. RTSanitizerCommon contains the remainder of sanitizer_common, and is intended to have no libc dependencies. Begin moving code to RTSanitizerCommonLibc, starting with sanitizer_common.cc, whose libc-dependent portion is moved to sanitizer_common_libcdep.cc, the first member of the new library. This split affects the CMake build only. The makefile build continues to produce the full sanitizer_common library. llvm-svn: 182118
* [sanitizer] Generic sorting in sanitizer_common.Sergey Matveev2013-05-131-38/+8
| | | | llvm-svn: 181698
* [nolibc] Change internal syscall API to remove reliance on libc's errno.Peter Collingbourne2013-05-081-5/+6
| | | | | | | | | | | | | This change moves to a model where the error value of a system call is potentially contained in the return value itself rather than being implicit in errno. The helper function internal_iserror can be used to extract the error value from a return value. On platforms other than Linux/x86_64 this still uses errno, but other platforms are free to port their error handling to this new model. Differential Revision: http://llvm-reviews.chandlerc.com/D756 llvm-svn: 181436
* [libsanitizer] StopTheWorld in sanitizer_commonAlexander Potapenko2013-03-151-0/+1
| | | | | | | | | | | StopTheWorld puts the process in a suspended state before running the user-supplied callback. To be used in TSan and in leak checking code. Linux implementation provided. Patch by Sergey Matveev (earthdok@google.com) llvm-svn: 177156
* [Sanitizer] use raw syscall instead of _exit() function on LinuxAlexey Samsonov2013-02-201-1/+1
| | | | llvm-svn: 175622
* [msan] add strip_path_prefix flag; print error summary; don't crash while ↵Kostya Serebryany2013-02-071-1/+1
| | | | | | printing summary if debug info is missing. The tests will follow later once we establish the lit-like tests for msan. llvm-svn: 174595
* [tsan] print error summary lineKostya Serebryany2013-02-061-1/+1
| | | | llvm-svn: 174505
* [asan] print a short one-line report summary after the full report. ↵Kostya Serebryany2013-02-061-0/+14
| | | | | | Currently, works only if symbolization happens in-process. llvm-svn: 174501
* [Sanitizer] make internal_open have the same interface as libc versionAlexey Samsonov2013-02-011-2/+2
| | | | llvm-svn: 174187
* [sanitizer] make the error messages from sanitizer_common contain the actual ↵Kostya Serebryany2013-01-311-0/+2
| | | | | | tool name llvm-svn: 174059
* Fixup for r172828: use InternalScopedBuffer in favor of large stack buffersAlexey Samsonov2013-01-201-4/+4
| | | | llvm-svn: 172975
* [ASan] Fix the log_path option to use different log files for parent and ↵Alexander Potapenko2013-01-181-9/+25
| | | | | | child processes after fork(). llvm-svn: 172828
* asan: fix format string in CHECKDmitry Vyukov2013-01-111-2/+2
| | | | llvm-svn: 172203
* [asan] more sceleton code for asan_allocator2Kostya Serebryany2012-12-111-1/+0
| | | | llvm-svn: 169836
* Add a libsanitizer API __sanitizer_sandbox_on_notify(void* reserved), which ↵Alexander Potapenko2012-12-101-0/+6
| | | | | | | | should be used by the client programs to notify the tools that sandboxing is about to be turned on. llvm-svn: 169732
* tsan: fix lint warning and make output tests more robustDmitry Vyukov2012-12-061-1/+1
| | | | llvm-svn: 169511
* Remove unused variable.Bill Wendling2012-12-061-1/+1
| | | | llvm-svn: 169485
* [tsan] add MmapAlignedOrDieKostya Serebryany2012-12-061-0/+21
| | | | llvm-svn: 169474
* [asan] get rid of some of the uses of kPageSize. The intent is to get rid of ↵Kostya Serebryany2012-11-231-3/+11
| | | | | | it completely to support platforms with multiple possible page sizes. llvm-svn: 168517
* [Sanitizer] Add internal_isatty to sanitizer_libc and PrintsToTty to ↵Alexey Samsonov2012-11-021-9/+18
| | | | | | determine whether error reports are printed to terminal llvm-svn: 167298
* [Sanitizer] move unit test for Printf from tsan to sanitizer_commonAlexey Samsonov2012-11-021-2/+0
| | | | llvm-svn: 167296
* [Sanitizer] Use kStderrFd constant instead of hardcoded 2Alexey Samsonov2012-11-021-9/+10
| | | | llvm-svn: 167291
* [Sanitizer]: add __sanitizer_set_report_fd function to alter file descriptor ↵Alexey Samsonov2012-11-021-1/+15
| | | | | | for error reports llvm-svn: 167290
* [asan] add asan option log_path=PATH to let users redirect asan reports to a ↵Kostya Serebryany2012-09-141-2/+28
| | | | | | file PATH.PID instead of stderr llvm-svn: 163872
* [Sanitizer] Get rid of dependency between sanitizer_common and asan/tsan ↵Alexey Samsonov2012-09-111-0/+27
| | | | | | runtimes: implement tool-specific Die and CheckFailed functions via callbacks llvm-svn: 163603
* [Sanitizer] implement straightforward nlogn sorting, as qsort() may call ↵Alexey Samsonov2012-07-161-13/+38
| | | | | | malloc, which leads to deadlock in ASan allocator llvm-svn: 160262
* tsan/asan: kill STLDmitry Vyukov2012-07-051-5/+13
| | | | | | | First, placement new from standard library conflicts with our own. Second, we are in trouble if user uses the same function (we either get instrumented code in runtime, or non-instrumented code in user program). llvm-svn: 159738
* [Sanitizer] move atomic ops, min/max and sort to commnon runtimeAlexey Samsonov2012-06-151-0/+8
| | | | llvm-svn: 158496
* [Sanitizer] Move ReadFileToBuffer to sanitizer_common.Alexey Samsonov2012-06-071-0/+31
| | | | llvm-svn: 158138
OpenPOWER on IntegriCloud