-
Notifications
You must be signed in to change notification settings - Fork 18k
internal/fuzz: fuzzer appears to mutate "immutable" string inputs #48308
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
Comments
Or, a simpler reproducer (but one that isn't quite as "obviously correct", given that
|
I updated the first code sample to use an even simpler program containing only one map. |
I suspect this is because when we return a string we create it by pointing at the underlying scratch buffer, which will eventually result in prior values being mutated. The simple fix is to just allocate new memory for the string. |
In fact I suspect the byte slice mutators will have the exact same problem. |
Change https://golang.org/cl/349989 mentions this issue: |
Change https://golang.org/cl/351312 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
N/A
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Fuzz the following program:
What did you expect to see?
No crashes, but maybe some grumbling from the fuzzer because my fuzz function depends on shared state.
What did you see instead?
CC @jayconrod @katiehockman
The text was updated successfully, but these errors were encountered: