summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [libFuzzer] simplify the DFT trace collection using the new faster DFSan ↵Kostya Serebryany2019-06-133-48/+98
| | | | | | mode that traces up to 16 labels at a time and never runs out of labels. llvm-svn: 363326
* [dfsan] Introduce dfsan_flush().Kostya Serebryany2019-06-131-0/+28
| | | | | | | | | | | | | | | | | | | Summary: dfsan_flush() allows to restart tain tracking from scratch in the same process. The primary purpose right now is to allow more efficient data flow tracing for DFT fuzzing: https://github.com/google/oss-fuzz/issues/1632 Reviewers: pcc Reviewed By: pcc Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D63037 llvm-svn: 363321
* [compiler-rt] Fix name_to_handle_at.cc test on Overlay2 (for Docker)Amy Kwan2019-06-121-1/+1
| | | | | | | | | | | | | This patch aims to fix the test case, name_to_handle_at.cc that fails on Docker. Overlay2 on Docker does not support the current check for the name_to_handle_at() function call of the test case. The proposed fix is to check for /dev/null in the test instead, as this check is supported. Checking for /dev/null has been utilized in the past for other test cases, as well. Differential Revision: https://reviews.llvm.org/D63094 llvm-svn: 363167
* Revert r362676 "[Profile]: Add runtime interface to specify file handle for ↵Hans Wennborg2019-06-122-74/+0
| | | | | | | | | | | | | | | profile data." This caused instrumented Clang to become crashy. See llvm-commits thread for repro steps. This also reverts follow-up r362716 which added test cases. > Author: Sajjad Mirza > > Differential Revision: http://reviews.llvm.org/D62541 llvm-svn: 363134
* Add FuzzedDataProvider helper class / single header library.Max Moroz2019-06-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This class is useful for writing fuzz target that have multiple inputs. Current CL imports the existing `FuzzedDataProvider` from Chromium without any modifications. Feel free to review it thoroughly, if you're interested, but I'd prefer changing the class in a follow up CL. The CL also introduces an exhaustive test for the library, as the behavior of `FuzzedDataProvider` must not change over time. In follow up CLs I'm planning on changing some implementation details (I can share a doc with some comments to be addressed). After that, we will document how `FuzzedDataProvider` should be used. I have tested this on Linux, Windows and Mac platforms. Reviewers: morehouse, metzman, kcc Reviewed By: morehouse Subscribers: metzman, thakis, rnk, mgorny, ormris, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D62733 llvm-svn: 363071
* Experimantal dfsan mode "fast16labels=1"Kostya Serebryany2019-06-081-0/+25
| | | | | | | | | | | | | | | | | | Summary: dfsan mode "fast16labels=1". In this mode the labels are treated as 16-bit bit masks. Reviewers: pcc Reviewed By: pcc Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D62870 llvm-svn: 362859
* [GWP-ASan] Removed unittests from Android build.Mitch Phillips2019-06-071-1/+6
| | | | | | | | | | | | | | | | | | | | | | | Summary: Longstanding issues in the Android test runner means that compiler-rt unit tests don't work on Android due to libc++ link-time issues. Looks like the exported libc++ from the Android NDK is x86-64, even though it's part of the ARM[64] toolchain... See similar measures for ASan and sanitizer-common that disable unit tests for Android. Should fully fix the Android bots (@vlad.tsyrklevich). Reviewers: vitalybuka Reviewed By: vitalybuka Subscribers: srhines, kubamracek, mgorny, javed.absar, kristof.beyls, #sanitizers, llvm-commits, vlad.tsyrklevich Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D63019 llvm-svn: 362842
* Set an output file name for the override-new-delete.cpp test.Peter Collingbourne2019-06-071-1/+1
| | | | | | The android_compile.py script requires one. llvm-svn: 362764
* Change GWP-ASan build to use '-pthread' instead of '-lpthread' in orderMitch Phillips2019-06-061-1/+1
| | | | | | | | to try and fix android buildbot. Also make sure that the empty dummy test contains an output file name so the android_build.py wrapper script doesn't check fail. llvm-svn: 362758
* [Profile]: Add runtime interface to specify file handle for profile data ↵Xinliang David Li2019-06-062-0/+74
| | | | | | | | | | | | (Part-II) Test cases Author: Sajjad Mirza Differential Revision: http://reviews.llvm.org/D62541 llvm-svn: 362716
* [HWASAN] Make new/delete weakEugene Leviant2019-06-041-0/+23
| | | | | | | | | This allows instrumenting programs which have their own versions of new and delete operators. Differential revision: https://reviews.llvm.org/D62794 llvm-svn: 362478
* [GWP-ASan] Mutex implementation [2].Mitch Phillips2019-05-305-0/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: See D60593 for further information. This patch pulls out the mutex implementation and the required definitions file. We implement our own mutex for GWP-ASan currently, because: 1. We must be compatible with the sum of the most restrictive elements of the supporting allocator's build system. Current targets for GWP-ASan include Scudo (on Linux and Fuchsia), and bionic (on Android). 2. Scudo specifies `-nostdlib++ -nonodefaultlibs`, meaning we can't use `std::mutex` or `mtx_t`. 3. We can't use `sanitizer_common`'s mutex, as the supporting allocators cannot afford the extra maintenance (Android, Fuchsia) and code size (Fuchsia) overheads that this would incur. In future, we would like to implement a shared base mutex for GWP-ASan, Scudo and sanitizer_common. This will likely happen when both GWP-ASan and Scudo standalone are not in the development phase, at which point they will have stable requirements. Reviewers: vlad.tsyrklevich, morehouse, jfb Reviewed By: morehouse Subscribers: dexonsmith, srhines, cfe-commits, kubamracek, mgorny, cryptoad, jfb, #sanitizers, llvm-commits, vitalybuka, eugenis Tags: #sanitizers, #llvm, #clang Differential Revision: https://reviews.llvm.org/D61923 llvm-svn: 362138
* mac: Make ubsan test config look more like asan test configNico Weber2019-05-291-4/+1
| | | | | | | | | | | | | | | | | | | | | | | In particular, don't call get_target_flags_for_arch() since that will cause an error in some situations: If DARWIN_iossim_ARCHS=i386;x86_64, DARWIN_osx_ARCHS=x86_64, and DARWIN_iossym_SYSROOT isn't set (due to the simulator sysroot not being available), then config-ix.cmake won't add i386 to COMPILER_RT_SUPPORTED_ARCH but ubsan's test/CMakeLists.txt would call get_target_flags_for_arch() with i386, which would then run into the error in get_target_flags_for_arch(). Having these conditions isn't ideal. The background here is that we configure our mac-hosted trunk bots all the same (so they all have the same DARWIN_*_archs, and we don't easily know if a mac host bot is targeting mac or ios at the place where we call cmake), but only the ios-targeting bots have ios sysroots available. This will hopefully unbreak that use case without impacting anything else -- and it makes ubsan and asan test setup more alike. llvm-svn: 362010
* [libFuzzer] when using data-flow-trace (DFT) only load the DFT for the files ↵Kostya Serebryany2019-05-241-1/+1
| | | | | | present in the corpus llvm-svn: 361579
* [libFuzzer] remove the data-flow-trace (DFT) python scripts; their ↵Kostya Serebryany2019-05-231-13/+0
| | | | | | functionality is now part of libFuzzer proper; also write functions.txt to the disk only if this file doesn't exist yet llvm-svn: 361452
* [libFuzzer] automatically collect the data flow trace (DFT) in the fork mode ↵Kostya Serebryany2019-05-231-0/+12
| | | | | | if -collect_data_flow= is given llvm-svn: 361448
* [Sanitizer] Add interceptor for wcsdupPavel Labath2019-05-221-0/+15
| | | | | | | | | | | | | | Summary: The wide-string equivalent of strdup. Implementation trivial. Reviewers: vitalybuka, eugenis Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D62189 llvm-svn: 361357
* [libFuzzer] Sleep after process exits in merge-sigusr.test.Matt Morehouse2019-05-221-0/+1
| | | | | | Ensure that log file has been fully updated before trying to read it. llvm-svn: 361339
* [libFuzzer] Kill by session ID in merge-sigusr.test.Matt Morehouse2019-05-211-3/+3
| | | | | | Ensures that parent and all child processes are killed at once. llvm-svn: 361336
* [libFuzzer] Ignore exit status of wait in merge-sigusr.test.Matt Morehouse2019-05-211-1/+1
| | | | | | | If process $PID has already exited, wait will give a non-zero exit status. llvm-svn: 361326
* [libFuzzer] Reduce flakiness of merge-sigusr.test.Matt Morehouse2019-05-211-3/+10
| | | | | | Double the number of files to merge, and use wait instead of sleep. llvm-svn: 361313
* [libFuzzer] Disable fork-sigusr.test on AArch64.Matt Morehouse2019-05-201-1/+1
| | | | | | Test fails on the clang-cmake-aarch64-lld build and I'm not sure why. llvm-svn: 361185
* [libFuzzer] Dump input on failure for sigusr tests.Matt Morehouse2019-05-172-2/+2
| | | | | | Should help with debugging failures on the bots. llvm-svn: 361070
* [hwasan] Limit try-catch tests to aarch64.Evgeniy Stepanov2019-05-171-0/+3
| | | | | | | HWASan C++ tests do not do well on x86_64. Fixes https://bugs.llvm.org/show_bug.cgi?id=41923 llvm-svn: 361063
* [libFuzzer] Use SleepOneSecondTest.cpp for fork-sigusr.test.Matt Morehouse2019-05-171-2/+2
| | | | | | | | ShallowOOMDeepCrash.cpp may hit libFuzzer's RSS limit before the SIGUSR2 is delivered, causing the test to be flaky when bots are under load. SleepOneSecondTest.cpp will keep running until the signal is delivered. llvm-svn: 361048
* HWASan exception support.Evgeniy Stepanov2019-05-161-0/+60
| | | | | | | | | | | | | | | | | | Summary: Adds a call to __hwasan_handle_vfork(SP) at each landingpad entry. Reusing __hwasan_handle_vfork instead of introducing a new runtime call in order to be ABI-compatible with old runtime library. Reviewers: pcc Subscribers: kubamracek, hiraditya, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61968 llvm-svn: 360959
* [TSan][libdispatch] Use FileCheck's --implicit-check-not=...Julian Lettner2019-05-1618-37/+18
| | | | | | | | | | | | | | | | | | | | | | | Use FileCheck's --implicit-check-not='ThreadSanitizer' which increases the strictness of our tests a bit. NFC. ``` CHECK: start CHECK-NOT: ThreadSanitizer CHECK: done ``` With --implicit-check-not, the above is turned into: ``` CHECK-NOT: ThreadSanitizer CHECK: start CHECK-NOT: ThreadSanitizer CHECK: done CHECK-NOT: ThreadSanitizer ``` llvm-svn: 360927
* [libFuzzer] Disable merge-sigusr.test on linux.Matt Morehouse2019-05-161-1/+2
| | | | | | Make buildbot green while I rethink the test. llvm-svn: 360914
* [crt] Mark dso_handle test as xfailing on ARM.Yvan Roux2019-05-161-0/+2
| | | | | | This is a temporary action to fix the bots. llvm-svn: 360873
* [libFuzzer] Increase merge-sigusr sleep after sending signal.Matt Morehouse2019-05-161-1/+1
| | | | | | | Test is flaky on buildbot at least partially due to the fuzz target not exiting before we read its output. llvm-svn: 360848
* [libFuzzer] Also kill parent process in merge-siguser.test.Matt Morehouse2019-05-161-0/+1
| | | | llvm-svn: 360840
* [libFuzzer] Fix typo in merge-sigusr.test.Matt Morehouse2019-05-161-1/+1
| | | | llvm-svn: 360836
* [libFuzzer] Use PID to send signals rather than process name.Matt Morehouse2019-05-162-4/+4
| | | | | | | | pkill reads the process name as a pattern, not a raw name. This means that if the process name contains + or other regex characters, pkill fails. llvm-svn: 360835
* [libFuzzer] Echo fuzzer output on sigusr tests.Matt Morehouse2019-05-152-2/+2
| | | | | | Improves debuggability when the fuzz target crashes. llvm-svn: 360824
* [libFuzzer] reimplement DFT's collect_data_flow inside libFuzzer so that we ↵Kostya Serebryany2019-05-142-8/+24
| | | | | | don't need external python scripts llvm-svn: 360712
* [GWP-ASan] Initial build files, implementation of PRNG [1].Mitch Phillips2019-05-141-0/+0
| | | | | | | | | | | | | | | | | | Summary: See D60593 for further information. This patch slices off the PRNG implementation and the initial build files for GWP-ASan. Reviewers: vlad.tsyrklevich, morehouse, vitalybuka Reviewed By: morehouse Subscribers: srhines, kubamracek, mgorny, #sanitizers, llvm-commits, cryptoad, eugenis Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61867 llvm-svn: 360710
* [libFuzzer] Unpoison parameters before calling user callback.Matt Morehouse2019-05-092-0/+33
| | | | | | | | | | | | | | | | | | | | Summary: Fixes an MSan false positive when compiling with -fsanitize=memory,fuzzer. See https://github.com/google/oss-fuzz/issues/2369 for more details. Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits, metzman, eugenis Tags: #llvm Differential Revision: https://reviews.llvm.org/D61753 llvm-svn: 360390
* [TSan][libdispatch] Enable test that supposedly deadlocks on botJulian Lettner2019-05-091-2/+0
| | | | | | | | Re-enable test that was disabled because it deadlocks when running on the bot, but was never enabled again. Can't reproduce deadlock locally so trying to investigate by re-enabling test. llvm-svn: 360388
* [libFuzzer] perform more agressive value profiling in memcmpKostya Serebryany2019-05-091-1/+2
| | | | llvm-svn: 360385
* [MSan] Introduce __msan_unpoison_param().Matt Morehouse2019-05-091-0/+51
| | | | | | | | | | | | | | | | | | | Summary: This allows libFuzzer to unpoison parameter shadow before calling LLVMFuzzerTestOneInput to eliminate the false positives described in https://github.com/google/oss-fuzz/issues/2369. Reviewers: eugenis Reviewed By: eugenis Subscribers: llvm-commits, metzman, kcc Tags: #llvm Differential Revision: https://reviews.llvm.org/D61751 llvm-svn: 360379
* [libFuzzer] implement -focus_function=auto, to be used with Data Flow TracesKostya Serebryany2019-05-093-4/+21
| | | | llvm-svn: 360378
* [libFuzzer] simplify value-profile-mem.test a little bitKostya Serebryany2019-05-091-1/+2
| | | | llvm-svn: 360372
* [libFuzzer] DFT: when dumping coverage, also dump the total number of ↵Kostya Serebryany2019-05-081-2/+2
| | | | | | instrumented blocks in a function; update merge_data_flow.py to merge coverage llvm-svn: 360272
* [compiler-rt] Make builtins test pass when using i386 gcc as host compilerNico Weber2019-05-081-1/+1
| | | | | | | | | | | | | | | | | Just-built-clang is used to compile the test, but the library is built with gcc, so the usual 80-bit FPU vs 32-bit SSE mismatch makes the floating computations not bitwise identical. Fixes PR32910, see there for details. This uses the same technique used in all the other *c3* tests, see in particular mulsc3_test.c. (It might be cleaner to add compareResultCF to fp_test.h to force the floats into 32-bit in memory, but this is the less invasive fix.) Differential Revision: https://reviews.llvm.org/D61684 llvm-svn: 360264
* [libFuzzer] extend the test for data flow tracer and coverage; also ↵Kostya Serebryany2019-05-081-1/+11
| | | | | | hopefully fix it on the bot llvm-svn: 360215
* [libFuzzer] extend the data flow tracer to also produce basic block coverage ↵Kostya Serebryany2019-05-083-25/+44
| | | | | | for every input. An extended test coming in a separte change. llvm-svn: 360213
* [libFuzzer] disable two tests on i386 that are causing timeouts on the botsKostya Serebryany2019-05-082-2/+2
| | | | llvm-svn: 360211
* [libFuzzer] Increase timeouts on fork tests and skip one on aarch64Peter Smith2019-05-073-8/+8
| | | | | | | | | | | | | The tests fork.text, fork.sigusr.test and fork-ubsan.test intermittently fail on the aarch64 buildbots. Input gathered from the fork.sigusr.test implies that when the builder is under load the timeout value is not sufficient. The fork-ubsan.test doesn't have a timeout and I think is not always finding the error after 10000 runs so I've marked it as unsupported for now. Differential Revision: https://reviews.llvm.org/D61449 llvm-svn: 360126
* Add libc++ to link XRay test cases if libc++ is used to build CLANGXing Xue2019-05-062-1/+10
| | | | | | | | | | | | | | Summary: When libc++ is used to build CLANG, its XRay libraries libclang_rt.xray-*.a have dependencies on libc++. Therefore, libc++ is needed to link and run XRay test cases. For Linux -rpath is also needed to specify where to load libc++. This change sets macro LLVM_LIBCXX_USED to 1 if libc++ is actually used in the build. XRay tests then check the flag and add -L<llvm_shlib_dir> -lc++ and -Wl,-rpath=<llvm_shlib_dir> if needed. Reviewers: hubert.reinterpretcast, amyk, dberris, jasonliu, sfertile, EricWF Subscribers: dberris, mgorny, jsji, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61016 llvm-svn: 360060
* Fix check-builtins on Windows after alias changesReid Kleckner2019-05-021-1/+5
| | | | llvm-svn: 359835
OpenPOWER on IntegriCloud