Skip to content

Enable fuzzing of hashes in CI#1422

Closed
tcharding wants to merge 4 commits intorust-bitcoin:masterfrom
tcharding:11-30-fuzz-hashes
Closed

Enable fuzzing of hashes in CI#1422
tcharding wants to merge 4 commits intorust-bitcoin:masterfrom
tcharding:11-30-fuzz-hashes

Conversation

@tcharding
Copy link
Copy Markdown
Member

Draft builds on #1420 and #1421 and I'm not sure if this will work.

Currently we do not run fuzzing in CI for hashes, lets enable it.

Littering the codebase with `#[cfg(not(fuzzing))]` is a bit messy just
to quieten the linter during fuzzing. Instead just globally allow.
Currently we run a bunch of unit tests that check the state of
data structures during hashing however we hobble these data structures
when fuzzing so the tests fail and are meaningless.

Exclude unit tests that test state if fuzzing.
Currently we do not run fuzzing in CI for hashes, lets enable it.
@tcharding
Copy link
Copy Markdown
Member Author

Neither of the attempts I made work (the last two patches). Will try again another time.

@apoelstra
Copy link
Copy Markdown
Member

To get hash fuzzing to work in CI you actually have to fix the hash fuzzing code. Enabling or disabling stuff isn't going to do it.

@tcharding
Copy link
Copy Markdown
Member Author

Needs more thought.

@tcharding tcharding closed this Nov 30, 2022
@tcharding tcharding deleted the 11-30-fuzz-hashes branch January 12, 2023 07:35
@apoelstra apoelstra mentioned this pull request Mar 22, 2023
apoelstra added a commit that referenced this pull request Apr 28, 2023
2860aae fuzz: don't fuzz hashes against RustCrypto (Andrew Poelstra)
6467728 fuzz: disable tests unless 'cfg(fuzzing)' is passed; update README for reproducing failures (Andrew Poelstra)
6e2ee5b fuzz: run 'cargo fmt' on all the fuzz targets (Andrew Poelstra)
9cfc0fc fuzz: add contrib/test.sh so we at least 'cargo test' it in CI (Andrew Poelstra)
933ecb1 fuzz: fix warnings, clippy lints, 1.48.0 failures (Andrew Poelstra)
fd88e48 fuzz: remove AFL support (Andrew Poelstra)
ab467cb fuzz: make hongfuzz fuzzing the default feature (Andrew Poelstra)
6f754df fuzz: add fuzzing README (Andrew Poelstra)
f093765 fix fuzz.sh and cycle.sh to use generated lists of targets (Andrew Poelstra)
6534f22 fuzz: auto-generate CI and Cargo.toml files (Andrew Poelstra)
8021034 rename travis-fuzz.sh to fuzz.sh; partially patch CI (Andrew Poelstra)
0be75f7 move hashes/fuzz into main fuzz/ directory (Andrew Poelstra)
5a891de move bitcoin fuzz targets into bitcoin/ subdirectory (Andrew Poelstra)
e3111c7 move bitcoin/fuzz into repo root; add to workspace (Andrew Poelstra)

Pull request description:

  Several big changes here:
  * Moves fuzzing to its own workspace with a `contrib/test.sh` etc so that CI will check that it compiles
  * FIx all warnings, clippy lints, MSRV problems, etc.; mostly move to Rust 2018
  * Merge `hashes/` fuzztests into workspace
  * Rewrite all scripts; add file that auto-generates CI fuzz job and Cargo.toml so we don't have to manually keep these in sync
  * Remove bitrotted and partial AFL support.

  Supercedes #1422

  I suspect the hashes fuzztests will actually fail since we haven't touched them in so long. Will address that if CI fails here.

ACKs for top commit:
  sanket1729:
    ACK 2860aae
  tcharding:
    ACK 2860aae

Tree-SHA512: b1aa3d6fac75fee51966f1d3f3245784e331bdea2a3fa7d6609bc4196c34f81acb7701faf8f269c3741568ea100438f24a2f06e75c8d01cb84c8b22d7886f1dd
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.

2 participants