gofuzz: presence of an interface value always panics
Hello there, thank you for this project!
I am currently looking at using it to fuzz inputs to https://github.com/census-instrumentation/opencensus-service
However, if a struct has a field with a value whose type is an interface, regardless of if that field is set or not. For example
type A struct {
Name string
Debug bool
Err error
}
a := new(A)
f.Fuzz(a)
gofuzz will always crash with
On no value set
panic: Can't handle <nil>: interface [recovered]
panic: Can't handle <nil>: interface
On value set
panic: Can't handle &errors.errorString{s:"Foo"}: interface [recovered]
panic: Can't handle &errors.errorString{s:"Foo"}: interface
Perhaps we could skip trying to mutate interface values that we don’t know about and let tests proceed normally, otherwise it becomes unproductive to debug this cryptic error.
Thank you.
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 13
- Comments: 20
Any update? This makes this infeasible to use for any testing using protobuf enums
It does, but the fuzzing it does is limited, and I still rely on gofuzz. For instance, since Go 1.18’s fuzzer doesn’t fuzz
struct
s, I still do: