-
Notifications
You must be signed in to change notification settings - Fork 110
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 option to ignore panics #173
Comments
In an ideal world I'd like to toggle this behavior persistently for each fuzzing target, but unconditional |
I think the panic infrastructure messes with fuzzing somehow so it's disabled for that reason too. You're free to try it and if it works, make a PR with the flag. The expected thing to do with such cases is to filter the input beforehand |
For future reference, I currently have no plans to implement this feature by myself because use of libfuzzer in my project is blocked by #174 anyway. |
I was also looking into fuzzing but my only goal is to find hard crashes (segfaults). I know my API can panic in some circumstances, so cargo fuzz stopping on them is not very useful to me. EDIT: for reference, I'm trying to fuzz a file format parser, so filtering the input is basically impossible |
I was wondering if maybe #![no_main]
use libfuzzer_sys::fuzz_target;
fn this_panics(buf: &[u8]) {
if buf.len() > 5 {
panic!("oh no");
}
}
fuzz_target!(|data: &[u8]| {
std::panic::catch_unwind(|| {
this_panics(data);
}).ok();
});
|
I'm looking into fuzzing parts of Rust standard library to detect bugs such as CVE-2018-1000810. See also: the fix.
However, this is currently impossible with cargo-fuzz because it passes
-Cpanic=abort
during compilation, while for this function panic on overflow is the expected behavior. I need a way to disable that.The text was updated successfully, but these errors were encountered: