Add length range to FuzzInputOptions#20914
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
|
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
|
Going to close this given that #23416 is merged. I think things have changed enough that it will need to be mostly re-implemented. |
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.