-
Notifications
You must be signed in to change notification settings - Fork 462
Simplify fuzzer, but also fuzz all the (non-limits) options in RegexBuilder #821
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
Conversation
@5225225 Thanks for this PR! This is a really nice simplification. One thing that this seems to make harder though is converting failing fuzz inputs into regression tests. Today, I can do something like this:
But with this simplification, it seems like it covers up the conversion of the fuzzer input of (I'm also open to solving the problem of fuzz regression tests in a different way.) |
I did something that I'm not sure is terrible or very clever. But it's definitely easy. (Below is for an artificial error, i just put in an
Basically, the debug print of whatever you're fuzzing is printed on failure, so if you just make that debug print actually just valid rust code, you can copy paste directly from the output to a This relies on debug print on |
Interesting! I think I like that. And I do really like how much simpler it is with the structured input. |
This makes a couple of the fuzzer targets a bit nicer by just asking for structured data instead of trying to manifest it ourselves out of a &[u8]. Closes #821
This makes a couple of the fuzzer targets a bit nicer by just asking for structured data instead of trying to manifest it ourselves out of a &[u8]. Closes #821
This makes a couple of the fuzzer targets a bit nicer by just asking for structured data instead of trying to manifest it ourselves out of a &[u8]. Closes #821
This makes a couple of the fuzzer targets a bit nicer by just asking for structured data instead of trying to manifest it ourselves out of a &[u8]. Closes #821
This makes a couple of the fuzzer targets a bit nicer by just asking for structured data instead of trying to manifest it ourselves out of a &[u8]. Closes #821
This makes a couple of the fuzzer targets a bit nicer by just asking for structured data instead of trying to manifest it ourselves out of a &[u8]. Closes #821
This makes a couple of the fuzzer targets a bit nicer by just asking for structured data instead of trying to manifest it ourselves out of a &[u8]. Closes #821
This makes a couple of the fuzzer targets a bit nicer by just asking for structured data instead of trying to manifest it ourselves out of a &[u8]. Closes #821
This makes a couple of the fuzzer targets a bit nicer by just asking for structured data instead of trying to manifest it ourselves out of a &[u8]. Closes #821
This makes a couple of the fuzzer targets a bit nicer by just asking for structured data instead of trying to manifest it ourselves out of a &[u8]. Closes #821
This makes a couple of the fuzzer targets a bit nicer by just asking for structured data instead of trying to manifest it ourselves out of a &[u8]. Closes #821
This makes a couple of the fuzzer targets a bit nicer by just asking for structured data instead of trying to manifest it ourselves out of a &[u8]. Closes #821
This makes a couple of the fuzzer targets a bit nicer by just asking for structured data instead of trying to manifest it ourselves out of a &[u8]. Closes #821
I'm not sure if the OSS-fuzz integration can handle
data
not being a&[u8]
, butcargo-fuzz
can. (It looks like they just usecargo fuzz
, so it should work.)This does change the input format, which might confuse the fuzzer (but I'd expect it to pretty quickly how to pass strings). I could make this as a new fuzz target if you want.
One advantage taking &str over &[u8] has is that if the end of a &str is invalid UTF-8, then it will still be used, but it (the implementation of
Arbitrary
for &str) just cuts off the invalid part, which is better than not running at all.I ran this for a bit locally and didn't find any issues. I can back out the commit to add the options and just have the one that removes the complex parsing code if you want.