oss-fuzz
oss-fuzz copied to clipboard
Non-zero return values from LLVMFuzzerTestOneInput should be discouraged
Hi, I was investigating a fuzzer target/harness that for some reason failed to create any meaningful coverage. Turns out that libFuzzer discards any inputs where the return value for LLVMFuzzerTestOneInput is non-zero and not only for -1. The documentation for libFuzzer only mentions 0 and -1, while other values are "undefined". While it seems that for Honggfuzz the return value is ignored https://github.com/google/oss-fuzz/issues/11983. This is not documented directly for OSS-Fuzz and as this seems like an easy and potentially severe mistake to make I think the documentation should be expanded.
The use of non-zero exit codes is also something that could potentially be detected and warned of automatically, is this something that you would be interested in?
I added a PR to update the docs here https://github.com/google/oss-fuzz/pull/12955
The PR is merged