rust-fuzz / honggfuzz-rs

Fuzz your Rust code with Google-developed Honggfuzz !
https://crates.io/crates/honggfuzz
Apache License 2.0
449 stars 40 forks source link

Can't use references in `fuzz!` macro due to `SafeUnwind` requirement #9

Closed mcginty closed 6 years ago

mcginty commented 6 years ago

I haven't thought through the full repercussions of a change like this, but the SafeUnwind requirement is causing some performance issues in that there's not as that can be setup outside of the main fuzzing loop, which causes a lot of avoidable initialization overhead in some fuzz tests.

I'm wondering if, in lieu of just taking this change as is, offering an alternative macro that doesn't require SafeUnwind would be something you're interested in?

Example diff: https://github.com/mcginty/honggfuzz-rs/commit/66b32e108810736d5f5573485f61a239e5dc327b

EDIT: just noticed https://github.com/rust-fuzz/honggfuzz-rs/pull/8, which is trying to fix the same problem in a different way. Leaving this open for discussion.

PaulGrandperrin commented 6 years ago

Hi @mcginty and @g2p, sorry for the very long delay, my summertime has been very busy! I cherry-picked a mix of your contributions and added mine to master to solve this problem.

Here is the full diff: https://github.com/rust-fuzz/honggfuzz-rs/compare/cafed5205fb28b50b8c475dc1f9b60992236e905...629a0d6b0569d5b74e5ed01d7d08a0c351370c20

What do you think?

PaulGrandperrin commented 6 years ago

I moved the commits to a dedicated PR #10, please feel free to comment!

PaulGrandperrin commented 6 years ago

closed by #10