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

Introduce LLVMFuzzerInitialize support #128

Merged
merged 12 commits into from
Jan 24, 2025

Conversation

zi0Black
Copy link
Contributor

@zi0Black zi0Black commented Dec 21, 2024

  • Added example_init to demonstrate the use of initialization code with the fuzz_target! macro.
  • Updated fuzz_target! macro to support an init parameter for executing initialization code before fuzzing.
  • Updated CI script to build and run the new example.

Should I update any doc with init usage example?

Is the example good enough? Maybe an example using static would be more meaningful.

Close after merge:

- Added `example_init` to demonstrate the use of initialization code with the `fuzz_target!` macro.
- Updated `fuzz_target!` macro to support an `init` parameter for executing initialization code before fuzzing.
- Updated CI script to build and run the new example.
Copy link

@hanna-kruppe hanna-kruppe left a comment

Choose a reason for hiding this comment

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

Thanks for doing this before I got around to it! Some questions/suggestions I had while skimming the diff. I'm not a maintainer, so this doesn't carry any weight one way or another, but I hope they're still useful.

example_init/fuzz/fuzz_targets/bigbang.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved
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.

Nice! Looks good to me with nitpick below addressed.

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
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.

Thanks! Looks good modulo one final suggestion for the doc comment example

src/lib.rs Outdated Show resolved Hide resolved
Co-authored-by: Nick Fitzgerald <[email protected]>
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.

Thanks!

@zi0Black
Copy link
Contributor Author

Rust fmt is my nemesis :(

@fitzgen fitzgen merged commit bc6ea8b into rust-fuzz:main Jan 24, 2025
2 checks passed
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.

3 participants