summaryrefslogtreecommitdiff
path: root/test/sanitizer_common
AgeCommit message (Collapse)Author
2017-12-07[sanitizer] Simplify android_run.py.Evgeniy Stepanov
A test-only change to pass all *SAN_OPTIONS to the device without listing them individually. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319998 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01[ubsan] Re-commit: lit changes for lld testing, future lto testing.Roman Lebedev
Summary: As discussed in https://github.com/google/oss-fuzz/issues/933, it would be really awesome to be able to use ThinLTO for fuzzing. However, as @kcc has pointed out, it is currently undefined (untested) whether the sanitizers actually function properly with LLD and/or LTO. This patch is inspired by the cfi test, which already do test with LTO (and/or LLD), since LTO is required for CFI to function. I started with UBSan, because it's cmakelists / lit.* files appeared to be the cleanest. This patch adds the infrastructure to easily add LLD and/or LTO sub-variants of the existing lit test configurations. Also, this patch adds the LLD flavor, that explicitly does use LLD to link. The check-ubsan does pass on my machine. And to minimize the [initial] potential buildbot breakage i have put some restrictions on this flavour. Please review carefully, i have not worked with lit/sanitizer tests before. The original attempt, r319525 was reverted in r319526 due to the failures in compiler-rt standalone builds. Reviewers: eugenis, vitalybuka Reviewed By: eugenis Subscribers: #sanitizers, pcc, kubamracek, mgorny, llvm-commits, mehdi_amini, inglorion, kcc Differential Revision: https://reviews.llvm.org/D39508 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319575 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01Revert "[ubsan] lit changes for lld testing, future lto testing."Roman Lebedev
This reverts commit r319525. This change has introduced a problem with the Lit tests build for compiler-rt using Gold: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/6047/steps/test%20standalone%20compiler-rt/logs/stdio llvm-lit: /b/sanitizer-x86_64-linux/build/llvm/utils/lit/lit/TestingConfig.py:101: fatal: unable to parse config file '/b/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/profile/Linux/lit.local.cfg', traceback: Traceback (most recent call last): File "/b/sanitizer-x86_64-linux/build/llvm/utils/lit/lit/TestingConfig.py", line 88, in load_from_path exec(compile(data, path, 'exec'), cfg_globals, None) File "/b/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/profile/Linux/lit.local.cfg", line 37, in <module> if root.host_os not in ['Linux'] or not is_gold_linker_available(): File "/b/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/profile/Linux/lit.local.cfg", line 27, in is_gold_linker_available stderr = subprocess.PIPE) File "/usr/lib/python2.7/subprocess.py", line 390, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319529 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01[ubsan] lit changes for lld testing, future lto testing.Roman Lebedev
Summary: As discussed in https://github.com/google/oss-fuzz/issues/933, it would be really awesome to be able to use ThinLTO for fuzzing. However, as @kcc has pointed out, it is currently undefined (untested) whether the sanitizers actually function properly with LLD and/or LTO. This patch is inspired by the cfi test, which already do test with LTO (and/or LLD), since LTO is required for CFI to function. I started with UBSan, because it's cmakelists / lit.* files appeared to be the cleanest. This patch adds the infrastructure to easily add LLD and/or LTO sub-variants of the existing lit test configurations. Also, this patch adds the LLD flavor, that explicitly does use LLD to link. The check-ubsan does pass on my machine. And to minimize the [initial] potential buildbot breakage i have put some restrictions on this flavour. Please review carefully, i have not worked with lit/sanitizer tests before. Reviewers: eugenis, vitalybuka Reviewed By: eugenis Subscribers: #sanitizers, pcc, kubamracek, mgorny, llvm-commits, mehdi_amini, inglorion, kcc Differential Revision: https://reviews.llvm.org/D39508 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319525 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-20[tsan] Fix sigaction implementation when it's called only to get handlerVitaly Buka
Reviewers: eugenis Subscribers: kubamracek, llvm-commits, krytarowski Differential Revision: https://reviews.llvm.org/D40272 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@318707 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13[sanitizer] Relax stack check in assert.cc even moreVitaly Buka
assert implementations can be very different git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@318089 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13[tsan] Fix signal chainingVitaly Buka
Summary: Return saved values only if installed sigaction is our wrapper. Reviewers: eugenis, dvyukov Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D39935 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@318082 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13[tsan] Deadly signal handler for tsanVitaly Buka
Summary: https://github.com/google/sanitizers/issues/637 Reviewers: eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D39929 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@318078 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13[sanitizer] Relax stack checkVitaly Buka
-NEXT sometimes does not work as LLVMSymbolizer warning can appear there. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@318077 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-12[sanitizer] Simplify stack check in accert.ccVitaly Buka
Somehow on arm bots stack does not include main. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@318002 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-12[sanitizer] Try to see test output on armv7Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@318001 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-11[msan] Fix signal chainingVitaly Buka
Return internally stored handlers only if handlers is set to wrapper git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317970 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-11[sanitizer] Include stack trace check into signal testsVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317963 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-11[ubsan] Fix ubsan tests broken by linking as C instead of C++Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317958 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-10[msan] Deadly signal handler for msanVitaly Buka
Summary: Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D39826 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17Revert "[asan] Deflake one test by running it 3 times."Evgeniy Stepanov
Disable this test on Android/x86 only. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316023 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-13[asan] Deflake one test by running it 3 times.Evgeniy Stepanov
The test seems to trigger an android platform bug under load. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315777 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-12[sanitizer] Workaround a Linux kernel bug in hard_rss_limit_mb_test.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315632 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-12[asan] Disable a flaky test on android.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315602 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-11[asan] Tweak test output to diagnose buildbot failures.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315479 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-11[sanitizer] Re-disable several tests on Android.Evgeniy Stepanov
The tests have been enabled by accident in r315389. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315396 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-10Factor out "stable-runtime" feature and enable it on all android.Evgeniy Stepanov
This is a very poorly named feature. I think originally it meant to cover linux only, but the use of it in msan seems to be about any aarch64 platform. Anyway, this change should be NFC on everything except Android. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315389 91177308-0d34-0410-b5e6-96231b3b80d8
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-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-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] 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-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-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-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-15[sanitizer] Simplify checks in allow_user_segv.ccVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313342 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15[lsan] Disable clang-format on few RUN: statementsVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313321 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14Revert "[mips] Fix sem_init_glibc test for MIPS."Simon Dardis
The commit did not fix the failing test and instead exposed an inconsistency between lsan and (t|m|a)san. I'm reverting the patch as it causes more failures and the original patch had a '||' instead of '&&', which meant that an N32 build of test would have be incorrect w.r.t. __HAVE_64B_ATOMICS for glibc. This reverts commit r313248. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313291 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14[mips] Fix sem_init_glibc test for MIPS.Simon Dardis
glibc changed the implementation of semaphores for glibc 2.21 requiring some target specific changes for this compiler-rt test. Modify the test to cope with MIPS64 and do some future/correctness work by tying the define for MIPS64 to exactly the define of __HAVE_64B_ATOMICS in glibc. Contributions from Nitesh Jain. Reviewers: eugenis Differential Revision: https://reviews.llvm.org/D37829 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313248 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14[sanitizer] Mark allow_user_segv as XFAIL instead of UNSUPPORTEDVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313241 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13[compiler-rt] Add test for not fully implemented dump_registersVitaly Buka
Reviewers: eugenis, alekseyshl Subscribers: kubamracek, dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D37765 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313120 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13[compiler-rt] Move dump_instruction_bytes and dump_registers into ↵Vitaly Buka
sanitizer_common Summary: Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl Subscribers: kubamracek, llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D37766 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313117 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11[ubsan] Make ubsan version of __sanitizer_print_stack_trace consistent with ↵Vitaly Buka
other sanitizers Summary: Other sanitizers include __sanitizer_print_stack_trace into stack trace. Reviewers: eugenis, alekseyshl Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D37657 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312954 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11[ubsan] Save binary name before parsing optionsVitaly Buka
Summary: To parser "include" we may need to do binary name substitution. Reviewers: eugenis, alekseyshl Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D37658 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312953 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09[ubsan] Enable UBsan in sanitizer_common testsVitaly Buka
Summary: Failing tests just marked as UNSUPPORTED or XFAIL. Some of them can be easily supported, but I'll do this in separate patches. Reviewers: eugenis, alekseyshl Subscribers: srhines, kubamracek, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D37630 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312860 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09[compiler-rt] Move allow_user_segv.cc into sanitizer_commonVitaly Buka
Summary: Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis Subscribers: kubamracek, dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D37537 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-30Finalize ASAN/NetBSDKamil Rytarowski
Summary: This revision contains various cleanups. Sponsored by <The NetBSD Foundation> Reviewers: kcc, vitalybuka, joerg, eugenis Reviewed By: kcc Subscribers: emaste, srhines, llvm-commits, kubamracek, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D37244 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312188 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-28Reland r311842 - [cmake] Remove i686 target that is duplicate to i386Michal Gorny
Remove the explicit i686 target that is completely duplicate to the i386 target, with the latter being used more commonly. 1. The runtime built for i686 will be identical to the one built for i386. 2. Supporting both -i386 and -i686 suffixes causes unnecessary confusion on the clang end which has to expect either of them. 3. The checks are based on wrong assumption that __i686__ is defined for all newer x86 CPUs. In fact, it is only declared when -march=i686 is explicitly used. It is not available when a more specific (or newer) -march is used. Curious enough, if CFLAGS contain -march=i686, the runtime will be built both for i386 and i686. For any other value, only i386 variant will be built. Differential Revision: https://reviews.llvm.org/D26764 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311924 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-27Revert r311842 - [cmake] Remove i686 target that is duplicate to i386Michal Gorny
The required change in clang is being reverted because of the Android build bot failure. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-27[cmake] Remove i686 target that is duplicate to i386Michal Gorny
Remove the explicit i686 target that is completely duplicate to the i386 target, with the latter being used more commonly. 1. The runtime built for i686 will be identical to the one built for i386. 2. Supporting both -i386 and -i686 suffixes causes unnecessary confusion on the clang end which has to expect either of them. 3. The checks are based on wrong assumption that __i686__ is defined for all newer x86 CPUs. In fact, it is only declared when -march=i686 is explicitly used. It is not available when a more specific (or newer) -march is used. Curious enough, if CFLAGS contain -march=i686, the runtime will be built both for i386 and i686. For any other value, only i386 variant will be built. Differential Revision: https://reviews.llvm.org/D26764 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311842 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-25[sanitizer-coverage] extend fsanitize-coverage=pc-table with flags for every PCKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311794 91177308-0d34-0410-b5e6-96231b3b80d8