-
Notifications
You must be signed in to change notification settings - Fork 18k
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: do not write crashers to testdata in the module cache #48495
Comments
Given the |
Change https://golang.org/cl/359256 mentions this issue: |
I added a test illustrating the current behavior. I see two or three options to fix the situation:
|
I think I prefer option (3) for Go 1.18. If we reject |
Change https://golang.org/cl/359414 mentions this issue: |
Another couple options, both which still allow fuzzing in a different module:
I'm fine with punting this to 1.19 though. |
(4) is, I think, basically equivalent to my (1). ( The main issue I foresee with that approach is that it makes reproducibility tricky: it would either cause (5) is my (2), but stated more concisely. 🙂 |
Change https://golang.org/cl/359481 mentions this issue: |
We had been repeating conditions for specific platforms and architectures to gate fuzzing tests, but the more of those tests we add the more we will have to update if the set of supported platforms and archictures expands over time. We also ought to provide a friendlier error message when 'go test -fuzz' is used on non-supported platforms. This change adds predicates in cmd/internal/sys, which already contains similar predicates for related functionality (such as the race detector), and uses those predicates in 'go test' and TestScript. For #48495 Change-Id: If24c3997aeb4d201258e21e5b6cf4f7c08fbadd7 Reviewed-on: https://go-review.googlesource.com/c/go/+/359481 Trust: Bryan C. Mills <bcmills@google.com> Trust: Katie Hockman <katie@golang.org> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Katie Hockman <katie@golang.org>
Change https://golang.org/cl/359574 mentions this issue: |
Fixes #28386 Updates #48495 Change-Id: I76186077c7bbe3f8f608026ee1865de83fe169b4 Reviewed-on: https://go-review.googlesource.com/c/go/+/359574 Trust: Bryan C. Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
When the fuzzing engine finds an input that causes an error in the fuzz function, it normally attempts to write that input to a file in
testdata/fuzz/$target
(where$target
is the name of the fuzz target), relative to the package directory.If this file can't be created, for example, because the package is part of the read-only module cache,
go test -fuzz
just prints the I/O error then exits. The user has no way to find out what the crashing input was.go test -fuzz
should ensure that these files are written somewhere. The fuzz cache is very likely to be writable since it's part of the build cache, so that would be a good location.go test -fuzz
should print an alternative message, pointing to the newly written file. Unfortunately, it can't be used directly withgo test -run
.The text was updated successfully, but these errors were encountered: