Make Yul proto mutator mutations deterministic. #14605
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Yul proto mutator is a set of libprotobuf-mutator callbacks that mutates Yul protobuf inputs using custom mutations e.g., add a store here, flip a bool there etc.
The mutator itself would statically initialize a random number generator to eventually produce mutations. However, this would mean that depending on how many times the mutator has been called, the mutation would differ. Meaning that when debugging a crash, it may no longer reproduce because the statically initialized RNG would not cause a mutation or cause a different one.
This PR fixes this non-determinism by making use of (deterministic) seeds provided by the libprotobuf mutator library. Now, crashes should be reproducible outside fuzzing runs.