-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add length range to FuzzInputOptions #20914
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
base: master
Are you sure you want to change the base?
Conversation
I'll look at this in a couple days - I have a rather large body of work sitting in the |
No problem, I figured. As of yesterday looks like the conflicts would be pretty minimal, so hopefully it'll stay easy. |
Looks like there were indeed a couple of conflicts. |
b38cb3a
to
2885f0b
Compare
Conflicts resolved 👍 |
No need, it can generate random bytes in this case. |
I considered this. The concern I had was with ownership of the memory for holding the input. Since the length range is runtime known we need to allocate it dynamically. Under normal circumstances the fuzzer owns all of the returned memory, but on the initial run it's not clear how to de-allocate the slice returned from fuzzInput. A few options I considered:
Does one of these (or something else I haven't considered) seem like a better approach? |
Ok, a pretty easy solution by adding another global variable to track the bytes allocated for the smoke test. I think that should work. |
ffd8325
to
a719e0a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I've addressed your objection in #21370. After those changes, you can use std.testing.allocator
to allocate the input buffer, and free it after the call to testOne
.
Sounds good! Once that lands I'll take another look 👍 |
845c71f
to
7ade963
Compare
Looks like the updated version is now green 👍🏻 |
7ade963
to
42f9f4c
Compare
Closes #20816
Example test case, fuzzing f64 printing.
The first run of the fuzzer is seeded with random bytes, with length equal to the minimum allowed length.