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

Add --cfg fuzzing_repro when reproducing a crash #344

Merged
merged 1 commit into from
Jun 16, 2023

Conversation

mgeisler
Copy link
Contributor

This makes it possible to leave large or expensive debug output in your fuzzers since it will only be active when you reproduce a crash:

#[cfg(fuzzing_repro)]
eprintln!("Expensive debug output: {}", do_something_expensive());

Fixes #343.

This makes it possible to leave large or expensive debug output in
your fuzzers since it will only be active when you reproduce a crash:

    #[cfg(fuzzing_repro)]
    eprintln!("Expensive debug output: {}", do_something_expensive());

Fixes rust-fuzz#343.
mgeisler added a commit to mgeisler/rust-fuzz-book that referenced this pull request Jun 16, 2023
This is for rust-fuzz/cargo-fuzz#344, assuming it gets merged.
Copy link
Member

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

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

code looks good, would like to have someone pick a good name for the cfg (the name i chose was a very throwaway idea, i don't hate it, but we can probably do better)

Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

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

LGTM. I don't have a better naming suggestion than fuzzing_repro.

@Manishearth Manishearth merged commit a860fd9 into rust-fuzz:main Jun 16, 2023
1 check passed
@mgeisler
Copy link
Contributor Author

LGTM. I don't have a better naming suggestion than fuzzing_repro.

Thanks for merging the PR, I hope it'll be useful to people. I was also not sure what to name this, but I think @Manishearth's suggestion should work okay.

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.

Detect when code is reproducing a crash vs when it is fuzzing
3 participants