This is an archive of the discontinued LLVM Phabricator instance.

[libFuzzer] Enable entropic by default.
ClosedPublic

Authored by morehouse on Sep 10 2020, 11:44 AM.

Details

Summary

Entropic has performed at least on par with vanilla scheduling on
Clusterfuzz, and has shown a slight coverage improvement on FuzzBench:
https://www.fuzzbench.com/reports/2020-08-31/index.html

Diff Detail

Event Timeline

morehouse created this revision.Sep 10 2020, 11:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 10 2020, 11:44 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
morehouse requested review of this revision.Sep 10 2020, 11:44 AM
Dor1s added inline comments.Sep 10 2020, 11:57 AM
compiler-rt/lib/fuzzer/FuzzerDriver.cpp
771

maybe we should preserve an explicit error in case both focus function and entropic are used? Otherwise it's not obvious and might be even tricky to realize without checking libFuzzer's source code.

morehouse added inline comments.Sep 10 2020, 12:02 PM
compiler-rt/lib/fuzzer/FuzzerDriver.cpp
771

The reason I took the error out is to avoid -focus-function requiring two flags to use now (i.e. -entropic=0 -focus_function=auto).

I figured it doesn't make much sense to use focus_function with entropic anyway, since -focus_function is essentially its own scheduling algorithm.

Dor1s added inline comments.Sep 10 2020, 12:12 PM
compiler-rt/lib/fuzzer/FuzzerDriver.cpp
771

Ah, that's right, as now we'd need to disable it explicitly. Let's update the focus_function doc string in such case, pointing out that it disables entropic?

@dokyungs Any idea why enabling entropic causes the KeepSeed tests to fail?

@dokyungs Any idea why enabling entropic causes the KeepSeed tests to fail?

With -entropic=1, the two tests apparently require more runs.

For cross_over_uniform_dist.test, it requires 3,782,970 runs, so increasing runs to 4,000,000 should solve the issue. Note that without cross_over_uniform_dist=1, it requires 9,278,291 runs.

For keep-seed.test, it requires 2,038,980 runs, so increasing runs to 3,000,000 should solve the issue. Note that without keep_seed=1, it requires even more runs as expected: 9,621,535 runs.

Let me know how this sounds, and also if you want this change to be a separate patch.

morehouse updated this revision to Diff 291233.Sep 11 2020, 8:40 AM
morehouse marked 2 inline comments as done.
  • Update focus_function doc string.
  • Increase runs for keep-seed and uniform crossover tests.
Dor1s accepted this revision.Sep 11 2020, 9:59 AM

LGTM

This revision is now accepted and ready to land.Sep 11 2020, 9:59 AM
This revision was automatically updated to reflect the committed changes.