summaryrefslogtreecommitdiff
path: root/test/fuzzer
AgeCommit message (Collapse)Author
2018-07-20[libFuzzer] Use separate test directory for each configJoel E. Denny
Previously, check-all failed many tests for me. It was running the X86_64DefaultLinuxConfig, X86_64LibcxxLinuxConfig, and X86_64StaticLibcxxLinuxConfig configs out of llvm-build/projects/compiler-rt/test/fuzzer. Now, it runs them out of separate subdirectories there, and most tests pass. Reviewed By: morehouse, george.karpenkov Differential Revision: https://reviews.llvm.org/D49249 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337521 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-19[libFuzzer] when -print_coverage=1 is given, print more stats (the number of ↵Kostya Serebryany
seeds that hit every given function) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337501 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-19[libFuzzer] quick hack to fix the botKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337436 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-19[libFuzzer] first experimental attempt at DFT-based mutations ↵Kostya Serebryany
(DFT=data-flow-trace) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337434 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-17[libFuzzer] Mutation tracking and logging implemented.Max Moroz
Summary: Code now exists to track number of mutations that are used in fuzzing in total and ones that produce new coverage. The stats are currently being dumped to the command line. Patch by Kodé Williams (@kodewilliams). Reviewers: metzman, Dor1s, morehouse, kcc Reviewed By: Dor1s, morehouse, kcc Subscribers: delcypher, kubamracek, kcc, morehouse, llvm-commits, #sanitizers, mgorny Differential Revision: https://reviews.llvm.org/D48054 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337324 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-17libFuzzer: prevent irrelevant strings from leaking into auto-dictionaryMatt Morehouse
This is a fix for bug 37047. https://bugs.llvm.org/show_bug.cgi?id=37047 Implemented by basically reversing the logic. Previously all strings were considered, with some operations excluded. Now strings are excluded by default, and only strings during the CB considered. Patch By: pdknsk Differential Revision: https://reviews.llvm.org/D48800 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337296 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-16[libFuzzer] Avoid STL in MSan test.Matt Morehouse
Summary: STL can cause MSan false positives if lib[std]c++ isn't instrumented with MSan. Reviewers: kcc Reviewed By: kcc Subscribers: Dor1s, llvm-commits Differential Revision: https://reviews.llvm.org/D49404 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337224 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-16Revert r337194 (https://reviews.llvm.org/D48891) due to compilation errors.Max Moroz
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337206 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-16[cmake][libFuzzer] fixup r337193 to ensure msan/dfsan are not addedAlex Lorenz
to test deps for libfuzzer when they're not supported by the platform git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337203 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-16[libFuzzer] Mutation tracking and logging implemented.Max Moroz
Summary: Code now exists to track number of mutations that are used in fuzzing in total and ones that produce new coverage. The stats are currently being dumped to the command line. Patch by Kodé Williams (@kodewilliams). Reviewers: metzman, Dor1s, morehouse, kcc Reviewed By: Dor1s, morehouse, kcc Subscribers: delcypher, kubamracek, kcc, morehouse, llvm-commits, #sanitizers, mgorny Differential Revision: https://reviews.llvm.org/D48054 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337194 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-16[libFuzzer] Add msan and dfsan to test deps.Matt Morehouse
Required now that we have tests using MSan and DFSan. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337193 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-16[libFuzzer] Implement stat::stability_rate based on the percentage of ↵Max Moroz
unstable edges. Summary: Created a -print_unstable_stats flag. When -print_unstable_stats=1, we run it 2 more times on interesting inputs poisoning unstable edges in an array. On program termination, we run PrintUnstableStats() which will print a line with a stability percentage like AFL does. Patch by Kyungtak Woo (@kevinwkt). Reviewers: metzman, Dor1s, kcc, morehouse Reviewed By: metzman, Dor1s, morehouse Subscribers: delcypher, llvm-commits, #sanitizers, kcc, morehouse, Dor1s Differential Revision: https://reviews.llvm.org/D49212 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337187 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-16Revert r337175 (https://reviews.llvm.org/D49212) due to unintentional format ↵Max Moroz
changes. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337180 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-16[libFuzzer] Implement stat::stability_rate based on the percentage of ↵Max Moroz
unstable edges. Summary: Created a -print_unstable_stats flag. When -print_unstable_stats=1, we run it 2 more times on interesting inputs poisoning unstable edges in an array. On program termination, we run PrintUnstableStats() which will print a line with a stability percentage like AFL does. Patch by Kyungtak Woo (@kevinwkt). Reviewers: metzman, Dor1s, kcc, morehouse Reviewed By: metzman, Dor1s, morehouse Subscribers: delcypher, llvm-commits, #sanitizers, kcc, morehouse, Dor1s Differential Revision: https://reviews.llvm.org/D49212 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337175 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-13[fuzzer] [tests] Increase the number of iterations for three-bytes.testGeorge Karpenkov
The test is flaky otherwise on some of our macOS machines in the test fleet. Differential Revision: https://reviews.llvm.org/D49277 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336966 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-12[SanitizerCoverage] Add associated metadata to 8-bit counters.Matt Morehouse
Summary: This allows counters associated with unused functions to be dead-stripped along with their functions. This approach is the same one we used for PC tables. Fixes an issue where LLD removes an unused PC table but leaves the 8-bit counter. Reviewers: eugenis Reviewed By: eugenis Subscribers: llvm-commits, hiraditya, kcc Differential Revision: https://reviews.llvm.org/D49264 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336941 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-12[libFuzzer] If LLD available, require it to build first.Matt Morehouse
Since we now have a test that requires LLD, make sure it is built before that test runs. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336932 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-12[libFuzzer] Use lld-available for gc-sections.test.Matt Morehouse
The lld feature is never available for libFuzzer tests, so gc-sections.test never actually runs. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336926 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-11[FileCheck] Add -allow-deprecated-dag-overlap to another compiler-rt testJoel E. Denny
See https://reviews.llvm.org/D47106 for details. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336859 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-10[libFuzzer] Disable dataflow.test on AArch64.Matt Morehouse
Summary: After my recent change to allow MSan + libFuzzer, the ExplodeDFSanLabelsTest.cpp test started to overflow the stack with recursive function SetBytesForLabel() on an AArch64 bot. Perhaps that bot has a smaller stack size, or maybe AArch64 has larger stack frames for this particular function. Reviewers: kcc, javed.absar Reviewed By: kcc Subscribers: kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D49150 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336725 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-10Revert "[Fuzzer] Afl driver changing iterations handling"Matt Morehouse
This reverts rL334510 due to breakage of afl_driver's command line interface. Patch By: Jonathan Metzman Differential Revision: https://reviews.llvm.org/D49141 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336719 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-10[LibFuzzer] Disable MSan test on Darwin which was added by r336619. The ↵Dan Liew
MemorySanitizer is not supported on Darwin currently and so Clang refuses to compile with `-fsanitize=memory`. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336669 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-09[libFuzzer] Make -fsanitize=memory,fuzzer work.Matt Morehouse
This patch allows libFuzzer to fuzz applications instrumented with MSan without recompiling libFuzzer with MSan instrumentation. Fixes https://github.com/google/sanitizers/issues/958. Differential Revision: https://reviews.llvm.org/D48891 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336619 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-09Revert "[libFuzzer] Mutation tracking and logging implemented"Matt Morehouse
This reverts r336597 due to bot breakage. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336616 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-09[libFuzzer] Mutation tracking and logging implementedMatt Morehouse
Code now exists to track number of mutations that are used in fuzzing in total and ones that produce new coverage. The stats are currently being dumped to the command line. Patch By: Kode Williams Differntial Revision: https://reviews.llvm.org/D48054 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336597 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-06Recommit "[CMake] Run libFuzzer tests with check-all."Yvan Roux
Since problematic tests on AArch64 were disabled at r336446. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336449 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-06[libFuzzer] Disable hanging tests on AArch64Yvan Roux
Disable problematic tests which broke AArch64 bots. Details available in Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=38034 Differential Revision: https://reviews.llvm.org/D49011 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336446 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05Revert "[CMake] Run libFuzzer tests with check-all."Yvan Roux
Revert due to AArch64 bots breakage, upstream PR raised to track the issue: https://bugs.llvm.org/show_bug.cgi?id=38034 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336341 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-03[libFuzzer] add one more value profile metric, under a flag (experimental)Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336234 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-03[libFuzzer] add a tiny and surprisingly hard puzzleKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336229 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-28Support for multiarch runtimes layoutPetr Hosek
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335809 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-28[libFuzzer] [Tests] [NFC] Change seed for reduce_inputs.testGeorge Karpenkov
Differential Revision: https://reviews.llvm.org/D48686 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335802 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-27[libFuzzer] [NFC] [Tests] Mark signal handling tests as UNSUPPORTED on DarwinGeorge Karpenkov
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335792 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-26[libFuzzer] Mark several tests UNSUPPORTED for aarch64.Matt Morehouse
Now that check-fuzzer runs as part of check-all, some aarch64 bots had tests failing. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335639 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-25[CMake] Run libFuzzer tests with check-all.Matt Morehouse
Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D48200 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335519 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-21[libFuzzer] Filter architectures for testing on Apple platforms.George Karpenkov
This is done in all other sanitizers, and was missing on libFuzzer. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335290 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-21[libFuzzer] Provide more descriptive names for testing targets.George Karpenkov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335289 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-20[sanitizer] Unify and generalize Apple platforms in CMake and lit test configsKuba Mracek
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335123 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-15[libFuzzer] Avoid -fuse-ld=lld on gc-sections.Matt Morehouse
The bot doesn't recognize lld as a linker even though it has the property lld-available. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334864 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-15[SanitizerCoverage] Add associated metadata to pc-tables.Matt Morehouse
Summary: Using associated metadata rather than llvm.used allows linkers to perform dead stripping with -fsanitize-coverage=pc-table. Unfortunately in my local tests, LLD was the only linker that made use of this metadata. Partially addresses https://bugs.llvm.org/show_bug.cgi?id=34636 and fixes https://github.com/google/sanitizers/issues/971. Reviewers: eugenis Reviewed By: eugenis Subscribers: Dor1s, hiraditya, llvm-commits, kcc Differential Revision: https://reviews.llvm.org/D48203 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334858 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-14[libFuzzer] [NFC] XFAIL one of the tests on iOS.George Karpenkov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334775 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-14[libFuzzer] [NFC] Remaining minor fixes to support testing on devices.George Karpenkov
XFAIL's and adding %run commands. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334774 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-14[libFuzzer] [NFC] Support multi-arch and multi-OS building and testingGeorge Karpenkov
Differential Revision: https://reviews.llvm.org/D47296 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334768 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-14[libFuzzer] [NFC] Generalize DSO tests to work even when files are moved.George Karpenkov
Differential Revision: https://reviews.llvm.org/D47292 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334766 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-12[libFuzzer] [NFC] Do not use hardcoded relative paths in tests.George Karpenkov
For paths without "%t" inside uniqueness is not guaranteed, and potential collisions might be present. Differential Revision: https://reviews.llvm.org/D47288 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334546 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-12[libFuzzer] [NFC] Make compiler command generation more readable.George Karpenkov
Use config.clang as a more general option than config.c_compiler. Differential Revision: https://reviews.llvm.org/D47295 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334545 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-12[Fuzzer] Afl driver changing iterations handlingDavid Carlier
Handling differently the iterations with the type limit and eventually an error message. Reviewers: morehouse, kcc Reviewed By: morehouse Differential Revision: https://reviews.llvm.org/D47880 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334510 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-07[libFuzzer] make the corpus elements aware of their data flow tracesKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334158 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-07[libFuzzer] simplify a test, hopefully to fix the botKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334156 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-06[libFuzzer] initial implementation of -data_flow_trace. It parses the data ↵Kostya Serebryany
flow trace and prints the summary, but doesn't use the information in any other way yet git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334058 91177308-0d34-0410-b5e6-96231b3b80d8