summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* [asan] Disable glibc-specific code chunk on Android.Evgeniy Stepanov2015-06-261-1/+1
| | | | | | | Fixes quarantine_size_mb.cc test on the Android bot. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240854 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Link sanitizer_common tests on Android as -pie.Evgeniy Stepanov2015-06-261-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240825 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Clean up obsolete stats.Alexey Samsonov2015-06-264-18/+6
| | | | | | | | Remove stats that we no longer collect after the allocator change. Use proper constant SizeClassMap::kNumClasses to fix potential buffer overflow (https://code.google.com/p/address-sanitizer/issues/detail?id=397). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240816 91177308-0d34-0410-b5e6-96231b3b80d8
* [libsanitizer] Delete the unused GetBinaryName() function.Alexander Potapenko2015-06-262-5/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240767 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Do not unset DYLD_ROOT_PATH before calling atos on DarwinAnna Zaks2015-06-253-7/+26
| | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240724 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240692 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Fix SetShadow for mappings at the end of the application address spaceJay Foad2015-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: On PPC64 if you disable ASLR (or run under gdb) you're likely to see mmap returning a mapping right at the end of the application address space region. This caused SetShadow to call MEM_TO_SHADOW() on the last+1 address in the region, which seems wrong to me; how can MEM_TO_SHADOW() distinguish this from the first address in the following region? Fixed by only calling MEM_TO_SHADOW() once, on the start address. Reviewers: samsonov, wschmidt, eugenis Reviewed By: eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10735 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240690 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Set minimum supported Mac OS X version to 10.9, if it wasn't ↵Alexey Samsonov2015-06-251-5/+7
| | | | | | | | | | | specified explicitly. -fsanitize=vptr is a UBSan feature that doesn't work on older Mac OS X versions, and we don't want to penalize users that use modern OS with default configuration. Those who want to target older OS versions, can specify that versions explicitly. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240688 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: fix handling of dup2 Dmitry Vyukov2015-06-255-14/+105
| | | | | | | | | | | | | | Previously tsan modelled dup2(oldfd, newfd) as write on newfd. We hit several cases where the write lead to false positives: 1. Some software dups a closed pipe in place of a socket before closing the socket (to prevent races actually). 2. Some daemons dup /dev/null in place of stdin/stdout. On the other hand we have not seen cases when write here catches real bugs. So model dup2 as read on newfd instead. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240687 91177308-0d34-0410-b5e6-96231b3b80d8
* [CFI] Run tests that use cfi diagnostic mode only if cxxabi parts of UBSan ↵Alexey Samsonov2015-06-257-0/+14
| | | | | | are available. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240671 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Disable signal_segv_handler test.Evgeniy Stepanov2015-06-251-0/+2
| | | | | | | Random failures on the bots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240668 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: merge function definition and declarationDmitry Vyukov2015-06-251-10/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240633 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable memory sanitizer for PPC64Jay Foad2015-06-257-1/+41
| | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240623 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Fix PR23539: Don't reference C++ ABI symbols prior to Mac OS 10.9.Alexey Samsonov2015-06-256-2/+23
| | | | | | | | | | | | | | | | | | | | Summary: This patch implements step 1 from https://llvm.org/bugs/show_bug.cgi?id=23539#c10 I'd appreciate if you could test it on Mac OS and verify that parts of UBSan runtime that reference C++ ABI symbols are properly excluded, and fix ASan/UBSan builds. Test Plan: regression test suite Reviewers: thakis, hans Subscribers: llvm-commits, zaks.anna, kubabrecka Differential Revision: http://reviews.llvm.org/D10621 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240617 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240586 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: fix false positive between dlopen and dl_iterate_phdrDmitry Vyukov2015-06-242-0/+95
| | | | | | | | | | | We see false reports between dlopen and dl_iterate_phdr. This happens because tsan does not see dynamic linker internal synchronization. Unpoison module names in dl_iterate_phdr callback. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240576 91177308-0d34-0410-b5e6-96231b3b80d8
* SafeStack: Add another missing header to try to fix FreeBSD build.Peter Collingbourne2015-06-241-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240564 91177308-0d34-0410-b5e6-96231b3b80d8
* SafeStack: Add #include of <stdint.h>.Peter Collingbourne2015-06-241-0/+1
| | | | | | Should fix the FreeBSD build. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240555 91177308-0d34-0410-b5e6-96231b3b80d8
* asan: fix 32-bit buildDmitry Vyukov2015-06-241-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240541 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: don't print external PCs in reportsDmitry Vyukov2015-06-246-6/+54
| | | | | | | | They are meaningless. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240539 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: fix unbounded memory consumption for large mallocsDmitry Vyukov2015-06-242-0/+45
| | | | | | | | | This happens only in corner cases, but we observed this on a real app. See the test for description of the exact scenario that lead to unbounded memory consumption. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240535 91177308-0d34-0410-b5e6-96231b3b80d8
* Update SafeStack TODO in the safestack.ccPeter Collingbourne2015-06-231-24/+32
| | | | | | | | | | | | This patch clarifies the TODO note at the top of safestack.cc and brings it more in sync with what we (the CPI team) actually plan to work on in the future. Patch by Volodymyr Kuznetsov! Differential Revision: http://reviews.llvm.org/D10600 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240473 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240470 91177308-0d34-0410-b5e6-96231b3b80d8
* Working on reconciling out-of-tree patches to compiler-rt for building for iOS.Chris Bieneman2015-06-232-4/+20
| | | | | | | | | | | | | | | | | | | 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, and adds support for iOS and the iOS simulator to as an. 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, zaks.anna, llvm-commits Differential Revision: http://reviews.llvm.org/D10515 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240469 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240468 91177308-0d34-0410-b5e6-96231b3b80d8
* Working on reconciling out-of-tree patches to compiler-rt for building for iOS.Chris Bieneman2015-06-233-19/+44
| | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240467 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix incorrect truncation at the overflow boundaryPirama Arumuga Nainar2015-06-235-1/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch fixes incorrect truncation when the input wider value is exactly 2^dstBits. For that value, the overflow to infinity is not correctly handled. The fix is to replace a strict '>' with '>='. Currently, __truncdfsf2(340282366900000000000000000000000000000.0) returns infinity __truncdfsf2(340282366920938463463374607431768211456.0) returns 0 __truncdfsf2(400000000000000000000000000000000000000.0) returns infinity Likewise, __truncdfhf2 and __truncsfhf2 (and consequently gnu_f2h_ieee) are discontinuous at 65536.0. This patch adds tests for all three cases, along with adding a missing header include to fp_test.h. Reviewers: joerg, ab, srhines Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10594 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240450 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Mark one test as only supported on x86Jay Foad2015-06-231-0/+1
| | | | | | | | | | | | | | Summary: This test uses x86 intrinsics, so it can't work on other platforms. Reviewers: garious, eugenis, samsonov Reviewed By: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10652 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240449 91177308-0d34-0410-b5e6-96231b3b80d8
* [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). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240379 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Respect the value of -mmacosx-version-min flag.Alexey Samsonov2015-06-221-5/+12
| | | | | | | Make sure that sanitizer runtimes target OS X version provided in -mmacosx-version-min= flag. Enforce that it should be at least 10.7. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240356 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -flto to clang flags for cfi tests.Alexey Samsonov2015-06-191-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240168 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Stop using LLVM's custom parse_arguments. NFCFilipe Cabecinhas2015-06-1914-50/+43
| | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240120 91177308-0d34-0410-b5e6-96231b3b80d8
* Add control flow integrity diagnosis function to UBSan runtime library.Peter Collingbourne2015-06-1913-14/+129
| | | | | | | | Also includes execution tests for the feature. Differential Revision: http://reviews.llvm.org/D10269 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240111 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Revert "[CMake] LSan is not actually available on Darwin.""Alexey Samsonov2015-06-193-12/+10
| | | | | | Re-land fixed version of r239955. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240108 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Intercept fopencookie.Evgeniy Stepanov2015-06-195-0/+136
| | | | | | | https://code.google.com/p/memory-sanitizer/issues/detail?id=86 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240107 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: mark meta shadow as NOHUGEPAGEDmitry Vyukov2015-06-181-0/+4
| | | | | | | | | | | Meta shadow is compressing and we don't flush it, so it makes sense to mark it as NOHUGEPAGE to not over-allocate memory. On one program it reduces memory consumption from 5GB to 2.5GB. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240028 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[CMake] LSan is not actually available on Darwin."Justin Bogner2015-06-183-19/+23
| | | | | | | | | This change makes cmake fail to even run on Darwin with errors evaluating "$<TARGET_OBJECTS:RTInterception.x86_64>". This reverts r239955 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239985 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Remove redundant checks in TSan CMakeLists.txtAlexey Samsonov2015-06-171-44/+40
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239956 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] LSan is not actually available on Darwin.Alexey Samsonov2015-06-173-23/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239955 91177308-0d34-0410-b5e6-96231b3b80d8
* SafeStack: XFAIL the pthread.c test on Darwin.Peter Collingbourne2015-06-161-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239841 91177308-0d34-0410-b5e6-96231b3b80d8
* SafeStack: Adjust condition for COMPILER_RT_HAS_SAFESTACK to fix sanitizer ↵Peter Collingbourne2015-06-161-1/+1
| | | | | | builds. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239840 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan tests] Revert a bad change from r239754Filipe Cabecinhas2015-06-151-1/+1
| | | | | | Hopefully the last partial revert. Sorry about the noise. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239785 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan tests] Leftover that didn't get reverted in r239754Filipe Cabecinhas2015-06-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239773 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan tests] Use export, not env.Filipe Cabecinhas2015-06-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239771 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[ASan tests] Try to fix Windows buildbots due to r239754"Filipe Cabecinhas2015-06-155-5/+5
| | | | | | This reverts commit r239764 and the TestCases/Windows part of r239754. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239768 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan tests] Try to fix Windows buildbots due to r239754Filipe Cabecinhas2015-06-155-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239764 91177308-0d34-0410-b5e6-96231b3b80d8
* Protection against stack-based memory corruption errors using SafeStack: ↵Peter Collingbourne2015-06-1517-0/+515
| | | | | | | | | | | | | | | | | | | compiler-rt runtime support library This patch adds runtime support for the Safe Stack protection to compiler-rt (see http://reviews.llvm.org/D6094 for the detailed description of the Safe Stack). This patch is our implementation of the safe stack on top of compiler-rt. The patch adds basic runtime support for the safe stack to compiler-rt that manages unsafe stack allocation/deallocation for each thread. Original patch by Volodymyr Kuznetsov and others at the Dependable Systems Lab at EPFL; updates and upstreaming by myself. Differential Revision: http://reviews.llvm.org/D6096 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239763 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Test churn for setting ASAN_OPTIONS=symbolize_vs_style=falseFilipe Cabecinhas2015-06-15132-336/+339
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This commit adds symbolize_vs_style=false to every instance of ASAN_OPTIONS in the asan tests and sets ASAN_OPTIONS=symbolize_vs_style=false in lit, for tests which don't set it. This way we don't need to make the tests be able to deal with both symbolize styles. This is the first patch in the series. I will eventually submit for the other sanitizers too. We need this change (or another way to deal with the different outputs) in order to be able to default to symbolize_vs_style=true on some platforms. Adding to this change, I'm also adding "env " before any command line which sets environment variables. That way the test works on other host shells, like we have if the host is running Windows. Reviewers: samsonov, kcc, rnk Subscribers: tberghammer, llvm-commits Differential Revision: http://reviews.llvm.org/D10294 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239754 91177308-0d34-0410-b5e6-96231b3b80d8
* [builtins] Hide long double fp_test.h helpers if it's not fp128.Ahmed Bougacha2015-06-121-0/+12
| | | | | | | | | | Like we do for the various __*tf* tests, check that long double is the 128bit type we expect directly in the header. The latter is now used by unrelated tests (__*hf* since r237161), and those tests will break for no reason if uint128_t doesn't exist, and long double isn't fp128. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239630 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Cleanup add_compiler_rt_object_library to be platform-agnosticChris Bieneman2015-06-108-130/+131
| | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239498 91177308-0d34-0410-b5e6-96231b3b80d8