summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2018-01-03Hide some symbols to avoid a crash on shutdown when using code coverageMarco Castelluccio
Summary: gcov / gcda-based profiling crashes when shared libraries are unloaded Patch by Benoit Belley and test by Marco Castelluccio for Firefox See https://bugs.llvm.org/show_bug.cgi?id=27224 & https://bugzilla.mozilla.org/show_bug.cgi?id=1401230 Reviewers: davidxl, rnk, void Subscribers: jessicah, marco-c, belleyb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D38124 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321703 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-01[scudo] Touch memory to count as RSSJonas Hahnfeld
This should fix the test from https://reviews.llvm.org/D41128. Differential Revision: https://reviews.llvm.org/D41649 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321627 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-28[msan] Intercept pthread_getname_np.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321544 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-28-fsanitize=vptr warnings on bad static types in dynamic_cast and typeidStephan Bergmann
...when such an operation is done on an object during con-/destruction. (This adds a test case to compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp that, unlike the existing test cases there, wants to detect multiple UBSan warnings in one go. Therefore, that file had to be changed from globally using -fno-sanitize-recover to individually using halt_on_error only where appropriate.) This is the compiler-rt part of a patch covering both cfe and compiler-rt. Differential Revision: https://reviews.llvm.org/D40295 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321518 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-23[Sanitizers] Export aligned new/delete from runtimes.Alex Shlyapnikov
Summary: Export aligned new/delete to make dynamic runtimes work again. Remove all valid new/delete cases from ASan test, there's a test in common for that. Reviewers: eugenis Subscribers: srhines, kubamracek, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D41548 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321394 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-22[Sanitizers] Disable new_delete_test.cc on Android until it's supported.Alex Shlyapnikov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321374 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-22[MSan,TSan] Add aligned new/delete interceptors.Alex Shlyapnikov
Summary: Providing aligned new/delete implementations to match ASan. Unlike ASan, MSan and TSan do not perform any additional checks on overaligned memory, hence no sanitizer specific tests. Reviewers: eugenis Subscribers: kubamracek, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D41532 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321365 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-21[ubsan] Diagnose noreturn functions which return (compiler-rt)Vedant Kumar
This is paired with the clang change: https://reviews.llvm.org/D40698 Differential Revision: https://reviews.llvm.org/D40700 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321232 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-20[hwasan] Implement -fsanitize-recover=hwaddress.Evgeniy Stepanov
Summary: Very similar to AddressSanitizer, with the exception of the error type encoding. Reviewers: kcc, alekseyshl Subscribers: cfe-commits, kubamracek, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D41417 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321203 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-20[hwasan] Remove --check-prefix=CHECK (NFC)Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321141 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-19[hwasan] Fix handling of store errors.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321121 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-19[hwasan] Remove unused -check-prefix in tests.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321119 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-18[PGO] Test case changes for D41059Xinliang David Li
Differential Revision: http://reviews.llvm.org/D41059 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320999 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-18[asan] Add interceptor for printf_chkMaxim Ostapenko
There could be a situation when a specific DSO was built with FORTIFY_SOURCE option. In case asan-ed binary link against that DSO, libasan can't handle the possible memory error because it does not have interceptors for spinrtf_chk, snprintf_chk, vprintf_chk, vsnprintf_chk, __fprintf_chk functions. Let's interceptors for them. Patch by Denis Khalikov. Differential Revision: https://reviews.llvm.org/D40951 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320990 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-18Revert r320977 "No -fsanitize=function warning when calling noexcept ↵Stephan Bergmann
function through non-noexcept pointer in C++17" At least <http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/ builds/6013/steps/annotate/logs/stdio> complains about __ubsan::__ubsan_handle_function_type_mismatch_abort (compiler-rt lib/ubsan/ubsan_handlers.cc) returning now despite being declared 'noreturn', so looks like a different approach is needed for the function_type_mismatch check to be called also in cases that may ultimately succeed. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320981 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-18No -fsanitize=function warning when calling noexcept function through ↵Stephan Bergmann
non-noexcept pointer in C++17 As discussed in the mail thread <https://groups.google.com/a/isocpp.org/forum/ #!topic/std-discussion/T64_dW3WKUk> "Calling noexcept function throug non- noexcept pointer is undefined behavior?", such a call should not be UB. However, Clang currently warns about it. There is no cheap check whether two function type_infos only differ in noexcept,so pass those two type_infos as additional data to the function_type_mismatch handler (with the optimization of passing a null "static callee type" info when that is already noexcept, so the additional check can be avoided anyway). For the Itanium ABI (which appears to be the only one that happens to be used on platforms that support -fsanitize=function, and which appears to only record noexcept information for pointer-to-function type_infos, not for function type_infos themselves), we then need to check the mangled names for occurrence of "Do" representing "noexcept". This is the compiler-rt part of a patch covering both cfe and compiler-rt. Differential Revision: https://reviews.llvm.org/D40720 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320977 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-15[libFuzzer] make the tests depend on ubsanKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320787 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14[profile] Port the runtime to Solaris (retry)Vedant Kumar
This includes a few nice bits of refactoring (e.g splitting out the exclusive locking code into a common utility). Hopefully the Windows support is fixed now. Patch by Rainer Orth! Differential Revision: https://reviews.llvm.org/D40944 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320731 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14Revert "(HEAD -> master, origin/master, origin/HEAD) [profile] Port the ↵Vedant Kumar
runtime to Solaris" This reverts commit r320726. It looks like flock isn't available on Windows: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/21317/steps/build%20compiler-rt/logs/stdio git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320728 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14[profile] Port the runtime to SolarisVedant Kumar
This includes a few nice bits of refactoring (e.g splitting out the exclusive locking code into a common utility). Patch by Rainer Orth! Differential Revision: https://reviews.llvm.org/D40944 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320726 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14[scudo] Disabling the interface test on armhfKostya Kortchinsky
Summary: I will investigate the breakage tomorrow, disable on armhf to turn the bots green over the night. http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-a15-full-sh/builds/2952/steps/ninja%20check%202/logs/FAIL%3A%20Scudo-armhf%3A%3A%20interface.cpp This is post https://reviews.llvm.org/D41128. Reviewers: alekseyshl Subscribers: aemerson, kristof.beyls, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D41218 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320665 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14[XRay][compiler-rt] Coalesce calls to mprotect to reduce patching overheadDean Michael Berris
Summary: Before this change, XRay would conservatively patch sections of the code one sled at a time. Upon testing/profiling, this turns out to take an inordinate amount of time and cycles. For an instrumented clang binary, the cycles spent both in the patching/unpatching routine constituted 4% of the cycles -- this didn't count the time spent in the kernel while performing the mprotect calls in quick succession. With this change, we're coalescing the number of calls to mprotect from being linear to the number of instrumentation points, to now being a lower constant when patching all the sleds through `__xray_patch()` or `__xray_unpatch()`. In the case of calling `__xray_patch_function()` or `__xray_unpatch_function()` we're now doing an mprotect call once for all the sleds for that function (reduction of at least 2x calls to mprotect). Reviewers: kpw, eizan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41153 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320664 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13[scudo] Adding a public Scudo interfaceKostya Kortchinsky
Summary: The first and only function to start with allows to set the soft or hard RSS limit at runtime. Add associated tests. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: mgorny, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D41128 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320611 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13[hwasan] Inline instrumentation & fixed shadow.Evgeniy Stepanov
Summary: This brings CPU overhead on bzip2 down from 5.5x to 2x. Reviewers: kcc, alekseyshl Subscribers: kubamracek, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D41137 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320538 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12[libFuzzer] change the strategy for -experimental_len_control to grow ↵Kostya Serebryany
max_len slower git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320531 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12[msan] LIT: Add lld testing configRoman Lebedev
Summary: A follow-up for D39508, with memory sanitizer changes. Reviewers: eugenis, vitalybuka Reviewed By: eugenis Subscribers: mgorny, mehdi_amini, kcc, #sanitizers, llvm-commits Tags: #sanitizers, #lld Differential Revision: https://reviews.llvm.org/D40768 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320514 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12[CMake] Support runtimes and monorepo layouts when looking for libcxxPetr Hosek
This also slightly refactors the code that's checking the directory presence which allows eliminating one unnecessary variable. Differential Revision: https://reviews.llvm.org/D40637 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320446 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-10Update another sanitizer test for C++14.Ahmed Bougacha
Follow-up to r320251. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320284 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09[libFuzzer] even less aggressive step function for stack depth. Also don't ↵Kostya Serebryany
use asan in one test to speed it up git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320259 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Update sanitizer tests for C++14 default in ClangTim Northover
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320251 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Revert change in test/msan/textdomain.cc for NetBSDKamil Rytarowski
SVN r. 320226 This breaks Linux. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320236 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Hardware-assisted AddressSanitizer (compiler-rt)Evgeniy Stepanov
Summary: Runtime library for HWASan, initial commit. Does not randomize tags yet, does not handle stack or globals. Reviewers: kcc, pcc, alekseyshl Subscribers: srhines, kubamracek, dberris, mgorny, llvm-commits, krytarowski Differential Revision: https://reviews.llvm.org/D40935 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320231 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Fix test/msan/iconv.cc on NetBSDKamil Rytarowski
Summary: NetBSD still uses the old POSIX iconv(3) signature with the 2nd const argument. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41017 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320228 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Fix test/msan/textdomain.cc on NetBSDKamil Rytarowski
Summary: This tests must be linked with -lintl for the gettext(3) features. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41013 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320226 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Disable test/msan/tsearch.cc on NetBSDKamil Rytarowski
Summary: This test uses GNU-specific extension to libc: tdestroy() and as-is is not compatible with NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41011 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320225 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Disable test/msan/pvalloc.cc on NetBSDKamil Rytarowski
Summary: The pvalloc(3) function is a non-standard extension missing on NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41014 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320224 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Fix test/msan/ifaddrs.cc for NetBSDKamil Rytarowski
Summary: NetBSD requires to include <sys/socket.h> for struct sockaddr. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41015 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320223 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Disable test/msan/ftime.cc on NetBSDKamil Rytarowski
Summary: ftime(3) has been removed from libc/NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41018 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320222 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08Update test case for r320180Xinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320181 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08[ubsan] Test for pass_object_size bounds checksVedant Kumar
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320129 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07[PowerPC][asan] Update asan to handle changed memory layouts in newer kernelsBill Seurer
In more recent Linux kernels with 47 bit VMAs the layout of virtual memory for powerpc64 changed causing the address sanitizer to not work properly. This patch adds support for 47 bit VMA kernels for powerpc64 and fixes up test cases. https://reviews.llvm.org/D40908 There is an associated patch for trunk. Tested on several 4.x and 3.x kernel releases. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320110 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07Test case update for D40873Xinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320105 91177308-0d34-0410-b5e6-96231b3b80d8
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-05Revert test case change for r319794Xinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319842 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05[PGO] fix test case for D40702Xinliang David Li
Differential Revision: http://reviews.llvm.org/D40702 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319795 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05[XRay][compiler-rt] Implement XRay Basic Mode FilteringDean Michael Berris
Summary: This change implements the basic mode filtering similar to what we do in FDR mode. The implementation is slightly simpler in basic-mode filtering because we have less details to remember, but the idea is the same. At a high level, we do the following to decide when to filter function call records: - We maintain a per-thread "shadow stack" which keeps track of the XRay instrumented functions we've encountered in a thread's execution. - We push an entry onto the stack when we enter an XRay instrumented function, and note the CPU, TSC, and type of entry (whether we have payload or not when entering). - When we encounter an exit event, we determine whether the function being exited is the same function we've entered recently, was executing in the same CPU, and the delta of the recent TSC and the recorded TSC at the top of the stack is less than the equivalent amount of microseconds we're configured to ignore -- then we un-wind the record offset an appropriate number of times (so we can overwrite the records later). We also support limiting the stack depth of the recorded functions, so that we don't arbitrarily write deep function call stacks. Reviewers: eizan, pelikan, kpw, dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40828 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319762 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05[XRay][compiler-rt] Implement logging implementation registrationDean Michael Berris
Summary: This change allows for registration of multiple logging implementations through a central mechanism in XRay, mapping an implementation to a "mode". Modes are strings that are used as keys to determine which implementation to install through a single API. This mechanism allows users to choose which implementation to install either from the environment variable 'XRAY_OPTIONS' with the `xray_mode=` flag, or programmatically using the `__xray_select_mode(...)` function. Here, we introduce two API functions for the XRay logging: __xray_log_register_mode(Mode, Impl): Associates an XRayLogImpl to a string Mode. We can only have one implementation associated with a given Mode. __xray_log_select_mode(Mode): Finds the associated Impl for Mode and installs it as if by calling `__xray_set_log_impl(...)`. Along with these changes, we also deprecate the xray_naive_log and xray_fdr_log flags and encourage users to instead use the xray_mode flag. Reviewers: kpw, dblaikie, eizan, pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40703 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319759 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-04[ASan] Disable invalid-pointer-pairs-threads.cc on Darwin.Alex Shlyapnikov
pthread barriers are not available on OS X Differential revision: https://reviews.llvm.org/D40600 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319681 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-04[ASan] Fix test/asan/TestCases/Posix/invalid-pointer-pairs-threads.ccAlex Shlyapnikov
Explicitly add pthread for asan-dynamic config. Differential revision: https://reviews.llvm.org/D40600 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319671 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-04These tests require x86 80-bit doubles. Mark them so.Sterling Augustine
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319669 91177308-0d34-0410-b5e6-96231b3b80d8