Kostya Serebryany
44a45ec57c
[libFuzzer] simplify code, NFC
...
llvm-svn: 310326
2017-08-08 00:17:20 +00:00
Kostya Serebryany
1e78953438
[libFuzzer] remove stale code
...
llvm-svn: 310325
2017-08-08 00:14:49 +00:00
Kostya Serebryany
7c5009600e
[libFuzzer] simplify the implementation of -print_coverage=1
...
llvm-svn: 310324
2017-08-08 00:12:09 +00:00
George Karpenkov
bafcff4bfa
Do not instrument libFuzzer itself when built with -DLLVM_USE_SANITIZE_COVERAGE
...
Fixes regression from https://reviews.llvm.org/D36295
Differential Revision: https://reviews.llvm.org/D36428
llvm-svn: 310305
2017-08-07 20:56:11 +00:00
Kostya Serebryany
611872e92b
[libFuzzer] use the in-binary pc table (instead of PCs captured at run-time) to implement -exit_on_src_pos
...
llvm-svn: 310151
2017-08-04 23:49:53 +00:00
Kostya Serebryany
8a7d3f0c48
[libFuzzer] print PCs using the in-binary PC-table instead of relying on PCs captured at run-time
...
llvm-svn: 310148
2017-08-04 23:13:58 +00:00
Kostya Serebryany
8d2f9dcb82
[libFuzzer] re-enable fuzzer-printcovpcs.test
...
llvm-svn: 310126
2017-08-04 20:47:22 +00:00
Kostya Serebryany
196da07da0
[libFuzzer] make a test more robust
...
llvm-svn: 310113
2017-08-04 20:09:15 +00:00
Kostya Serebryany
2159f7f15d
[libFuzzer] remove the now redundant 'LLVMFuzzer-' prefix from libFuzzer tests
...
llvm-svn: 310110
2017-08-04 20:05:25 +00:00
Kostya Serebryany
9cb37f0db2
[libFuzzer] split one test into several
...
llvm-svn: 310106
2017-08-04 20:01:04 +00:00
George Karpenkov
fc2861a8a6
[libFuzzer tests] Only enable libFuzzer tests if
...
-DLIBFUZZER_ENABLE_TESTS=ON is set.
llvm-svn: 310100
2017-08-04 19:29:16 +00:00
Kostya Serebryany
6e37795482
[libFuzzer] make trace-pc.test more reliable
...
llvm-svn: 310091
2017-08-04 18:43:39 +00:00
George Karpenkov
3c817816f0
Fixing buildbots: do not register check-fuzzer if clang or asan are not
...
present.
llvm-svn: 310077
2017-08-04 17:43:29 +00:00
George Karpenkov
9f35a83dd0
Drop Windows support from libFuzzer tests.
...
Differential Revision: https://reviews.llvm.org/D36205
llvm-svn: 310076
2017-08-04 17:43:28 +00:00
George Karpenkov
3dd8ddb890
Port libFuzzer tests to LIT. Do not require two-stage build for check-fuzzer.
...
This revision ports all libFuzzer tests apart from the unittest to LIT.
The advantages of doing so include:
- Tests being self-contained
- Much easier debugging of a single test
- No need for using a two-stage compilation
The unit-test is still compiled using CMake, but it does not need a
freshly built compiler.
NOTE: The previous two-stage bot configuration will NOT work, as in the
second stage build LLVM_USE_SANITIZER is set, which disables ASAN from
being built.
Thus bots will be reconfigured in the next few commits.
Differential Revision: https://reviews.llvm.org/D36295
llvm-svn: 310075
2017-08-04 17:19:45 +00:00
George Karpenkov
456e82a17f
Disable libFuzzer tests on Windows
...
Differential Revision: https://reviews.llvm.org/D36297
llvm-svn: 310009
2017-08-04 00:26:12 +00:00
George Karpenkov
1070fdcf79
[libFuzzer] Un-reverting change in tests after fixing the failure on Linux.
...
Differential Revision: https://reviews.llvm.org/D36242
llvm-svn: 309982
2017-08-03 20:28:16 +00:00
George Karpenkov
b4b6297ed7
Revert "[libFuzzer tests] Use substring comparison in libFuzzer tests"
...
This reverts commit 3592d8049660dcdd07f7c2e797f2de9790f93111.
Breaks the bots, reverting for now.
llvm-svn: 309899
2017-08-02 23:09:57 +00:00
George Karpenkov
af8c691e9b
[libFuzzer tests] Use substring comparison in libFuzzer tests
...
LIT launches executables with absolute, and not relative, path.
strncmp would try to do exact comparison and fail.
Differential Revision: https://reviews.llvm.org/D36242
llvm-svn: 309889
2017-08-02 21:38:50 +00:00
Kostya Serebryany
d056e401d1
[libFuzzer] temporarty remove pc-tables and disable test/fuzzer-printcovpcs.test until this can be fixed on Windows
...
llvm-svn: 309716
2017-08-01 18:02:19 +00:00
Kostya Serebryany
66066b6fb8
[libFuzzer] implement more correct way of computing feature index for Inline8bitCounters
...
llvm-svn: 309647
2017-08-01 01:16:26 +00:00
Kostya Serebryany
cdca55c896
[libFuzzer] enable -fsanitize-coverage=pc-table for all tests
...
llvm-svn: 309646
2017-08-01 00:48:44 +00:00
Kostya Serebryany
56717948c7
[libFuzzer] implement __sanitizer_cov_pcs_init and add pc-table to build flags for one test (for now)
...
llvm-svn: 309615
2017-07-31 20:20:59 +00:00
Kostya Serebryany
0b6cd623bd
[libFuzzer] improve support for inline-8bit-counters (make it more correct and faster)
...
llvm-svn: 309443
2017-07-28 22:00:56 +00:00
Kostya Serebryany
68381b63b8
[libFuzzer] don't disable msan for TracePC::CollectFeatures: this started to cause false positives in msan. No tests for libFuzzer+msan yet -- tests will need to wait until we move libFuzzer to compiler-rt
...
llvm-svn: 309038
2017-07-25 22:05:31 +00:00
Kostya Serebryany
b2de8fb7b9
[libFuzzer] make one test faster, fix compiler warnings in tests
...
llvm-svn: 308945
2017-07-25 02:09:46 +00:00
George Karpenkov
f437c5c0ea
Revert "Revert "[libFuzzer] Add a dependency on symbolizer from libFuzzer tests""
...
This reverts commit 15425f2bc6eac6249ee957a2a280511306c07547.
Should work now that atos is a default symbolizer on Darwin.
llvm-svn: 308910
2017-07-24 18:38:14 +00:00
Kostya Serebryany
2634a37d75
[libFuzzer] reimplement experimental_len_control=1: bump the temporary max_len every time we failed to find new coverage during the last 1000 runs and 1 second. Also fix FileToVector to not load unfinished files
...
llvm-svn: 308811
2017-07-22 00:10:29 +00:00
Matt Morehouse
8883497952
Generate error reports when a fuzz target exits.
...
Summary:
Implements https://github.com/google/sanitizers/issues/835 .
Flush stdout before exiting in test cases.
Since the atexit hook is used for exit reports, pending prints to
stdout can be lost if they aren't flushed before calling exit().
Expect tests to have non-zero exit code if exit() is called.
Reviewers: vitalybuka, kcc
Reviewed By: kcc
Subscribers: eraman, llvm-commits, hiraditya
Differential Revision: https://reviews.llvm.org/D35602
llvm-svn: 308669
2017-07-20 20:43:39 +00:00
Kostya Serebryany
cc67440948
[libFuzzer] delete stale code
...
llvm-svn: 308663
2017-07-20 20:15:13 +00:00
Kostya Serebryany
bbaa26af71
[libFuzzer] make sure CheckExitOnSrcPosOrItem is called after the new input is saved to the corpus
...
llvm-svn: 308653
2017-07-20 18:53:25 +00:00
Kostya Serebryany
de5f18254f
[libFuzzer] prototype implementation of recursion-depth coverage features (commented out; real implementation needs to use inlined instrumentation)
...
llvm-svn: 308577
2017-07-20 01:35:17 +00:00
Kostya Serebryany
ba325f3855
[libFuzzer] add DeepRecursionTest, inspired by https://guidovranken.wordpress.com/2017/07/08/libfuzzer-gv-new-techniques-for-dramatically-faster-fuzzing/ (Stack-depth-guided fuzzing). libFuzzer does not solve it yet.
...
llvm-svn: 308571
2017-07-20 00:37:08 +00:00
Reid Kleckner
a40b249e42
Try to deflake fuzzer-oom.test on Windows
...
llvm-svn: 308568
2017-07-20 00:11:39 +00:00
Kostya Serebryany
d82115a678
[libFuzzer] simplify two more tests
...
llvm-svn: 308560
2017-07-19 23:52:54 +00:00
Kostya Serebryany
0c59ac7af0
[libFuzzer] change several tests to not limit the max len: with reduce_inputs=1 they are now fast enough even w/o this
...
llvm-svn: 308553
2017-07-19 23:45:46 +00:00
Reid Kleckner
e52092d1ed
Fix fuzzer-flags.test on Windows
...
The optional external function callbacks have to be exported in order
for them to be called. The test was failing because libFuzzer wasn't
calling LLVMFuzzerInitialize.
We can reconsider if this is the best way to mark these optional
callbacks exported later.
llvm-svn: 308548
2017-07-19 23:22:06 +00:00
Kostya Serebryany
a1f64823bf
[libFuzzer] enable reduce_inputs=1 by default (seems to be a big win usually)
...
llvm-svn: 308541
2017-07-19 22:10:30 +00:00
Kostya Serebryany
942eea9a0e
[libFuzzer] when adding a reduced input print REDUCED instead of NEW
...
llvm-svn: 308336
2017-07-18 18:47:36 +00:00
Kostya Serebryany
1dbfa6accb
[libFuzzer] improve -reduce_inputs=1: now only consider the unique features of very input (seems to work much better)
...
llvm-svn: 308253
2017-07-18 01:36:50 +00:00
Kostya Serebryany
c77feb3db6
[libFuzzer] disable fuzzer-flags.test on windows to fix the bots
...
llvm-svn: 308246
2017-07-18 01:00:28 +00:00
George Karpenkov
fb221ed39c
Revert "[libFuzzer] Add a dependency on symbolizer from libFuzzer tests"
...
This reverts commit 546e006a023cccd0fd32afd442ab992d3515d4b8.
Reverting until I can figure out llvm-symbolizer breakages on mac os.
llvm-svn: 308202
2017-07-17 18:18:03 +00:00
Kostya Serebryany
1641f063c8
[libFuzzer] remove stale code
...
llvm-svn: 308075
2017-07-15 01:31:40 +00:00
Justin Bogner
2072bca540
[libFuzzer] Allow non-fuzzer args after -ignore_remaining_args=1
...
With this change, libFuzzer will ignore any arguments after a sigil
argument, but it will preserve these arguments at the end of the
command line when launching subprocesses. Using this, its possible to
handle positional and single-dash arguments to the program under test
by discarding everything up to -ignore_remaining_args=1 in
LLVMFuzzerInitialize.
llvm-svn: 308069
2017-07-14 23:33:04 +00:00
Kostya Serebryany
69e146646b
[libFuzzer] fix stats during merge
...
llvm-svn: 308061
2017-07-14 21:48:19 +00:00
Kostya Serebryany
c9aae5bce8
[libFuzzer] update the comments in afl/afl_driver.cpp
...
llvm-svn: 307981
2017-07-14 00:18:37 +00:00
Kostya Serebryany
05deb6f798
[libFuzzer] remove stale code; NFC
...
llvm-svn: 307980
2017-07-14 00:16:23 +00:00
Kostya Serebryany
feac4ad640
[libFuzzer] simplify the handling of memmem/strstr
...
llvm-svn: 307977
2017-07-14 00:06:27 +00:00
Kostya Serebryany
746998096d
[libFuzzer] move code around; NFC
...
llvm-svn: 307973
2017-07-13 22:30:23 +00:00
Kostya Serebryany
7653d30e45
[libFuzzer] make sure that -reduce_inputs=1 deletes redundant files in the corpus
...
llvm-svn: 307875
2017-07-13 01:56:37 +00:00