summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2017-10-06[sanitizer] Test ubsan and cfi on android.Evgeniy Stepanov
Summary: Enable check-cfi and check-ubsan on Android. Check-ubsan includes standalone and ubsan+asan, but not tsan or msan. Cross-dso cfi tests are disabled for now. Reviewers: vitalybuka, pcc Subscribers: srhines, kubamracek, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D38608 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315105 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-06[asan] Use gold linker in android tests.Evgeniy Stepanov
Replace a partial workaround for ld.bfd strangeness with the ultimate one: -fuse-ld=gold. Reason: ld.bfd problem gets worse with libc++-based NDK toolchain. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315039 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-05[libFuzzer] Disable experimental clang coverage support by default.Max Moroz
Summary: It can be enabled via "-use_clang_coverage=1" flag. Reason for disabling: libFuzzer resets Clang Counters and makes it impossible to generate coverage report for a regular fuzz target (i.e. not standalone build). Reviewers: kcc Reviewed By: kcc Subscribers: kcc Differential Revision: https://reviews.llvm.org/D38604 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315029 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-05[cfi] Disable tests with lld on i386.Evgeniy Stepanov
bin/ld.lld: error: ubsan_handlers.cc:(.debug_info+0x80D5D): has non-ABS reloc Bug pending. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315027 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-05[asan] Add --enable-new-dtags in tests on Android.Evgeniy Stepanov
The dynamic loader does not accept DT_RPATH; it wants DT_RUNPATH. This is a temporary fix until D38430 lands. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315020 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-05[asan] Use full binary path in the Android test runner.Evgeniy Stepanov
Summary: This prevents the confusion when there are similarly named tests in different configurations (like in test/sanitizer_common). Reviewers: vitalybuka Subscribers: srhines, llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D38526 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315011 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-05[sanitizer] Move %ld_flags_rpath_exe to common and use it in more tests.Evgeniy Stepanov
Reviewers: vitalybuka Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D38527 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315010 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-05[cfi] Mark a test as unsupported on darwin.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315007 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-05[cfi] Test on all available targets.Evgeniy Stepanov
Summary: Run CFI tests on all targets current toolchain can target. On multiarch Linux, this will run all CFI tests with -m32 and -m64. Reviewers: pcc Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D38572 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315001 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-04[XRay][compiler-rt] Use a hand-written circular buffer in BufferQueueDean Michael Berris
Summary: This change removes the dependency on using a std::deque<...> for the storage of the buffers in the buffer queue. We instead implement a fixed-size circular buffer that's resilient to exhaustion, and preserves the semantics of the BufferQueue. We're moving away from using std::deque<...> for two reasons: - We want to remove dependencies on the STL for data structures. - We want the data structure we use to not require re-allocation in the normal course of operation. The internal implementation of the buffer queue uses heap-allocated arrays that are initialized once when the BufferQueue is created, and re-uses slots in the buffer array as buffers are returned in order. We also change the lock used in the implementation to a spinlock instead of a blocking mutex. We reason that since the release operations now take very little time in the critical section, that a spinlock would be appropriate. This change is related to D38073. This change is a re-submit with the following changes: - Keeping track of the live buffers with a counter independent of the pointers keeping track of the extents of the circular buffer. - Additional documentation of what the data members are meant to represent. Reviewers: dblaikie, kpw, pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D38119 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314877 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-04[XRay] [compiler-rt] make sure single threaded programs get traced tooMartin Pelikan
Summary: When the XRay user calls the API to finish writing the log, the thread which is calling the API still hasn't finished and therefore won't get its trace written. Add a test for only the main thread to check this. Reviewers: dberris Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D38493 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314875 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-03Revert "[XRay][compiler-rt] Use a hand-written circular buffer in BufferQueue"Dean Michael Berris
This reverts r314766 (rL314766). Unit tests fail in multiple bots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314786 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-03[XRay][compiler-rt] Use a hand-written circular buffer in BufferQueueDean Michael Berris
Summary: This change removes the dependency on using a std::deque<...> for the storage of the buffers in the buffer queue. We instead implement a fixed-size circular buffer that's resilient to exhaustion, and preserves the semantics of the BufferQueue. We're moving away from using std::deque<...> for two reasons: - We want to remove dependencies on the STL for data structures. - We want the data structure we use to not require re-allocation in the normal course of operation. The internal implementation of the buffer queue uses heap-allocated arrays that are initialized once when the BufferQueue is created, and re-uses slots in the buffer array as buffers are returned in order. We also change the lock used in the implementation to a spinlock instead of a blocking mutex. We reason that since the release operations now take very little time in the critical section, that a spinlock would be appropriate. This change is related to D38073. Reviewers: dblaikie, kpw, pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D38119 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314766 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-02Use %run for running CFI testsFilipe Cabecinhas
Reviewers: pcc, krasin, eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D38412 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314659 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-02[cmake] Add a separate CMake var to control profile runtimeMichal Gorny
Make it possible to control building profile runtime separately from other options. Before r313549, the profile runtime building was controlled along with sanitizers. However, since that commit it is built unconditionally which results in multiple builds for people building different runtimes separately. Differential Revision: https://reviews.llvm.org/D38441 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314646 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-28tsan: handle signals in pause callDmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314384 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-28[XRay] [compiler-rt] FDR logging arg1 handlerMartin Pelikan
Summary: Write out records about logged function call first arguments. D32840 implements the reading of this in llvm-xray. Reviewers: dberris Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32844 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314378 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-27ASan allocates a global data initialization array at the tail end of eachDmitry Mikulin
compunit's .data section. This vector is not poisoned. Because of this the first symbol of the following section has no left red zone. As a result, ASan cannot detect underflow for such symbols. Poison ASan allocated metadata, it should not be accessible to user code. This fix does not eliminate the problem with missing left red zones but it reduces the set of vulnerable symbols from first symbols in each input data section to first symbols in the output section of the binary. Differential Revision: https://reviews.llvm.org/D38056 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314365 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-27[scudo] Temporary disabling the valloc test on armhfKostya Kortchinsky
Summary: Weird failure where `errno != ENOMEM` on valloc failure. The returned pointer is null since it passes the previous assert, so this shouldn't happen. http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15-full/builds/10931 http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-a15-full-sh/builds/2469 Disabling until we figure out what's going on. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: aemerson, srhines, llvm-commits, kristof.beyls Differential Revision: https://reviews.llvm.org/D38324 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314344 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-26[mips][asan] Fix preinstalled_signal.cc test for mipsSimon Dardis
Linux for mips has a non-standard layout for the kernel sigaction struct. Adjust the layout by the minimally amount to get the test to pass, as we don't require the usage of the restorer function. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314200 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-25[mips][compiler-rt] Disable sem_init_glibc.cc for MIPS64.Simon Dardis
This test can't pass on MIPS64 due to the lack of versioned interceptors for asan and company. The interceptors bind to the earlier version of sem_init rather than the latest version. For MIPS64el this causes an accidental pass while MIPS64 big endian fails due reading back a different 32bit word to what sem_init wrote when the test is corrected to use 64bit atomics. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314100 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-23[ubsan] Fix assert.cc test by compiling it as C++Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314057 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-23[ubsan] Support signal specific options in ubsanVitaly Buka
Summary: Part of https://github.com/google/sanitizers/issues/637 Standalone ubsan needs signal and sigaction handlers and interceptors. Plugin mode should rely on parent tool. Reviewers: eugenis, alekseyshl Subscribers: kubamracek, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D37895 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314052 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-22[lsan] Add __lsan_default_optionsVitaly Buka
For consistency with asan, msan, tsan and ubsan. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314048 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-22[lsan] Deadly signal handler for lsanVitaly Buka
Summary: Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl Subscribers: llvm-commits, dberris, kubamracek, krytarowski Differential Revision: https://reviews.llvm.org/D37608 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314041 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-22Deflake the "xpc-race.mm" test.Kuba Mracek
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314014 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-22[asan/lsan] Trying to fix PPC64 and x380x buildbots after r313966Maxim Ostapenko
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313974 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-22[asan/lsan] Trying to fix buildbots after r313966Maxim Ostapenko
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313967 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-22[asan/lsan] Make LSan compliant with recovery mode when running on top of ASanMaxim Ostapenko
Don't overwrite exit code in LSan when running on top of ASan in recovery mode to avoid breakage of users code due to found leaks. Patch by Slava Barinov. Differential Revision: https://reviews.llvm.org/D38026 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313966 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21[asan] Remove trailing spacesVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313845 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21[asan] Remove "COLLISION" workaround for datarace in asanVitaly Buka
"nested bug in the same thread" is not expected in case like this and was caused by https://github.com/google/sanitizers/issues/858 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313844 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21[asan] Remove "rm -f" in tests where it was needed only because of >>Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313843 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20[asan] Fix nested error detectionVitaly Buka
Summary: Fixes https://github.com/google/sanitizers/issues/858 Reviewers: eugenis, dvyukov Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D38019 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313835 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20[asan] Try to fix windows test by fflush(stderr)Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313728 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20[asan] Resolve FIXME by converting gtest into lit testVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313727 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19[mips][compiler-rt] UnXFAIL test.Simon Dardis
lsan and asan were reporting leaks caused by a glibc configuration issue. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313645 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19[ubsan-minimal] Test exported symbol set against RTUBsanVedant Kumar
Check that the symbol sets exported by the minimal runtime and the full runtime match (making exceptions for special cases as needed). This test uses some possibly non-standard nm options, and needs to inspect the symbols in runtime dylibs. I haven't found a portable way to do this, so it's limited to x86-64/Darwin for now. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313615 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19[ubsan-minimal] Make the interface more compatible with RTUBSanVedant Kumar
This eliminates a few inconsistencies between the symbol sets exported by RTUBSan and RTUBSan_minimal: * Handlers for nonnull_return were missing from the minimal RT, and are now added in. * The minimal runtime exported recoverable handlers for builtin_unreachable and missing_return. These are not supposed to exist, and are now removed. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313614 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19[profile] Update Linux-only tests after r313597Vedant Kumar
Addresses bot failure: http://lab.llvm.org:8011/builders/clang-ppc64le-linux/builds/9803 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313602 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18[scudo] Additional modifications for Android tests supportKostya Kortchinsky
Summary: With the recent move of `android_commands` to `sanitizer_common`, some things have to be updated with regard to Scudo on Android. Notably: - `config.android` is dealt with in the common code - `config.compile_wrapper` can be prepended to allow for the use of the android commands - `SCUDO_OPTIONS` must be passed with the environment when running a test - `preinit.cpp` fails with some API levels, not sure why, I will have to dig into this later. Note that `check-scudo` is not enabled yet in the bots. It's all local testing for now until everything looks good. Reviewers: alekseyshl, vitalybuka Reviewed By: vitalybuka Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D37990 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313561 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18[ubsan] Fix interface_symbols_windows testVitaly Buka
Summary: 1. Update ubsan_interface.inc to make the test happy. 2. Switch interface_symbols_linux and interface_symbols_darwin to C++ to import __ubsan_handle_dynamic_type_cache_miss 3. Switch interface_symbols_windows to C++ for consistency. Reviewers: rnk, zturner Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D37986 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313551 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18[cmake] Make it possible to build and test profile without sanitizersVedant Kumar
This should fix an issue which arises when running check-compiler-rt on the coverage bot: http://green.lab.llvm.org/green/job/clang-stage2-coverage-R_build/1590/ The bot doesn't build the sanitizers, but the check-compiler-rt target always expects the profile runtime to exist. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313549 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18[scudo] Android build supportKostya Kortchinsky
Summary: Mark Android as supported in the cmake configuration for Scudo. Scudo is not added yet in the Android build bots, but code builds and tests pass locally. It is for a later CL. I also checked that Scudo builds as part of the Android toolchain. A few modifications had to be made: - Android defaults to `abort_on_error=1`, which doesn't work well with the current tests. So change the default way to pass `SCUDO_OPTIONS` to the tests to account for this, setting it to 0 by default; - Disable the `valloc.cpp` & `random_shuffle.cpp` tests on Android; - There is a bit of gymnatic to be done with the `SCUDO_TEST_TARGET_ARCH` string, due to android using the `-android` suffix, and `i686` instead of `i386`; - Android doesn't need `-lrt`. Reviewers: alekseyshl, eugenis Reviewed By: alekseyshl Subscribers: srhines, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D37907 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313538 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18[XRay][compiler-rt] Handle tail-call exits in the XRay runtimeDean Michael Berris
Summary: This change starts differentiating tail exits from normal exits. We also increase the version number of the "naive" log to version 2, which will be the starting version where these records start appearing. In FDR mode we treat the tail exits as normal exits, and are thus subject to the same treatment with regard to record unwriting. Updating the version number is important to signal older builds of the llvm-xray tool that do not deal with the tail exit records must fail early (and that users should only use the llvm-xray tool built after the support for tail exits to get accurate handling of these records). Depends on D37964. Reviewers: kpw, pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D37965 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313515 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17Mark various failing tests with "UNSUPPORTED: ios".Kuba Mracek
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313498 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16[sanitizer] Fix check for i386 Android in lit testsVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313452 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16[sanitizer] Disable sanitizer test which already fails on Android i386Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313447 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16[sanitizer] Support check-asan on AndroidVitaly Buka
This patch enabled asan tests from sanitizer_common. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313444 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16[sanitizer] Move android_commoands from asan into sanitizer_commonVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313443 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16[builtins] Remove one more missed not-androidVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313441 91177308-0d34-0410-b5e6-96231b3b80d8