This is an archive of the discontinued LLVM Phabricator instance.

[libFuzzer] Add dummy call of LLVMFuzzerTestOneInput to afl_driver.
ClosedPublic

Authored by metzman on Dec 13 2017, 12:19 PM.

Details

Summary

Add dummy call of LLVMFuzzerTestOneInput to afl_driver before it starts
executing on actual inputs. Do this so that first time initialization
performed by LLVMFuzzerTestOneInput is not considered code covered by
a particular input.

Diff Detail

Event Timeline

metzman created this revision.Dec 13 2017, 12:19 PM
Herald added subscribers: Restricted Project, llvm-commits. · View Herald TranscriptDec 13 2017, 12:19 PM
metzman updated this revision to Diff 126812.Dec 13 2017, 12:46 PM
  • Don't do dummy execution when executing files one-by-one.
kcc accepted this revision.Dec 13 2017, 1:44 PM
kcc added a reviewer: morehouse.

LGTM
Matt, please land

This revision is now accepted and ready to land.Dec 13 2017, 1:44 PM
This revision was automatically updated to reflect the committed changes.
Dor1s added a subscriber: Dor1s.Dec 14 2017, 12:28 PM
Dor1s added inline comments.
lib/fuzzer/afl/afl_driver.cpp
314

nit: I'd rather do:

uint8_t dummy_input[] = {0};
LLVMFuzzerTestOneInput(dummy_input, sizeof(dummy_input));

to avoid using "magic" numbers