-
Notifications
You must be signed in to change notification settings - Fork 276
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
go-fuzz-build: build fails at tip Go due to duplicated //go:build lines #313
Comments
Thanks for the excellent bug report. go-fuzz is slated to be replaced by something in the standard library. So your hack (“patching go-fuzz-build to just skip //go:build lines”) actually sounds like just what is called for to tide us over. Want to send a PR, by chance? |
Thanks for the quick response!
Indeed! My concern was that https://golang.org/issue/44551 will, if accepted, only be experimental in 1.17. But actually, reading the transition plan for
Sure, will do (but not tonight :)) |
Ah, I just got bit by this. I'll just do a hack to locally remove the duplicate comment until I can jump to Go's own fuzzing. |
…etting 'go 1.17' directive Workaround dvyukov#313. cmd/go should in theory pay attention to the version set in the 'go' directive when interpreting //go:build comments,
Avoid preserving '//go:build' comments in both trimComments and initialComments. Fixes dvyukov#313.
…etting 'go 1.17' directive Workaround #313. cmd/go should in theory pay attention to the version set in the 'go' directive when interpreting //go:build comments,
Avoid preserving '//go:build' comments in both trimComments and initialComments. Fixes #313.
I believe this is only an issue for the newly landed changes in tip Go for Go 1.17: golang.org/issues/41184
When built against tip Go,
go-fuzz-build
fails with, for example, the following error:Checking the instrumented
goroot
, we can see that this is indeed the case, for example, inerrno_unix.go
:Naively skimming the code, it appears there is simultaneously special handling in
trimComments
to preserve comments starting with//go:
, and also special handling to preserve initial comments (ininitialComments
). It looks like these overlap, resulting in the duplicated//go:build
lines.I was able to achieve what I wanted (fuzzing some recent changes to
go/parser
) by patchinggo-fuzz-build
to just skip//go:build
lines, but this is just a hack: a real solution should preserve (and not duplicate) the//go:build
lines.Apologies if I've misused terminology; this is my first time using go-fuzz. Thanks for building such a useful tool! go-fuzz found the crash I was looking for in just a few minutes :)
The text was updated successfully, but these errors were encountered: