summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2015-07-09Add support for generating profiles in a given directory.Diego Novillo
When the file is initialized, this patch checks whether the path specifies a directory. If so, it creates the directory tree before truncating the file. Use default.profdata instead of pgo-data for default indexed profile name. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@241824 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08[asan] relax the test case to allow either 'malloc' or ↵Kostya Serebryany
'__interceptor_malloc' ; PR22681 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@241755 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08CFI: Get check-cfi passing on Windows.Peter Collingbourne
Specifically: - Start using %expect_crash. - Provide an implementation of __ubsan::getDynamicTypeInfoFromVtable for the Microsoft C++ ABI. This is all that is needed for CFI diagnostics; UBSan's -fsanitize=vptr also requires an implementation of __ubsan::checkDynamicType. - Build the sanitizer runtimes against the release version of the C runtime, even in debug builds. - Accommodate demangling differences in tests. Differential Revision: http://reviews.llvm.org/D11029 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@241745 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07[asan] Add missing $ASAN_OPTIONS to some test casesKuba Brecka
Since http://reviews.llvm.org/D10294, ASan test cases now respect default env. options via `ASAN_OPTION=$ASAN_OPTIONS:additional_options=xxx`. This patch adds this to a few test cases where it's still missing. Differential Revision: http://reviews.llvm.org/D10988 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@241571 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06[asan] Add OS X 10.11's new dyld interposition supportKuba Brecka
On OS X 10.11 (which is currently a public beta), the dynamic linker has been improved so that it doesn't require the use of DYLD_INSERT_LIBRARIES in order for interposition/wrappers to work. This patch adds support of this behavior into ASan – we no longer need to re-exec in case the env. variable is not set. Reviewed at http://reviews.llvm.org/D10924 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@241487 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06[asan] Fix an OS X startup crash when an empty section is presentKuba Brecka
On OS X, when the main instrumented binary contains a custom section with zero length, ASan will crash (assert failure) early in the initialization. Reviewed at http://reviews.llvm.org/D10944 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@241474 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-05Enable this test for PPC64.Jay Foad
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@241400 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02UBSan: Enable runtime library tests on Windows, and get most tests passing.Peter Collingbourne
Specifically: - Disable int128 tests on Windows, as MSVC cl.exe does not support int128, so we might not have been able to build the runtime with int128 support. - XFAIL the vptr tests as we lack Microsoft ABI support. - XFAIL enum.cpp as UBSan fails to add the correct instrumentation code for some reason. - Modify certain tests that build executables multiple times to use unique names for each executable. This works around a race condition observed on Windows. - Implement IsAccessibleMemoryRange for Windows to fix the last misaligned.cpp test. - Introduce a substitution for testing crashes on Windows using KillTheDoctor. Differential Revision: http://reviews.llvm.org/D10864 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@241303 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30[asan] Suppress read_binary_name_regtest.c test failure on unsupported hosts.Evgeniy Stepanov
read_binary_name_regtest.c requires seccomp kernel headers. Make the test pass if <linux/seccomp.h> is missing. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@241119 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30tsan: fix handling of condition variable destructionDmitry Vyukov
POSIX states that "It shall be safe to destroy an initialized condition variable upon which no threads are currently blocked", and later clarifies "A condition variable can be destroyed immediately after all the threads that are blocked on it are awakened) (in examples section). Tsan reported such destruction as a data race. Fixes https://llvm.org/bugs/show_bug.cgi?id=23616 Reviewed in http://reviews.llvm.org/D10693 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@241082 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30[ASan] Add a regression test for r240960 (https://crbug.com/502974)Alexander Potapenko
The test simulates a sandbox that prevents the program from calling readlink(). ASan is supposed to still be able to print the executable name regardless of that. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@241072 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29[asan] Re-enable clang_gcc_abi test at higher opt levels.Evgeniy Stepanov
PR23971 is fixed. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240975 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29sanitizer_common: fix and re-enable signal_segv_handler testDmitry Vyukov
struct sigaction was not initialized. As the result if SA_RESETHAND is set in sa_flags, then the handler is reset after first invocation leading to crash. Initialize struct sigaction to zero. Reviewed in http://reviews.llvm.org/D10803 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240965 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29tsan: implement suppressions for top frame onlyDmitry Vyukov
The new suppression type is called "race_top" and is matched only against top frame in report stacks. This is required for situations when we want to suppress a race in a "thread pool" or "event loop" implementation. If we simply use "race:ThreadPool::Execute" suppression, that can suppress everything in the program. Reviewed in http://reviews.llvm.org/D10686 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240949 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29tsan: fix flaky testDmitry Vyukov
See the comment for explanation. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240943 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-26[asan] Disable 3 tests on Android.Evgeniy Stepanov
Different reasons for failing; see source file comments. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240858 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-26[asan] Add -pie to uninstrumented executables on interface_test.ccEvgeniy Stepanov
This helps Android (which only support PIE) and does not hurt anything else. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240857 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-26[asan] Enable 2 tests on Android.Evgeniy Stepanov
Due to bionic improvements and "recent" sized-delete changes in clang. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240856 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-26[asan] Disable -O1,-O2,-O3 in clang_gcc_abi.cc test.Evgeniy Stepanov
A workaround for PR23971. Fixes the test on Android. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240855 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25[asan] Do not unset DYLD_ROOT_PATH before calling atos on DarwinAnna Zaks
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
2015-06-25tsan: fix handling of dup2 Dmitry Vyukov
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
2015-06-25[CFI] Run tests that use cfi diagnostic mode only if cxxabi parts of UBSan ↵Alexey Samsonov
are available. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240671 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25[sanitizer] Disable signal_segv_handler test.Evgeniy Stepanov
Random failures on the bots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240668 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25Enable memory sanitizer for PPC64Jay Foad
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
2015-06-25[CMake] Fix PR23539: Don't reference C++ ABI symbols prior to Mac OS 10.9.Alexey Samsonov
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
2015-06-24tsan: fix false positive between dlopen and dl_iterate_phdrDmitry Vyukov
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
2015-06-24tsan: don't print external PCs in reportsDmitry Vyukov
They are meaningless. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240539 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24tsan: fix unbounded memory consumption for large mallocsDmitry Vyukov
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
2015-06-23Fix incorrect truncation at the overflow boundaryPirama Arumuga Nainar
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
2015-06-23[msan] Mark one test as only supported on x86Jay Foad
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
2015-06-19Add -flto to clang flags for cfi tests.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240168 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19Add control flow integrity diagnosis function to UBSan runtime library.Peter Collingbourne
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
2015-06-19Revert "Revert "[CMake] LSan is not actually available on Darwin.""Alexey Samsonov
Re-land fixed version of r239955. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240108 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19[msan] Intercept fopencookie.Evgeniy Stepanov
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
2015-06-18Revert "[CMake] LSan is not actually available on Darwin."Justin Bogner
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
2015-06-17[CMake] LSan is not actually available on Darwin.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239955 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-16SafeStack: XFAIL the pthread.c test on Darwin.Peter Collingbourne
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239841 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-15[ASan tests] Revert a bad change from r239754Filipe Cabecinhas
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
2015-06-15[ASan tests] Leftover that didn't get reverted in r239754Filipe Cabecinhas
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239773 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-15[ASan tests] Use export, not env.Filipe Cabecinhas
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239771 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-15Revert "[ASan tests] Try to fix Windows buildbots due to r239754"Filipe Cabecinhas
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
2015-06-15[ASan tests] Try to fix Windows buildbots due to r239754Filipe Cabecinhas
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239764 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-15Protection against stack-based memory corruption errors using SafeStack: ↵Peter Collingbourne
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
2015-06-15[ASan] Test churn for setting ASAN_OPTIONS=symbolize_vs_style=falseFilipe Cabecinhas
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
2015-06-12[builtins] Hide long double fp_test.h helpers if it's not fp128.Ahmed Bougacha
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
2015-06-10[ASan] Quick-fix tests for new string interceptors.Yury Gribov
Patch by Maria Guseva. Differential Revision: http://reviews.llvm.org/D10336 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239461 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-08[asan] Fixup to r239134. This test does pass on darwin.Anna Zaks
This should restore the darwin buildbot. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239364 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05[ASan] Add process basename to log name and error message toYury Gribov
simplify analysis of sanitized systems logs. Differential Revision: http://reviews.llvm.org/D7333 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239134 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04[tsan] Disable a flaky test.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239063 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04[Sanitizers] Add *SAN_OPTIONS to possibly_dangerous_env_varsFilipe Cabecinhas
Summary: This way, if they're set when running ninja check-ubsan (or another sanitizer), they get cleared before we start invoking the programs. Reviewers: samsonov, kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10229 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@238991 91177308-0d34-0410-b5e6-96231b3b80d8