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
internal/fuzz: go test -fuzz= outputs failing input which contains wrong datatypes #58824
Comments
In go, Could we output more data to help? like: |
When fuzz testing outputs failing input into testdata/<log>, it needs to marshal the input, In go, int32 and rune are the same datatype, so it cannot differentiate the two types in typeswitch. Before, when the data is a valid unicode point, it will outputs `rune(%q)` in the log, but the real datatype maybe a int32. In this case, we have to query the ASCII or unicode table to get the int32 value. It's inconvenient. So, here we output `int32(%v)/rune(%q)` to solve this. close golang#58824
When fuzz testing outputs failing input into testdata/<log>, it needs to marshal the input, In go, int32 and rune are the same datatype, so it cannot differentiate the two types in typeswitch. Before, when the data is a valid unicode point, it will outputs `rune(%q)` in the log, but the real datatype maybe a int32. In this case, we have to query the ASCII or unicode table to get the int32 value. It's inconvenient. So, here we output `int32(%v)/rune(%q)` to solve this. close golang#58824
Change https://go.dev/cl/472815 mentions this issue: |
CC @golang/fuzzing. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, go1.20.1 still reproduces this.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I want to use
go fuzztest
to help finding the potential bugs, actually I'm learning how it works.What did you expect to see?
I want to see the failing and want to check failing input from the log in
testdata/.....
.It ouputs:
The data in the log is:
What did you see instead?
The data in the log, I want to see the right datatype and value:
The text was updated successfully, but these errors were encountered: