Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fuzz: include seed corpora in tree as regression tests #6106

Merged
merged 6 commits into from
Apr 9, 2023

Conversation

morehouse
Copy link
Contributor

@morehouse morehouse commented Mar 20, 2023

This PR:

  • adds an initial seed corpus for each fuzz target under /tests/fuzz/corpora
  • adds a make check-fuzz target to do a regression test of each fuzz target on its seed corpus
  • updates documentation to encourage contributions to the seed corpora

This is a first step towards improving our fuzzing practices. See #6083.

Tested:

$ DEVELOPER=1 EXPERIMENTAL_FEATURES=1 ASAN=1 UBSAN=1 VALGRIND=0 CC=clang ./configure --disable-rust --enable-fuzzing
$ make check-fuzz

Note that some of the seeds currently cause failures. I've created #6096 and #6099 to fix those.

Changelog-None

These corpora were generated with default libFuzzer flags with 30+ hours
of CPU time, and then minimized with:
  ./fuzz-TARGET -merge=1 -shuffle=0 -prefer_small=1 -use_value_profile=1 corpora/fuzz-TARGET UNMINIMIZED_CORPUS
The following arguments were copied from Bitcoin Core's corpus merging
script https://github.com/bitcoin/bitcoin/blob/master/test/fuzz/test_runner.py:

-shuffle=0
-prefer_small=1
-use_value_profile=1
The script runs each fuzz target on its seed corpus and prints any
failures.
The target builds and runs each fuzz target on its seed corpus.
We want to encourage contributions to the seed corpora that improve
coverage.
@morehouse
Copy link
Contributor Author

Updated with 30+ CPU-hours of fuzzing for each seed corpus, and improved corpus merging parameters copied from Bitcoin Core.

Copy link
Contributor

@rustyrussell rustyrussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack ed20f87

@rustyrussell rustyrussell merged commit ca80dee into ElementsProject:master Apr 9, 2023
27 checks passed
@morehouse morehouse deleted the check_fuzz branch April 10, 2023 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants