summaryrefslogtreecommitdiffstats
path: root/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
...
* [scs] Disable negative test in shadowcallstack.Evgeniy Stepanov2018-06-291-9/+1
| | | | | | | | The test checks that scs does NOT work correctly w/o runtime support. That's a strange thing to test, and it is also flaky, because things may just work if x18 happens to point to a writable page. llvm-svn: 335982
* [scudo] Add some runtime tests for the minimal runtimeKostya Kortchinsky2018-06-294-4/+43
| | | | | | | | | | | | | | | | Summary: As well as some tests to ensure that various combinations of the clang command line flags work (shared/static/minimal). Reviewers: eugenis, alekseyshl, vitalybuka Reviewed By: vitalybuka Subscribers: srhines, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48553 llvm-svn: 335981
* [cfi] Reset i-cache after copying code in test.Evgeniy Stepanov2018-06-291-2/+4
| | | | | | | Fixes intermittent crashes on Android. Also add PROT_READ to the code mapping for no real reason. llvm-svn: 335943
* [asan] Change 3 tests from XFAIL to UNSUPPORTED.Evgeniy Stepanov2018-06-283-3/+3
| | | | | | The failure in https://github.com/google/sanitizers/issues/981 is flaky. llvm-svn: 335941
* [asan] Disable 3 tests on Android O+.Evgeniy Stepanov2018-06-283-0/+11
| | | | | | https://github.com/google/sanitizers/issues/981 llvm-svn: 335937
* [asan] Fix one more test on Android.Evgeniy Stepanov2018-06-281-3/+5
| | | | | | | | | | This change makes it pass both on libstdc++ and libc++-based toolchains. The error was: error: function-like macro '__GLIBC_PREREQ' is not defined ^ llvm-svn: 335936
* [asan] un-XFAIL one testEvgeniy Stepanov2018-06-281-3/+0
| | | | | | | | | NDK r16 provides glob.h, which makes this test pass. Supporting different test outcomes depending on the version of NDK add unnecessary complexity to the test harness. IMHO, it's OK to require the latest stable release. llvm-svn: 335935
* [fuzzer] Don't run tests on Android.Evgeniy Stepanov2018-06-281-1/+1
| | | | | | Need better build system support. llvm-svn: 335933
* [TSan] More detailed error message on failed sahdow memory madviseAlex Shlyapnikov2018-06-281-3/+10
| | | | | | | | | | | | | | Summary: Report errno value on failed shadow memory madvise attempt and add a hint message with the possible workaround. Reviewers: eugenis Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48668 llvm-svn: 335928
* [UBsan] minimal unit tests removing OpenBSD spacial caseDavid Carlier2018-06-281-6/+0
| | | | | | | | | | | | The OpenBSD driver now handles sanitisers with ld.lld automatically. Reviewers: vitalybuka Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D48740 llvm-svn: 335923
* [Darwin] Add an integration test for PGO + symbol exportsVedant Kumar2018-06-281-0/+11
| | | | | | rdar://41470205 llvm-svn: 335891
* Skip building TSan on platforms where there are no 64-bit architectures.Kuba Mracek2018-06-281-1/+5
| | | | llvm-svn: 335873
* Correct the test modified in rL335777.Haojian Wu2018-06-281-1/+1
| | | | llvm-svn: 335865
* Support for multiarch runtimes layoutPetr Hosek2018-06-2813-29/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | This change adds a support for multiarch style runtimes layout, so in addition to the existing layout where runtimes get installed to: lib/clang/$version/lib/$os Clang now allows runtimes to be installed to: lib/clang/$version/$target/lib This also includes libc++, libc++abi and libunwind; today those are assumed to be in Clang library directory built for host, with the new layout it is possible to install libc++, libc++abi and libunwind into the runtime directory built for different targets. The use of new layout is enabled by setting the LLVM_ENABLE_RUNTIME_TARGET_DIR CMake variable and is supported by both projects and runtimes layouts. The runtimes CMake build has been further modified to use the new layout when building runtimes for multiple targets. Differential Revision: https://reviews.llvm.org/D45604 llvm-svn: 335809
* [libFuzzer] [Tests] [NFC] Change seed for reduce_inputs.testGeorge Karpenkov2018-06-281-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D48686 llvm-svn: 335802
* [libFuzzer] [NFC] [Tests] Mark signal handling tests as UNSUPPORTED on DarwinGeorge Karpenkov2018-06-272-2/+2
| | | | | | | | Under load, these tests tend to fail sporadically on our bots. In my understanding, the signal handling is not guaranteed to happen within 2 seconds, and the test is inherently flaky. llvm-svn: 335792
* [sanitizer] zx_cprng_draw no longer returns any valuePetr Hosek2018-06-271-1/+1
| | | | | | | | Remove the return value check. Differential Revision: https://reviews.llvm.org/D48671 llvm-svn: 335790
* Another shot at fixing android r335644 failureVlad Tsyrklevich2018-06-271-10/+15
| | | | | | | | | The android buildbot moves the build outputs to a different directory and rewrites the executable path, the DSO passed as an argument does not get re-written. Use rpaths to load the DSO the same way the test/cfi/cross-dso/ tests do and test the DSO name differently. llvm-svn: 335777
* [UBSan] Add silence_unsigned_overflow flag.Matt Morehouse2018-06-273-0/+9
| | | | | | | | | | | | | | | | | | | | Summary: Setting UBSAN_OPTIONS=silence_unsigned_overflow=1 will silence all UIO reports. This feature, combined with -fsanitize-recover=unsigned-integer-overflow, is useful for providing fuzzing signal without the excessive log output. Helps with https://github.com/google/oss-fuzz/issues/910. Reviewers: kcc, vsk Reviewed By: vsk Subscribers: vsk, kubamracek, Dor1s, llvm-commits Differential Revision: https://reviews.llvm.org/D48660 llvm-svn: 335762
* [sanitizer] zx_cprng_draw no longer takes the output argumentPetr Hosek2018-06-271-3/+1
| | | | | | | | The zx_cprng_draw system call no longer takes the output argument. Differential Revision: https://reviews.llvm.org/D48657 llvm-svn: 335755
* [asan] Relax the null_deref.cc test even furtherVedant Kumar2018-06-271-2/+2
| | | | | | | | | | | | On Darwin/x86_64, asan may report the crashing line of NullDeref as line 19 (i.e the closing brace of the function), whereas on other targets we see line 15 ("ptr[10]++"). The optimized debug info here isn't reliable enough to check. rdar://problem/41526369 llvm-svn: 335747
* [asan] Relax a test which depends on optimized debug infoVedant Kumar2018-06-271-2/+2
| | | | | | | | | | | On some ARM platforms this test depends on debug locations being present on constant materialization code, which was eliminated in r335497. Relax the test to allow two outcomes: the backtrace either contains the right line numbers, or no line numbers. llvm-svn: 335741
* [CMake] Tidy up the organisation of compiler-rt when configured as a standaloneDan Liew2018-06-277-2/+26
| | | | | | | | | | | | | | | | | | | build with an IDE (e.g. Xcode) as the generator. Previously the global `USE_FOLDERS` property wasn't set in standalone builds leading to existing settings of FOLDER not being respected. In addition to this there were several targets that appeared at the top level that were not interesting and clustered up the view. These have been changed to be displayed in "Compiler-RT Misc". Now when an Xcode project is generated from a standalone compiler-rt build the project navigator is much less cluttered. The interesting libraries should appear in "Compiler-RT Libraries" in the IDE. Differential Revision: https://reviews.llvm.org/D48378 llvm-svn: 335728
* Fix another bot broken by r335644Vlad Tsyrklevich2018-06-271-1/+1
| | | | | | | The android sanitizer bot can't resolve the function name in the DSO and it's not relevant to the test. llvm-svn: 335693
* Fix test broken by r335644Vlad Tsyrklevich2018-06-261-2/+4
| | | | llvm-svn: 335657
* CFI: Print DSO names for failed cross-DSO icallsVlad Tsyrklevich2018-06-263-8/+74
| | | | | | | | | | | | Reviewers: pcc Reviewed By: pcc Subscribers: kubamracek, delcypher, llvm-commits, kcc, #sanitizers Differential Revision: https://reviews.llvm.org/D48583 llvm-svn: 335644
* [libFuzzer] Do not turn unittest warnings into errors.Matt Morehouse2018-06-261-1/+0
| | | | | | | | Some warnings originating from googletest were causing bots to fail while bulding unit tests. The sanitizers address this issue by not using -Werror. We adopt this approach for libFuzzer. llvm-svn: 335640
* [libFuzzer] Mark several tests UNSUPPORTED for aarch64.Matt Morehouse2018-06-266-3/+7
| | | | | | | Now that check-fuzzer runs as part of check-all, some aarch64 bots had tests failing. llvm-svn: 335639
* Mark mfcall.cpp as UNSUPPORTED: win32.Peter Collingbourne2018-06-261-0/+2
| | | | llvm-svn: 335573
* Implement CFI for indirect calls via a member function pointer.Peter Collingbourne2018-06-264-6/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similarly to CFI on virtual and indirect calls, this implementation tries to use program type information to make the checks as precise as possible. The basic way that it works is as follows, where `C` is the name of the class being defined or the target of a call and the function type is assumed to be `void()`. For virtual calls: - Attach type metadata to the addresses of function pointers in vtables (not the functions themselves) of type `void (B::*)()` for each `B` that is a recursive dynamic base class of `C`, including `C` itself. This type metadata has an annotation that the type is for virtual calls (to distinguish it from the non-virtual case). - At the call site, check that the computed address of the function pointer in the vtable has type `void (C::*)()`. For non-virtual calls: - Attach type metadata to each non-virtual member function whose address can be taken with a member function pointer. The type of a function in class `C` of type `void()` is each of the types `void (B::*)()` where `B` is a most-base class of `C`. A most-base class of `C` is defined as a recursive base class of `C`, including `C` itself, that does not have any bases. - At the call site, check that the function pointer has one of the types `void (B::*)()` where `B` is a most-base class of `C`. Differential Revision: https://reviews.llvm.org/D47567 llvm-svn: 335569
* [UBsan] Enable ubsan minimal unit tests on OpenBSDDavid Carlier2018-06-252-2/+11
| | | | | | | | | | | | | OpenBSD needs lld linker for sanitisers. Disabling lint checking as some symbols cannot be defined and block the proper unit tests launch. Reviewers: lebedev.ri, vitalybuka Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D48528 llvm-svn: 335524
* [ubsan] Mark a test case as unsupported on WindowsVedant Kumar2018-06-251-2/+7
| | | | | | | | | __ubsan_on_report isn't defined as weak, and redefining it in a test is not supported on Windows. See the error message here: https://reviews.llvm.org/D48446 llvm-svn: 335523
* [CMake] Run libFuzzer tests with check-all.Matt Morehouse2018-06-251-2/+0
| | | | | | | | | | | | Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D48200 llvm-svn: 335519
* [HWASan] Initalize shadow earler.Alex Shlyapnikov2018-06-251-4/+4
| | | | | | | | | | | | | | Summary: Initialize shadow memory before calling more libc functions to allow for HWASan-instrumented libc. Reviewers: eugenis Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48551 llvm-svn: 335502
* [libFuzzer] Use Vector rather than std::vector.Matt Morehouse2018-06-251-1/+1
| | | | llvm-svn: 335487
* [ubsan] Fix __ubsan_on_report interface definitionVedant Kumar2018-06-222-1/+2
| | | | | | | | | | | | | | | | Speculative fix for the interface definition of __ubsan_on_report for the Windows bots: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/30528 lib\ubsan\ubsan_interface.inc(55): error C2065: '__ubsan_on_report': undeclared identifier INTERCEPT_SANITIZER_WEAK_FUNCTION was the wrong macro to use to begin with because __ubsan_on_report isn't weak. Reading through that macro, it's still not clear to me why there is an undefined reference, though, because it appears to define a dummy __ubsan_on_report shim. llvm-svn: 335383
* [ubsan] Add support for reporting diagnostics to a monitor processVedant Kumar2018-06-229-59/+246
| | | | | | | | | | | | | | | | | | Add support to the ubsan runtime for reporting diagnostics to a monitor process (e.g a debugger). The Xcode IDE uses this by setting a breakpoint on __ubsan_on_report and collecting diagnostic information via __ubsan_get_current_report_data, which it then surfaces to users in the editor UI. Testing for this functionality already exists in upstream lldb, here: lldb/packages/Python/lldbsuite/test/functionalities/ubsan Apart from that, this is `ninja check-{a,ub}san` clean. Differential Revision: https://reviews.llvm.org/D48446 llvm-svn: 335371
* tsan: fix deficiency in MutexReadOrWriteUnlockDmitry Vyukov2018-06-221-1/+1
| | | | | | | | | | MutexUnlock uses ReleaseStore on s->clock, which is the right thing to do. However MutexReadOrWriteUnlock for writers uses Release on s->clock. Make MutexReadOrWriteUnlock also use ReleaseStore for consistency and performance. Unfortunately, I don't think any test can detect this as this only potentially affects performance. llvm-svn: 335322
* [scudo] Add a minimal runtime for -fsanitize-minimal-runtime compatibilityKostya Kortchinsky2018-06-211-8/+34
| | | | | | | | | | | | | | | | | | | Summary: This patch follows D48373. The point is to be able to use Scudo with `-fsanitize-minimal-runtime`. For that we need a runtime that doesn't embed the UBSan one. This results in binaries that can be compiled with `-fsanitize=scudo,integer -fsanitize-minimal-runtime`. Reviewers: eugenis Reviewed By: eugenis Subscribers: mgorny, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D48377 llvm-svn: 335296
* [libFuzzer] Filter architectures for testing on Apple platforms.George Karpenkov2018-06-211-0/+4
| | | | | | This is done in all other sanitizers, and was missing on libFuzzer. llvm-svn: 335290
* [libFuzzer] Provide more descriptive names for testing targets.George Karpenkov2018-06-211-1/+1
| | | | llvm-svn: 335289
* [tsan] Use DARWIN_osx_LINK_FLAGS when building unit tests to match ASan ↵Kuba Mracek2018-06-211-0/+1
| | | | | | behavior. llvm-svn: 335265
* [sanitizer] Stop running tests against 32-bit iOS simulatorKuba Mracek2018-06-211-0/+5
| | | | llvm-svn: 335245
* [TSan] fix build and couple of unit tests on FreeBSDDavid Carlier2018-06-203-1/+7
| | | | | | | | | | | | | Similarly to Msan adding -pie provokes linkage issue, was spotted with pie_test.cc Set to XFAIL for couple of unit tests. Reviewers: vitalybuka, krytarowski, dim Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D48317 llvm-svn: 335166
* [Lsan] intercept thr_exit on FreeBSDDavid Carlier2018-06-202-3/+16
| | | | | | | | | | | | | | Intercepts thr_exit call on FreeBSD. Disable pthread key workflow. The pthread key create approach does not function under FreeBSD as the libpthread is not initialised enough at this stage. Reviewers: vitalybuka, krytarowski, dim Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D48268 llvm-svn: 335164
* [Sanitizers] Remove OOM/BadRequest allocator error handling policies.Alex Shlyapnikov2018-06-206-68/+43
| | | | | | | | | | | | | | | | | | | Summary: Remove the generic error nadling policies and handle each allocator error explicitly. Although more verbose, it allows for more comprehensive, precise and actionable allocator related failure reports. This finishes up the series of changes of the particular sanitizer allocators, improves the internal allocator error reporting and removes now unused policies. Reviewers: vitalybuka, cryptoad Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48328 llvm-svn: 335147
* Fix-up for r335123: Set default apple_platform to "osx".Kuba Mracek2018-06-201-1/+1
| | | | llvm-svn: 335133
* [sanitizer] Unify and generalize Apple platforms in CMake and lit test configsKuba Mracek2018-06-2012-47/+68
| | | | | | | | There's more platforms than just "ios" and "iossim" that we should support, and adding more lit config variables for each platform isn't great. Let's generalize and have a single value that determines what the platform under test is. Differential Revision: https://reviews.llvm.org/D48309 llvm-svn: 335123
* [asan] Add flushes to try to fix testReid Kleckner2018-06-201-1/+2
| | | | llvm-svn: 335089
* [asan] Add Windows test for handle_segv and SetUnhandledExceptionFilterReid Kleckner2018-06-201-0/+35
| | | | llvm-svn: 335087
OpenPOWER on IntegriCloud