summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common
Commit message (Collapse)AuthorAgeFilesLines
...
* [asan] Do not unset DYLD_ROOT_PATH before calling atos on DarwinAnna Zaks2015-06-251-3/+0
| | | | | | | | | | | | | | | | | We were unsetting DYLD_ROOT_PATH before calling atos on Darwin in order to address it not working for symbolicating 32 bit binaries. (atos essentiall tries to respawn as a 32 bit binary and it's disallowed to respawn if DYLD_ROOT_PATH is set ... ) However, processes rely on having DYLD_ROOT_PATH set under certain conditions, so this is not the right fix. In particular, this always crashes when running ASanified process under the debugger in Xcode with iOS simulator, which is a very important workflow for us to support. This patch reverts the unsetting of the DYLD_ROOT_PATH. The correct fix to the misbehavior on 32-bit binaries should happen inside atos. http://reviews.llvm.org/D10722 llvm-svn: 240724
* [msan] Teach sanitizers about the PPC64 ptrace syscallJay Foad2015-06-254-9/+19
| | | | | | | | | | | | | | | | | Summary: This fixes test/msan/Linux/syscalls.cc, and should also fix the ppc64 sanitizer buildbots which are currently failing in "make check-sanitizer". Reviewers: samsonov, wschmidt, eugenis Reviewed By: eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10734 llvm-svn: 240692
* Enable memory sanitizer for PPC64Jay Foad2015-06-251-0/+2
| | | | | | | | | | | | | | | | | | Summary: This patch adds basic memory sanitizer support for PPC64. PR23219. I have further patches ready to enable it in LLVM and Clang, and to fix most of the many failing tests in check-msan. Reviewers: kcc, willschm, samsonov, wschmidt, eugenis Reviewed By: eugenis Subscribers: wschmidt, llvm-commits Differential Revision: http://reviews.llvm.org/D10648 llvm-svn: 240623
* One more change required to build the sanitizers for iOS.Chris Bieneman2015-06-242-5/+5
| | | | | | | | | | | | | | Summary: _Unwind_Backtrace is not available on iOS, so we should ifdef out the posix implementations of BufferedStackTrace::SlowUnwindStack and BufferedStackTrace::SlowUnwindStackWithContext on iOS. Reviewers: samsonov Reviewed By: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10696 llvm-svn: 240586
* asan: fix 32-bit buildDmitry Vyukov2015-06-241-1/+1
| | | | llvm-svn: 240541
* tsan: don't print external PCs in reportsDmitry Vyukov2015-06-242-1/+7
| | | | | | They are meaningless. llvm-svn: 240539
* Working on reconciling out-of-tree patches to compiler-rt for building for iOS.Chris Bieneman2015-06-231-1/+1
| | | | | | | | | | | | | | | | | | | Summary: This is one of many changes needed for compiler-rt to get it building on iOS. Darwin doesn't have _Unwind_VRS_Get, instead use _Unwind_GetIP directly. Note: this change does not enable building for iOS, as there are more changes to come. Reviewers: kubabrecka, bogner, samsonov Reviewed By: samsonov Subscribers: samsonov, llvm-commits Differential Revision: http://reviews.llvm.org/D10516 llvm-svn: 240470
* Working on reconciling out-of-tree patches to compiler-rt for building for iOS.Chris Bieneman2015-06-233-4/+13
| | | | | | | | | | | | | | | | | | | Summary: This is one of many changes needed for compiler-rt to get it building on iOS. This change ifdefs out headers and functionality that aren't available on iOS. Note: this change does not enable building for iOS, as there are more changes to come. Reviewers: glider, kubabrecka, bogner, samsonov Reviewed By: samsonov Subscribers: samsonov, llvm-commits Differential Revision: http://reviews.llvm.org/D10514 llvm-svn: 240468
* Working on reconciling out-of-tree patches to compiler-rt for building for iOS.Chris Bieneman2015-06-232-9/+37
| | | | | | | | | | | | | | | | | | | | | Summary: This is one of many changes needed for compiler-rt to get it building on iOS. This change does the following: - Don't include crt_externs on iOS (it isn't available) - Support ARM thread state objects Note: this change does not enable building for iOS, as there are more changes to come. Reviewers: glider, kubabrecka, bogner, samsonov Reviewed By: samsonov Subscribers: samsonov, aemerson, llvm-commits Differential Revision: http://reviews.llvm.org/D10510 llvm-svn: 240467
* [Sanitizers] Pass the correct arch to the symbolizer for x86_64hFrederic Riss2015-06-231-1/+3
| | | | | | | | | | | I have no idea how to directly test that as it depends on a particular (micro-)architecure of the host processor. Combined with llvm's r240339 this should fix issues people might have be seeing intermitently on Darwin haswell machines (the symbolizer would use the wrong slice of the binary, thus potentially resolving to the wrong symbol). llvm-svn: 240379
* CMake: Stop using LLVM's custom parse_arguments. NFCFilipe Cabecinhas2015-06-191-3/+3
| | | | | | | | | | | | | | | | | | | | | Summary: Use CMake's cmake_parse_arguments() instead. It's called in a slightly different way, but supports all our use cases. It's in CMake 2.8.8, which is our minimum supported version. CMake 3.0 doc (roughly the same. No direct link to 2.8.8 doc): http://www.cmake.org/cmake/help/v3.0/module/CMakeParseArguments.html?highlight=cmake_parse_arguments Since I was already changing these calls, I changed ARCH and LIB into ARCHS and LIBS to make it more clear that they're lists of arguments. Reviewers: eugenis, samsonov, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10529 llvm-svn: 240120
* [msan] Intercept fopencookie.Evgeniy Stepanov2015-06-194-0/+77
| | | | | | https://code.google.com/p/memory-sanitizer/issues/detail?id=86 llvm-svn: 240107
* [CMake] Cleanup add_compiler_rt_object_library to be platform-agnosticChris Bieneman2015-06-101-12/+17
| | | | | | | | | | | | | | | | | Summary: This change takes darwin-specific goop that was scattered around CMakeLists files and spread between add_compiler_rt_object_library and add_compiler_rt_darwin_object_library and moves it all under add_compiler_rt_object_library. The goal of this is to try to push platform handling as low in the utility functions as possible. Reviewers: rnk, samsonov Reviewed By: rnk, samsonov Subscribers: rnk, rsmith, llvm-commits Differential Revision: http://reviews.llvm.org/D10250 llvm-svn: 239498
* [asan] Fix Android build for API >= 21.Evgeniy Stepanov2015-06-081-1/+1
| | | | | | | | | | | | /code/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc:971:8: error: address of function 'dl_iterate_phdr' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] if (!dl_iterate_phdr) ~^~~~~~~~~~~~~~~ /code/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc:971:8: note: prefix with the address-of operator to silence this warning if (!dl_iterate_phdr) ^ & llvm-svn: 239321
* [ASan] Add process basename to log name and error message toYury Gribov2015-06-053-13/+29
| | | | | | | | simplify analysis of sanitized systems logs. Differential Revision: http://reviews.llvm.org/D7333 llvm-svn: 239134
* [ASan] Fix Darwin and Windows builds.Yury Gribov2015-06-042-12/+0
| | | | llvm-svn: 239027
* [ASan] Make binary name reader cross-platform.Yury Gribov2015-06-047-35/+46
| | | | | | Differential Revision: http://reviews.llvm.org/D10213 llvm-svn: 239020
* [sanitizer_common] Added VS-style output for source locationsFilipe Cabecinhas2015-06-046-25/+71
| | | | | | | | | | | | | | | | | | | | | 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
* [asan] Fix undefined MAP_NORESERVE on FreeBSD.Evgeniy Stepanov2015-06-041-0/+7
| | | | llvm-svn: 238995
* Add descriptive names to sanitizer entries in /proc/self/maps. Helps debugging.Evgeniy Stepanov2015-05-296-27/+62
| | | | | | | | | | | | | | | | | | 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
* Use sanitizer_atomic_clang.h with clang-cl instead of the MSVC variantReid Kleckner2015-05-291-1/+1
| | | | llvm-svn: 238585
* [asan] Add new(unsigned int) to ASan interface list.Evgeniy Stepanov2015-05-281-5/+12
| | | | | | | | | Also, sized-delete with size_t == unsigned int. These guys appear when building for Android with gnu-stl. Fixes a number of ASan tests in that particular configuration. llvm-svn: 238484
* Use /usr/bin/env to find pythonEd Maste2015-05-282-2/+2
| | | | | | | | | | Python may not be /usr/bin/python on some systems. For example, on FreeBSD it will be /usr/local/bin/python. Reviewers: samsonov Differential Revision: http://reviews.llvm.org/D9914 llvm-svn: 238428
* [sanitizer] More string interceptors: strstr, strcasestr, strspn, strcspn, ↵Yury Gribov2015-05-283-0/+108
| | | | | | | | | | strpbrk. Patch by Maria Guseva. Differential Revision: http://reviews.llvm.org/D9017 llvm-svn: 238406
* [sanitizer] Recognize static TLS in __tls_get_addr interceptor.Evgeniy Stepanov2015-05-163-3/+16
| | | | | | | Current code tries to find the dynamic TLS header to the left of the TLS block without checking that it's not a static TLS allocation. llvm-svn: 237495
* Include missing 'sanitizer_platform_limits_posix.h'Ismail Pazarbasi2015-05-121-0/+1
| | | | | | Unbreak Mac builds. `#include` seems to be forgotten during staging. llvm-svn: 237190
* Call system's sigfillset and sigprocmask functions from sanitizersIsmail Pazarbasi2015-05-121-0/+7
| | | | | | | | | | Reviewers: kcc, glider, dvyukov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9637 llvm-svn: 237177
* Sanitizers: Implement `GetRSS` on Mac OS XIsmail Pazarbasi2015-05-121-3/+12
| | | | | | | | | | Reviewers: kcc, glider, dvyukov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9636 llvm-svn: 237173
* [sanitizer] Update "sancov.py missing" to allow __sanitizer_cov_with_check().Sergey Matveev2015-05-121-1/+5
| | | | llvm-svn: 237149
* [Msan] Fix the if_indextoname.cc test to pass on FreeBSDViktor Kutuzov2015-05-111-1/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D9456 llvm-svn: 236999
* [asan/fuzzer] define a dummy weak __sanitizer_cov_trace_cmpKostya Serebryany2015-05-081-0/+3
| | | | llvm-svn: 236907
* Intercept scandir() on FreeBSDViktor Kutuzov2015-05-071-1/+2
| | | | | | Committed unreviewed with premission. llvm-svn: 236720
* Intercept rand_r() on FreeBSDViktor Kutuzov2015-05-071-1/+2
| | | | | | Committed unreviewed with premission. llvm-svn: 236719
* [sanitizer] Extend sancov.py to show which PCs are missing from coverage.Sergey Matveev2015-05-061-4/+41
| | | | | | | | Example usage: sancov.py print a.out.1234.sancov | sancov.py missing a.out llvm-svn: 236637
* [asan] Fall back to /proc/$PID/maps on Android L.Evgeniy Stepanov2015-05-063-4/+45
| | | | | | | | 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
* [Msan] Fix the ioctl_custom.cc test to pass on FreeBSDViktor Kutuzov2015-05-061-14/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D9459 llvm-svn: 236581
* [Msan] Fix the ifaddrs.cc test to build and pass on FreeBSDViktor Kutuzov2015-05-061-1/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D9457 llvm-svn: 236579
* [ASan][MIPS] Fix null_deref.cc test on MIPS64Sagar Thakur2015-05-061-1/+1
| | | | | | | | | | Symbol for pc used in ucontext->uc_mcontext was wrong. Reviewers: dsanders, kcc, samsonov Subscribers: llvm-commits, mohit.bhakkad, jaydeep Differential Revision: http://reviews.llvm.org/D9246 llvm-svn: 236572
* [sanitizer][MIPS] Implement clone for MIPSSagar Thakur2015-05-061-3/+63
| | | | | | | | Reviewers: kcc, samsonov, earthdok Subscribers: dsanders, jaydeep, Anand.Takale, mohit.bhakkad, llvm-commits Differential Revision: http://reviews.llvm.org/D8318 llvm-svn: 236570
* [asan] Fix dynamic-runtime tests.Evgeniy Stepanov2015-05-061-2/+3
| | | | | | | | | | They are not part of check-all :( This change adds sized-delete operators to the version list, and disables the hack that excluded versioned symbols from the dynamic list - this is not an issue in this case. llvm-svn: 236559
* [asan] Use a version script to limit the symbols exported by the ASan shared ↵Evgeniy Stepanov2015-05-051-4/+17
| | | | | | runtime library. llvm-svn: 236551
* [asan] fix IsDeadlySignalKostya Serebryany2015-05-051-2/+2
| | | | llvm-svn: 236545
* 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
* [asan] under handle_abort=1 option intercept SIGABRT in addition to ↵Kostya Serebryany2015-05-053-2/+6
| | | | | | SIGSEGV/SIGBUS. Among other things this will allow to set up a death callback for SIGABRT and thus properly handle assert() in lib/Fuzzer llvm-svn: 236474
* [asancov] Fix coverage reserving 4x the necessary amount of memory on fork.Evgeniy Stepanov2015-05-011-1/+2
| | | | llvm-svn: 236294
* [asan] Use dl_iterate_phdr on Android.Evgeniy Stepanov2015-04-281-9/+19
| | | | | | It's available on Android/ARM starting with API 21 (L). llvm-svn: 236014
* [Msan] Fix the getline.cc test to pass on FreeBSDViktor Kutuzov2015-04-282-18/+26
| | | | | | Differential Revision: http://reviews.llvm.org/D9251 llvm-svn: 235975
* [asan] Fix ASan build on Android/AArch64.Evgeniy Stepanov2015-04-272-3/+25
| | | | | | The build for aarch64 is not enabled in cmake/config-ix.cmake yet. llvm-svn: 235944
* [Msan] Fix the iconv.cc test to build and pass on FreeBSDViktor Kutuzov2015-04-252-1/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D9252 llvm-svn: 235799
* [ASan/Win] Increase the size of the PC array for coverage on WindowsTimur Iskhodzhanov2015-04-241-2/+3
| | | | llvm-svn: 235779
OpenPOWER on IntegriCloud