This is an archive of the discontinued LLVM Phabricator instance.

[libFuzzer] Don't complain about lack of interesting inputs when -runs=0.
ClosedPublic

Authored by Dor1s on May 23 2018, 11:08 AM.

Details

Summary

The most common usecase for -runs=0 is for generating code coverage
over some corpus. Coverage reports based on sancov are about to be deprecated,
which means some external coverage solution will be used, e.g. Clang source
based code coverage, which does not use any sancov instrumentations and thus
libFuzzer would consider any input to be not interesting in that case.

Diff Detail

Event Timeline

Dor1s created this revision.May 23 2018, 11:08 AM
Herald added subscribers: Restricted Project, delcypher. · View Herald TranscriptMay 23 2018, 11:08 AM
alex added a subscriber: alex.May 23 2018, 11:10 AM

FYI, this breaks some tests, but I can fix that if we agree that we need this change.

Dor1s updated this revision to Diff 148254.May 23 2018, 11:13 AM

Stop being stupid and write conditions right (i.e. remove "!")

Dor1s updated this revision to Diff 148255.May 23 2018, 11:14 AM

Remove unnecessary test modification, the default value works as well.

An update: no tests seem to be failing due to this, but I have some build issue with dataflow.test:

Exit Code: 1

Command Output (stderr):
--
clang-6.0: warning: -Z-reserved-lib-stdc++: 'linker' input unused [-Wunused-command-line-argument]
<...>/build/projects/compiler-rt/test/fuzzer/Output/dataflow.test.tmp-ThreeFunctionsTest.o: In function `dfs$_Z5Func2PKhm':
<...>/llvm/projects/compiler-rt/test/fuzzer/ThreeFunctionsTest.cpp:19: undefined reference to `dfs$__sanitizer_cov_trace_const_cmp8'
<...>/llvm/projects/compiler-rt/test/fuzzer/ThreeFunctionsTest.cpp:19: undefined reference to `dfs$__sanitizer_cov_trace_const_cmp1'
<...>/build/projects/compiler-rt/test/fuzzer/Output/dataflow.test.tmp-ThreeFunctionsTest.o: In function `LLVMFuzzerTestOneInput':
<...>/llvm/projects/compiler-rt/test/fuzzer/ThreeFunctionsTest.cpp:23: undefined reference to `dfs$__sanitizer_cov_trace_const_cmp8'
<...>/llvm/projects/compiler-rt/test/fuzzer/ThreeFunctionsTest.cpp:24: undefined reference to `dfs$__sanitizer_cov_trace_const_cmp1'
<...>/llvm/projects/compiler-rt/test/fuzzer/ThreeFunctionsTest.cpp:25: undefined reference to `dfs$__sanitizer_cov_trace_const_cmp1'
<...>/llvm/projects/compiler-rt/test/fuzzer/ThreeFunctionsTest.cpp:26: undefined reference to `dfs$__sanitizer_cov_trace_const_cmp1'
<...>/llvm/projects/compiler-rt/test/fuzzer/ThreeFunctionsTest.cpp:27: undefined reference to `dfs$__sanitizer_cov_trace_const_cmp1'
<...>/build/projects/compiler-rt/test/fuzzer/Output/dataflow.test.tmp-ThreeFunctionsTest.o: In function `dfs$_ZL5Func1PKhm':
<...>/llvm/projects/compiler-rt/test/fuzzer/ThreeFunctionsTest.cpp:14: undefined reference to `dfs$__sanitizer_cov_trace_const_cmp1'
clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)
kcc accepted this revision.May 23 2018, 11:18 AM

LGTM

For data flow test, make sure to rebuild dfsan (ninja check-dfsan)

This revision is now accepted and ready to land.May 23 2018, 11:18 AM

Thanks for the hint! All tests passed now, I'm committing.

This revision was automatically updated to reflect the committed changes.