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

Feature request: Setup and teardown functions #101

Closed
hmvp opened this issue Apr 4, 2017 · 1 comment · May be fixed by rust-fuzz/libfuzzer#33
Closed

Feature request: Setup and teardown functions #101

hmvp opened this issue Apr 4, 2017 · 1 comment · May be fixed by rust-fuzz/libfuzzer#33

Comments

@hmvp
Copy link

hmvp commented Apr 4, 2017

Maybe I missed something in the docs But I'd like to request the following feature:

Add a function that will be called once before the fuzzing starts to set up stuff needed for fuzzing. Maybe with a method to pass that data as an argument to the fuzz function.

Two reasons:

  • Expensive setup means the fuzzer runs slower. I would have used lazy_static but it does not play nice with the sanitizer
  • Some setup is to cumbersome to do every test. I am currently fuzzing a program that accepts CAN packets and I need to setup a virtual can network beforehand. This would also need a teardown function.
@Manishearth
Copy link
Member

There's not much we can do aside from using lazy_static here. Turn off the sanitizer option that errors on that, I guess?

PaulGrandperrin added a commit to rust-fuzz/honggfuzz-rs that referenced this issue Feb 9, 2018
The library code is now a lot simpler, does not use macros
and gives users a lot more control.

This solves cargo-fuzz's issue rust-fuzz/cargo-fuzz#101

This syntax is also very similar to the one in AFL.rs.
Maybe we should converge to a compatible API? rust-fuzz/afl.rs#31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants