-
Notifications
You must be signed in to change notification settings - Fork 76
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
Defaulting to all-zeroes is unexpected #139
Comments
This indicates we might have run into rust-fuzz/arbitrary#139
We've had empirical results that suggest that this behavior results in better fuzzing performance and exploration of the input state space, so I don't really want to revisit the decision.
Yes, you can use this method to determine when you're generators have consumed all the available entropy and will start to / have started to receive default values. |
This indicates we might have run into rust-fuzz/arbitrary#139
Instead of padding with zeros, would it make sense to cycle through already-used entropy? |
This was something that I considered in the past, but I think it makes mutation/reduction more difficult, since now mutating one byte doesn't make one change in the generated structure. For example, if you're trying to create a minimal reproducer, the one byte that causes the generator to generate the thing that triggers the bug could be tied to also generating another thing, and you'll never be able to reduce to the actual minimal reproducer.
|
I also got surprised by this. Maybe there could be something like an |
When
Unexpected
runs out of input data,int_in_range
always returnsrange.start()
(in my case, zero). This appears to be deliberate (3819274, 1d2f653) but was very unexpected to me, especially whenarbitrary::Error::NotEnoughData
exists.This turned out to be involved in an infinite loop bug: apollographql/apollo-rs#426
(FWIW I ran into this quickly because I’m using input bytes not from a fuzzer but from a fixed-seed PRNG in order to generate a deterministic benchmarking corpus. Because I don’t have a useful
size_hint
, I picked an… arbitrary… number of input bytes.)Silently devolving into pretty much
Default
seems very bad when the point of this crate is to generate varied values. Would you consider reverting the decision not to exit early?If not, is
Unstructured::is_empty
a good indicator that defaulting happened? (I could maybe try doubling the input size untilis_empty()
stays false after generating items)The text was updated successfully, but these errors were encountered: