rust-fuzz / libfuzzer

Rust bindings and utilities for LLVM’s libFuzzer
Apache License 2.0
206 stars 44 forks source link

Force at least one unique stack frame per fuzzer #95

Closed alexcrichton closed 1 year ago

alexcrichton commented 1 year ago

This change is an attempt to address the behavior found at google/oss-fuzz#8389 where two distinct bugs were accidentally deduplicated into the same bug report. One of the reasons for this is that the stack traces between the two bugs were almost the same with only very minor differences. My hope is that by forcing a unique stack frame per fuzzer this will be less likely since there is guaranteed to be at least one stack frame per fuzz target which is unique with this change.

While I was here I wrapped up the generated function by the fuzz_target! macro in a const _: () = { ... } to avoid adding this new run function in to the normal module's namespace and accidentally causing name collisions (e.g. if fuzz targets already have functions named run)