summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan
Commit message (Collapse)AuthorAgeFilesLines
...
* [compiler-rt] revert r218481 due to test failure on sanitizer-x86_64-linux Kuba Brecka2014-09-265-208/+24
| | | | llvm-svn: 218501
* [compiler-rt] ASan debugging API for report info extraction and locating ↵Kuba Brecka2014-09-255-24/+208
| | | | | | | | | | addresses Reviewed at http://reviews.llvm.org/D4527 This patch is part of an effort to implement a more generic debugging API, as proposed in http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-July/074656.html, with first part reviewed at http://reviews.llvm.org/D4466. Now adding several new APIs: __asan_report_present, __asan_get_report_{pc,bp,sp,address,type,size,description}, __asan_locate_address. These return whether an asan report happened yet, the PC, BP, SP, address, access type (read/write), access size and bug description (e.g. "heap-use-after-free"), __asan_locate_address takes a pointer and tries to locate it, i.e. say whether it is a heap pointer, a global or a stack, or whether it's a pointer into the shadow memory. If global or stack, tries to also return the variable name, address and size. If heap, tries to return the chunk address and size. Generally these should serve as an alternative to "asan_describe_address", which only returns all the data in text form. Having an API to get these data could allow having debugging scripts/extensions that could show additional information about a variable/expression/pointer. Test cases in test/asan/TestCases/debug_locate.cc and test/asan/TestCasea/debug_report.cc. llvm-svn: 218481
* [asan] Fix one test on Android-L.Evgeniy Stepanov2014-09-231-1/+2
| | | | | | index() is deprecated. llvm-svn: 218312
* [ASan] Introduce the dump_instruction_bytes flag to print the faulting ↵Alexander Potapenko2014-09-223-4/+35
| | | | | | | | instruction upon SIGSEGV When dump_instruction_bytes=1 and the instruction pointer doesn't point to the zero page, ASan prints 16 bytes starting at the instruction point. llvm-svn: 218243
* [asan] asan_device_setup improvements.Evgeniy Stepanov2014-09-191-1/+14
| | | | | | | | * Allow user SEGV handler if Android-L-like setup is detected. Necessary for correctness. * Change file context labels on the wrapper script to appease SELinux. llvm-svn: 218124
* [ASan] Print a hint when the program crashes accessing the zero page.Alexander Potapenko2014-09-191-0/+3
| | | | | | This may help some users figure out that the error report is valid. llvm-svn: 218123
* [asan] Initialize logfile in asan_symbolize.py to sys.stdin.Sergey Matveev2014-09-181-1/+1
| | | | llvm-svn: 218072
* [asan] Fix a bug in asan_symbolize.pySergey Matveev2014-09-181-1/+1
| | | | | | | Do not forget to add newlines between multiple symbolized lines corresponding to a single input line (i.e. inlining). llvm-svn: 218071
* [asan] Delay system log initialization on Android.Evgeniy Stepanov2014-09-151-0/+5
| | | | | | | Writing to system log requires libc interceptors to be initialized. Fixes crashes with verbosity=1 on newer Android builds. llvm-svn: 217764
* Avoid calling strtoll and atoll in asan_str_test.cc on Windows for nowEhsan Akhgari2014-09-151-15/+15
| | | | | | | | | | | | | | | | | | Summary: These two functions are unavailable on MSVC2012, which breaks building the ASAN tests with MSVC2012. Since the tests required to run these functions are disabled on Windows for now, avoid building them to fix the MSVC2012 builds. Test Plan: This is needed in order to fix building the ASAN tests with MSVC2012. Reviewers: timurrrr Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5343 llvm-svn: 217763
* [ASan/Win] Fix PR20918 -- SEH handler doesn't work with the MD runtimeTimur Iskhodzhanov2014-09-122-8/+41
| | | | llvm-svn: 217679
* [ASan/Win] Rename asan_win_uar_thunk.lib to asan_win_dynamic_runtime_thunk.libTimur Iskhodzhanov2014-09-123-35/+47
| | | | | | | | It turned out that we have to bridge more stuff between the executable and the ASan RTL DLL than just __asan_option_detect_stack_use_after_return. See PR20918 for more details. llvm-svn: 217673
* [asan] Preserve existing LD_PRELOAD setting on Android.Evgeniy Stepanov2014-09-111-1/+1
| | | | llvm-svn: 217584
* [Sanitizer] Get rid of Symbolizer::Get() and Symbolizer::GetOrNull().Alexey Samsonov2014-09-102-5/+1
| | | | | | | | | We may as well just use Symbolizer::GetOrInit() in all the cases. Don't call Symbolizer::Get() early in tools initialization: these days it doesn't do any important setup work, and we may as well create the symbolizer the first time it's actually needed. llvm-svn: 217558
* [asan] relax the assertion around array cookie load; still need to extract a ↵Kostya Serebryany2014-09-051-4/+8
| | | | | | reproducer where this assertion fails... llvm-svn: 217215
* [ASan] Remove the call to GetPageSizeCached from fast path of FastPoisonShadowAlexey Samsonov2014-09-041-3/+3
| | | | llvm-svn: 217194
* [asan] Update asan_device_setup to support Android L Preview.Evgeniy Stepanov2014-09-011-23/+42
| | | | llvm-svn: 216884
* [asan] enable poison_array_cookie backKostya Serebryany2014-08-291-1/+1
| | | | llvm-svn: 216705
* [asan] introduce __asan_load_cxx_array_cookie: check that the array cookie ↵Kostya Serebryany2014-08-282-1/+20
| | | | | | address is properly poisoned and return the cookie value. If not, return 0 to avoid infinite loop of DTORs (in case of use-after-free). Calls to this function will be inserted by clang (separate change) llvm-svn: 216692
* [asan] disable poison_array_cookie while I am investigating a false positive ↵Kostya Serebryany2014-08-281-1/+1
| | | | | | on chromium (I suspect that LLVM looses nosanitizer metadata; no test yet) llvm-svn: 216684
* [ASan/Win] Add the -Zl flag to avoid /DEFAULTLIB:libcmt directive in the ↵Timur Iskhodzhanov2014-08-281-1/+1
| | | | | | | | asan_win_uar_thunk object file This directive results in 'symbol already defined' when linking DLLs that use -MD llvm-svn: 216663
* [ASan] Whitespace fix. No functionality change.Alexander Potapenko2014-08-271-1/+1
| | | | llvm-svn: 216544
* [asan] Restore asan-rt name on linux back to pre-r216380.Evgeniy Stepanov2014-08-271-1/+7
| | | | | | | | | | There is no reason to have different library names for shared and static cases on linux. It also breaks Android where we install the shared asan-rt library into the system and should keep the old name. This change reverts most of r216380 limiting it to win32 targets only. llvm-svn: 216533
* [ASan/Win] Rename asan_dll_thunk.cc to asan_win_dll_thunk.ccTimur Iskhodzhanov2014-08-262-2/+2
| | | | llvm-svn: 216448
* [ASan/Win] Add an extra thunk.lib to handle stack-use-after-return optionTimur Iskhodzhanov2014-08-262-0/+36
| | | | | | | With this patch, "check-asan" passes all the tests with both MT and MD ASan RTL if you set COMPILER_RT_BUILD_SHARED_ASAN to ON (PR20214) llvm-svn: 216447
* [sanitizer] move mlock interceptor from asan/tsan/msan to common; no ↵Kostya Serebryany2014-08-252-44/+0
| | | | | | functionality change intended llvm-svn: 216407
* [ASan/Win] Add /DEBUG to the MD RTL link flagsTimur Iskhodzhanov2014-08-251-0/+1
| | | | llvm-svn: 216387
* [ASan] Replace CMake if/APPEND/endif with append_ifTimur Iskhodzhanov2014-08-251-4/+1
| | | | llvm-svn: 216386
* [ASan/Win] Intercept memory allocation functions in the MD CRTTimur Iskhodzhanov2014-08-252-11/+43
| | | | llvm-svn: 216382
* [ASan] Rename the ASan dynamic RTTimur Iskhodzhanov2014-08-251-1/+1
| | | | | | Reviewed at http://reviews.llvm.org/D5026 llvm-svn: 216380
* [ASan/Win] Land the trivial bits of -MD RTL support (PR20214)Timur Iskhodzhanov2014-08-222-1/+5
| | | | llvm-svn: 216265
* [ASan] Use check_library_exists to determine if libc/libstdc++ are availableTimur Iskhodzhanov2014-08-221-2/+4
| | | | llvm-svn: 216264
* Follow-up for r215436: use SIZE_T for strlen and wcslen interceptors.Alexander Potapenko2014-08-212-5/+5
| | | | llvm-svn: 216184
* [ASan] Turns out we should always intercept __cxa_throwTimur Iskhodzhanov2014-08-211-1/+1
| | | | | | | | | | | | At least check-asan works with this change. If the change breaks anything, we'll need to add: a) a comment describing why we have to use INTERCEPT_FUNCTION rather than ASAN_INTERCEPT_FUNC and b) a test case. llvm-svn: 216177
* [LSan] Parse common flags from LSAN_OPTIONS even if LSan is combined withAlexey Samsonov2014-08-181-1/+1
| | | | | | | | | | another sanitizer. A user may run both LSan and LSan+ASan. It is weird to pass path to leak suppression file (or other common sanitizer flags, like "verbosity") in "LSAN_OPTIONS" in the first case and in "ASAN_OPTIONS" in the second case. llvm-svn: 215949
* Follow-up to r215724: fix a lint warningTimur Iskhodzhanov2014-08-151-1/+1
| | | | llvm-svn: 215725
* [ASan/Win] Introduce a new macro for malloc-like function attributes; also, ↵Timur Iskhodzhanov2014-08-151-21/+27
| | | | | | clang-format the definitions of these functions llvm-svn: 215724
* [ASan/Win] We don't really need to use .CRT to call __asan_init when using -MDTimur Iskhodzhanov2014-08-151-6/+0
| | | | llvm-svn: 215719
* [ASan/Win] Remove old, unused and non-functional code that will be ↵Timur Iskhodzhanov2014-08-151-28/+1
| | | | | | re-written soon llvm-svn: 215707
* [TSan] Share the code the setup code calling getrlim/setrlim with ↵Alexey Samsonov2014-08-121-3/+1
| | | | | | sanitizer_common llvm-svn: 215481
* [Sanitizer] Make disable_coredump a common flag and use it in TSanAlexey Samsonov2014-08-122-8/+1
| | | | llvm-svn: 215479
* [Sanitizer] Kill deprecated allocator interfaces in ASan, MSan and TSan in ↵Alexey Samsonov2014-08-125-55/+0
| | | | | | | | favor of a unified interface in <sanitizer/allocator_interface.h>. llvm-svn: 215469
* [ASan] Use more appropriate return types for strlen/wcslen to avoid MSVC ↵Timur Iskhodzhanov2014-08-122-5/+5
| | | | | | warnings llvm-svn: 215436
* [ASan] Add new options for asan_symbolize.py script.Alexey Samsonov2014-08-111-16/+52
| | | | | | | | | | | | | | | | The patch adds new features in asan-symbolizer script which are helpful for using ASan on embedded systems: 1) add cross-compile prefix for binutils 2) define path to sysroot with sanitized binaries Features are enabled by command line options. The patch also extends command line interface with help option. Reviewed in http://reviews.llvm.org/D4703. Patch by Maria Guseva! llvm-svn: 215381
* Fixup Android tests build rulesAlexey Samsonov2014-08-091-1/+1
| | | | llvm-svn: 215264
* [ASan/Win] Handle SEH exceptions even with -GSTimur Iskhodzhanov2014-08-052-1/+17
| | | | | | This is a follow-up to r213654, r213656, r213667 and r213668. llvm-svn: 214861
* [asan] poison array cookies only on 64-bit archKostya Serebryany2014-08-041-0/+1
| | | | llvm-svn: 214713
* [asan] introduce __asan_poison_cxx_array_cookie. This is asan-rt part of ↵Kostya Serebryany2014-08-046-0/+20
| | | | | | PR19838 (Left OOB accesses on new[]-allocated arrays with array cookies are not detected). No tests yet. They will follow once I commit the clang part. llvm-svn: 214711
* [asan] intercept sized operator delete[]Kostya Serebryany2014-08-041-0/+5
| | | | llvm-svn: 214704
* [ASan] Use metadata to pass source-level information from Clang to ASan.Alexey Samsonov2014-08-021-1/+6
| | | | | | | | | | | | | | | | | Instead of creating global variables for source locations and global names, just create metadata nodes and strings. They will be transformed into actual globals in the instrumentation pass (if necessary). This approach is more flexible: 1) we don't have to ensure that our custom globals survive all the optimizations 2) if globals are discarded for some reason, we will simply ignore metadata for them and won't have to erase corresponding globals 3) metadata for source locations can be reused for other purposes: e.g. we may attach source location metadata to alloca instructions and provide better descriptions for stack variables in ASan error reports. No functionality change. llvm-svn: 214604
OpenPOWER on IntegriCloud