summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/fuzzer
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* [libFuzzer] Re-enable libFuzzer on i386 Linux and fix testJonathan Metzman2019-05-021-0/+2
| | | | | | | | | | | | | | | | | | | | | Summary: Re-enable libFuzzer on i386 Linux after it was accidentally disabled. Also disable gc-sections.test on i386 since lld isn't garbage collecting properly with ASAN on i386. Reviewers: morehouse Reviewed By: morehouse Subscribers: srhines, mgorny, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61415 llvm-svn: 359802
* [libFuzzer] Add --dump-input-on-failure to help diagnose AArch64 failuresPeter Smith2019-05-012-6/+6
| | | | | | | | | | | | | | The fork-siguser.test and fork.test intermittently fail on the AArch64 buildbot. Unfortunately these failures are not reproducible on a similar machine and seem to fail when the machines are under load. Before suggesting the tests be marked unsupported for AArch64 we'd like to see if we can get some more information about the failures to see if it helps us reproduce. This patch adds --dump-input-on-failure to the FileCheck commands to see if we can get some more information about the failures. Differential Revision: https://reviews.llvm.org/D61315 llvm-svn: 359675
* [libFuzzer] Fix failing test: sigint.testJonathan Metzman2019-04-301-3/+1
| | | | | | | | | | | | | | | | | | Summary: Fix sigint.test by making it require msan rather than enumerating unsupported platforms. Reviewers: kcc Reviewed By: kcc Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61353 llvm-svn: 359638
* [libFuzzer] temporarily disable a test on windows, where there is no memmem ↵Kostya Serebryany2019-04-301-0/+2
| | | | | | in the usual place llvm-svn: 359624
* [libFuzzer] add MagicSeparatorTestKostya Serebryany2019-04-302-0/+51
| | | | llvm-svn: 359620
* [libFuzzer] Replace -seed_corpus to better support fork mode on WinJonathan Metzman2019-04-301-0/+24
| | | | | | | | | | | | | | | | | | Summary: Pass seed corpus list in a file to get around argument length limits on Windows. This limit was preventing many uses of fork mode on Windows. Reviewers: kcc, morehouse Reviewed By: kcc Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D60980 llvm-svn: 359610
* fix broken testJonathan Metzman2019-04-301-7/+7
| | | | llvm-svn: 359590
* remove extra zerosJonathan Metzman2019-04-301-1/+1
| | | | llvm-svn: 359589
* remove stale commentJonathan Metzman2019-04-301-1/+1
| | | | llvm-svn: 359588
* fix commentJonathan Metzman2019-04-301-1/+1
| | | | llvm-svn: 359586
* [libFuzzer] Enable for i386Jonathan Metzman2019-04-301-0/+2
| | | | | | | | | | | | Summary: Get libFuzzer to build on i386 and fix tests. Subscribers: mgorny, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61070 llvm-svn: 359585
* Fix issues with testing for i386Jonathan Metzman2019-04-305-3/+8
| | | | llvm-svn: 359584
* Enable x86 buildsJonathan Metzman2019-04-303-6/+4
| | | | llvm-svn: 359583
* [CMake] Don't modify `FUZZER_SUPPORTED_ARCH` is place.Dan Liew2019-04-281-2/+3
| | | | | | | | | | | | | | On a Darwin host we were modifying the `FUZZER_SUPPORTED_ARCH` in place which would strip out non-x86 architectures. This unhelpful if we want to use `FUZZER_SUPPORTED_ARCH` later. To fix this we introduce `FUZZER_TEST_ARCH` which is similar to what we have for for the other sanitizers. For non-Darwin host platforms `FUZZER_TEST_ARCH` is the same as `FUZZER_SUPPORTED_ARCH` but for Darwin host platforms we use `darwin_filter_host_archs(...)` as the previous code did. llvm-svn: 359394
* Revert "[CMake] Fix the value of `config.target_cflags` for non-macOS Apple"Dan Liew2019-04-261-5/+1
| | | | | | | | | | | | | | | | | | | | | This reverts commit 1bcdbd68616dc7f8debe126caafef7a7242a0e6b. It's been reported that some bots are failing with this change with CMake error like: ``` CMake Error at /b/s/w/ir/k/llvm-project/compiler-rt/cmake/config-ix.cmake:177 (message): Unsupported architecture: arm64 Call Stack (most recent call first): /b/s/w/ir/k/llvm-project/compiler-rt/cmake/config-ix.cmake:216 (get_target_flags_for_arch) /b/s/w/ir/k/llvm-project/compiler-rt/test/tsan/CMakeLists.txt:78 (get_test_cflags_for_apple_platform) ``` I'm reverting the patch now to unbreak builds. I will investigate properly when time permits. rdar://problem/50124489 llvm-svn: 359327
* [CMake] Fix the value of `config.target_cflags` for non-macOS AppleDan Liew2019-04-261-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | platforms. The main problem here is that `-*-version_min=` was not being passed to the compiler when building test cases. This can cause problems when testing on devices running older OSs because Clang would previously assume the minimum deployment target is the the latest OS in the SDK which could be much newer than what the device is running. Previously the generated value looked like this: `-arch arm64 -isysroot <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk` With this change it now looks like: `-arch arm64 -stdlib=libc++ -miphoneos-version-min=8.0 -isysroot <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk` This mirrors the setting of `config.target_cflags` on macOS. This change is made for ASan, LibFuzzer, TSan, and UBSan. To implement this a new `get_test_cflags_for_apple_platform()` function has been added that when given an Apple platform name and architecture returns a string containing the C compiler flags to use when building tests. This also calls a new helper function `is_valid_apple_platform()` that validates Apple platform names. rdar://problem/50124489 Differential Revision: https://reviews.llvm.org/D58578 llvm-svn: 359305
* [libFuzzer] Disable MSan interceptors in SIGINT handler.Matt Morehouse2019-04-261-0/+17
| | | | | | | | | | | | | | | | | | | | | | Summary: Avoids an MSan false positive if the SIGINT comes while the user callback is running. The false positive happens when the interrupt handler calls opendir() to remove some temporary files, which is intercepted by MSan. Fixes https://github.com/google/oss-fuzz/issues/2332. Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits, Dor1s, metzman Tags: #llvm Differential Revision: https://reviews.llvm.org/D61163 llvm-svn: 359254
* [libFuzzer] Require linux for libcxx.testMatt Morehouse2019-04-251-0/+1
| | | | llvm-svn: 359223
* [compiler-rt] Build custom libc++abi without exceptions.Matt Morehouse2019-04-251-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Since neither compiler-rt nor the libc++ we build use exceptions, we don't need libc++abi to have them either. This resolves an issue where libFuzzer's private libc++ contains implementations for __cxa_throw and friends, causing fuzz targets built with their own C++ library to segfault during exception unwinding. See https://github.com/google/oss-fuzz/issues/2328. Reviewers: phosek, EricWF, kcc Reviewed By: phosek Subscribers: kcc, dberris, mgorny, christof, llvm-commits, metzman Tags: #llvm Differential Revision: https://reviews.llvm.org/D61053 llvm-svn: 359218
* [fuzzer] Fix reload.test on Linux/aarch64Adhemerval Zanella2019-04-241-2/+2
| | | | | | | | | | The compiler generates a 'brk' instruction for __builtin_trap on aarch64 and Linux kernel issues a SIGTRAP. It is different from x86, where compiler emits an 'ud2' and kernel issues a SIGILL. A straightforward is to use abort instead. llvm-svn: 359126
* Summary:Jonathan Metzman2019-04-183-18/+50
| | | | | | | | | | | | | | | | | | | | | | Add close_fd_mask functionality to AFL driver. Summary: Add support for env var AFL_DRIVER_CLOSE_FD_MASK which behaves the same as libFuzzer's -close_fd_mask=1. Also add tests. Reviewers: kcc, vitalybuka, morehouse Reviewed By: morehouse Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D60334 llvm-svn: 358703
* [libFuzzer] add -features_dir= flag to dump unique input features on diskKostya Serebryany2019-04-131-0/+7
| | | | llvm-svn: 358317
* [libFuzzer] Fix DataFlow.cpp logic when tracing long inputs.Max Moroz2019-04-121-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: 1. Do not create DFSan labels for the bytes which we do not trace. This is where we run out of labels at the first place. 2. When dumping the traces on the disk, make sure to offset the label identifiers by the number of the first byte in the trace range. 3. For the last label, make sure to write it at the last position of the trace bit string, as that label represents the input size, not any particular byte. Also fixed the bug with division in python which I've introduced when migrated the scripts to Python3 (`//` is required for integral division). Otherwise, the scripts are wasting too much time unsuccessfully trying to collect and process traces from the long inputs. For more context, see https://github.com/google/oss-fuzz/issues/1632#issuecomment-481761789 Reviewers: kcc Reviewed By: kcc Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60538 llvm-svn: 358311
* [libFuzzer] support -runs=N in the fork mode. Make sure we see one-line ↵Kostya Serebryany2019-04-122-0/+23
| | | | | | reports from ubsan in the fork mode. Test both llvm-svn: 358306
* Use binary write mode in WriteToFile function to avoid appended \r ↵Vitaly Buka2019-04-052-0/+37
| | | | | | | | | | | | | | | | | | | | | characters on Windows Summary: When using libfuzzer on Windows, in the contents of a crash sample, bytes that can be mistaken for a \n are replaced by a \r\n sequence. As a consequence, crashes are not reproducible. This patch will open files in binary mode to fix this issue. The patch does not affect POSIX systems. Patch by tuktuk Reviewers: kcc, vitalybuka Reviewed By: vitalybuka Subscribers: dexonsmith, jdoerfert, llvm-commits, #sanitizers Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60008 llvm-svn: 357807
* [Sanitizer] lit test config: Respect existing parallelism_groupJulian Lettner2019-02-281-1/+2
| | | | llvm-svn: 355128
* [libFuzzer][Windows] Port fork mode to WindowsJonathan Metzman2019-02-272-4/+4
| | | | | | | | | | | | | | | | | | | | | Summary: Port libFuzzer's fork mode to Windows. Implement Windows versions of MkDir, RmDir, and IterateDirRecursive to do this. Don't print error messages under new normal uses of FileSize (on a non-existent file). Implement portable way of piping output to /dev/null. Fix test for Windows and comment fork-sigusr.test on why it won't be ported to Win. Reviewers: zturner Reviewed By: zturner Subscribers: kcc, zturner, jdoerfert, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58513 llvm-svn: 355019
* [Darwin][NFC] Refactor throttling of 64bit sanitizer tests on DarwinJulian Lettner2019-02-271-3/+1
| | | | | | | | | | | | | | | | | | | Underlying condition for throttling is "has large mmap'd regions" (i.e., shadow memory) and not sanitizers in general (e.g., UBSan does not need to be throttled). Rename parallelism group `darwin-64bit-sanitizer` to `shadow-memory` and apply it unconditionally to all tests which require it. We can then have all the Darwin throttling logic in one place in the commen lit config. Throttle sanitizer_common unit tests. Configuration was previously missing from sanitizer_common/Unit/lit.site.cfg. Reviewed by: kubamracek Differential Revision: https://reviews.llvm.org/D58677 llvm-svn: 355018
* Fix license headersVitaly Buka2019-02-201-2/+3
| | | | llvm-svn: 354500
* [compiler-rt] Build custom libcxx with libcxxabiJonas Hahnfeld2019-02-171-12/+0
| | | | | | | | | | | | | | | This changes add_custom_libcxx to also build libcxxabi and merges the two into a static and hermetic library. There are multiple advantages: 1) The resulting libFuzzer doesn't expose C++ internals and looks like a plain C library. 2) We don't have to manually link in libstdc++ to provide cxxabi. 3) The sanitizer tests cannot interfere with an installed version of libc++.so in LD_LIBRARY_PATH. Differential Revision: https://reviews.llvm.org/D58013 llvm-svn: 354212
* [libFuzzer] make len_control less agressive: set the initial max len to the ↵Kostya Serebryany2019-02-161-0/+11
| | | | | | length of the largest seed. This was the original intent, but... Now, with a test, to ensure it stays this way llvm-svn: 354191
* [libFuzzer] fork mode: try harder to cleanup after itselfKostya Serebryany2019-02-161-0/+15
| | | | llvm-svn: 354186
* [Sanitizer] iOS: Pull up parallelism_group handling into common.lit.configJulian Lettner2019-02-151-2/+0
| | | | | | | | | | | | | | | | | | | Serial execution on iOS devices is not specific to sanitizers. We want to throttle all on-device tests. Pull the setting of the parallelism_group up into the common lit configuration file. Rename `darwin-ios-device-sanitizer` to `ios-device`. This group is not specific to sanitizers and (theoretically) independent from the host OS. Note that we don't support running unit tests on-device (there are no configurations generated for that). If that ever changes, we also need this configuration in `unittests/lit.common.unit.cfg`. Reviewers: delcypher Differential Revision: https://reviews.llvm.org/D58209 llvm-svn: 354179
* [libFuzzer] form mode: add -ignore_crashes flag, honor the max_total_time ↵Kostya Serebryany2019-02-151-0/+4
| | | | | | flag, print the number of ooms/timeouts/crashes, fix a typo llvm-svn: 354175
* [libFuzzer] when doing the merge, keep track of the coveraged edges, not ↵Kostya Serebryany2019-02-143-7/+8
| | | | | | just features llvm-svn: 354076
* [libFuzzer] a bit of refactoring of the fork modeKostya Serebryany2019-02-131-2/+3
| | | | llvm-svn: 353910
* [libFuzzer] teach the fork mode to ignore OOMs and timeoutsKostya Serebryany2019-02-123-5/+35
| | | | llvm-svn: 353792
* [libFuzzer] Make coverage.test work on ARM64Julian Lettner2019-02-121-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This test instruments the following code with coverage, runs the fuzzer once, and asserts that there are uncovered PCs. The ARM64 backend optimizes this code using the `csel` (Conditional select) instruction, which removes all branching from the resulting machine code. The test then fails because we do not have any uncovered PCs. The easiest solution for now is to turn off optimization for the DSOs used in this test. ``` int DSO1(int a) { if (a < 123456) return 0; return 1; } ``` rdar://47646400 Reviewers: kcc Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58087 llvm-svn: 353780
* [libFuzzer] run the -fork=1 tests only on linuxKostya Serebryany2019-02-122-1/+5
| | | | llvm-svn: 353777
* [libFuzzer] extend the -fork=1 functionality. Still not fully usable, but ↵Kostya Serebryany2019-02-121-1/+2
| | | | | | good enough for the first unit test llvm-svn: 353775
* [NFC] Re-enable XFAILed fuzzer test on iOSJulian Lettner2019-02-111-1/+0
| | | | llvm-svn: 353737
* [libFuzzer] remove two unused experimental flagsKostya Serebryany2019-02-082-27/+0
| | | | llvm-svn: 353573
* [libFuzzer] refactor the way we choose the element to cross-over with, NFC ↵Kostya Serebryany2019-02-081-0/+4
| | | | | | (expected1); add a flag -seed_inputs= to pass extra seed inputs as file paths, not dirs llvm-svn: 353494
* [libFuzzer] add a test for built-in CrossOver (there are unit tests for ↵Kostya Serebryany2019-02-082-0/+68
| | | | | | this, but it's worth having a full integration test like this) llvm-svn: 353488
* [libFuzzer][Windows] Reenable passing testsJonathan Metzman2019-02-038-11/+3
| | | | | | | | | | | | | | | | Summary: Enable tests that were previously disabled because they didn't work on Windows. Reviewers: morehouse Reviewed By: morehouse Subscribers: morehouse Differential Revision: https://reviews.llvm.org/D57563 llvm-svn: 353000
* [libFuzzer] make a test for exploding dfsan labels more agressiveKostya Serebryany2019-01-311-0/+2
| | | | llvm-svn: 352819
* [libFuzzer][Windows] Temporarily disable value-profile-cmp2.test on WinJonathan Metzman2019-01-311-0/+2
| | | | | | | | | | | | | | | | | | | | Summary: Temporarily disable value-profile-cmp2.test on Win. https://reviews.llvm.org/D57465 causes the test to fail on Win. However, it seems that the behavior of libFuzzer on Win was broken before that patch. It crashes in the exit handler when not used with ASAN. Prior to the patch, the crash handler would run, tricking the test into thinking libFuzzer on Win had exited properly. Reviewers: morehouse, vitalybuka Reviewed By: morehouse Subscribers: yln Differential Revision: https://reviews.llvm.org/D57551 llvm-svn: 352815
* [fuzzer] Use RawPrint instead of Printf for instrumentation warningJonathan Metzman2019-01-311-1/+1
| | | | | | | | | | | | | | | Summary: Use RawPrint instead of Printf for instrumentation warning because Printf doesn't work on Win when instrumentation is being initialized (since OutputFile is not yet initialized). Reviewers: kcc Reviewed By: kcc Differential Revision: https://reviews.llvm.org/D57531 llvm-svn: 352789
OpenPOWER on IntegriCloud