Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
image: add sample fuzz tests for prototype of "fuzzing as a first class citizen" #30979
As a follow-up to #30719 and in support of the proposal to "make fuzzing a first class citizen" in #19109, the suggestion here is to add
Note that this issue is solely about the
For reference, here is a gist showing the diff between dvyukov/go-fuzz-corpus/tiff/tiff.go and the final form of that file as merged into
Happy to discuss any aspect of this, and of course happy to be corrected if any of the above is different than how people would like to proceed here.
I'm happy to see that progress is being made, and I am willing to prepare these next CLs too, if that's okay with everyone.
It seems like of the three packages listed in this issue,
First, there are two fuzz functions: a
Second, @dvyukov, what exactly do you mean by "open-code" all comparisons? Explicitly writing loops and such, and avoiding
I named them after the actual Encode/Decode functions. Seems fine to me.
Regarding this piece about
It seems image/src/gif/write_test.go has some logic around doing comparison, including in
I would like to bring to your attention the fact that building
I imagine that for people who do not use two different Go trees (one for general work using Go and another for working on Go itself), this is not a problem at all, but if you are like me and use different trees, you might hit this, and be surprised or confused.
I am hoping that this post helps with this potential confusion.
Add a Fuzz function to package png, under the gofuzz build tag. This function is based on the png/png.go code, from github.com/dvyukov/go-fuzz-corpus, modified to use direct comparison of image bounds rather than reflect.DeepEqual. Updates #30979 Updates #19109 Change-Id: Idb86e7ded0c2d78e6cadbeda84c7b1f35b8c579c Reviewed-on: https://go-review.googlesource.com/c/go/+/168558 Reviewed-by: thepudds <email@example.com> Reviewed-by: Dmitry Vyukov <firstname.lastname@example.org> Run-TryBot: Dmitry Vyukov <email@example.com>