-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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/types: nil pointer dereference in go/types.(*StdSizes).Sizeof #62167
Comments
CC @cuonglm. |
This is fixed in master after https://go-review.googlesource.com/c/tools/+/516917. We need an x/tools release to ensure that more downstreams pick up this important fix, however. cc @golang/tools-team |
https://go-review.googlesource.com/c/tools/+/516917 does indeed fix the problem. I'm closing this, tell me if you want it reopened. |
FWIW, we now have automated tagging of x-repos monthly, and it's still pretty early in the Go dev cycle, so IMO is should be OK to wait for the normal tagging to occur in ~the first week of September. |
I think that's fair enough in general. I think I just got particularly surprised by this panic, since daily driving Go tip/master is usually fairly stable, and this change broke practically every Go tool in a bad way :) All other bad breakages I can think of in the past few years were direct regressions that led to quick reverts, whereas this is an indirect and intentional breakage that will take weeks or months to get a release and downstream dependency version bumps. I'm not disagreeing with @findleyr's conclusion, for what it's worth. I'm only clarifying why this breakage might linger on in the form of more bug reports in the coming weeks. |
@mvdan I agree that the blast radius of this change has been unfortunately large. Arguably it would have been cleaner to tag a fixed version of x/tools (and update x-repos recursively), and then let that change soak a bit before proceeding with the breaking change in Go. |
A few years ago there was talk of moving go/packages into the standard library. It eventually ceased but maybe it was correct and it should have been done? |
Enumer is currently crashing if `make go-generate` is run with Go 1.22: alvaroloes/enumer#71 Temporal helpfully found an easy fix: temporalio/sdk-go#1382 For the underlying cause: golang/go#62167 So I've mimicked that by just doing a `go get golang.org/x/tools@latest` in the tools-module. And now `make clean` -> `GOTOOLCHAIN=[go1.20.1 or go1.22.1] make go-generate` both work correctly. (you need Go 1.21 or newer to use GOTOOLCHAIN. highly recommended!) Since this only affects build-time tools and doesn't change any generated code, it seems trivially safe, but I have not checked what all has changed in golang.org/x/tools across these versions.
* Upgrade to later version of x/tools that does not depend on StdSizes. * Dependency on StdSizes introduces fragility in client libraries that introduces risk of Nil pointer exceptions Related bugs and issues: * golang/go#62167 * https://go-review.googlesource.com/c/tools/+/516917
* Upgrade to later version of x/tools that does not depend on StdSizes. * Dependency on StdSizes introduces fragility in client libraries that introduces risk of Nil pointer exceptions Related bugs and issues: * golang/go#62167 * https://go-review.googlesource.com/c/tools/+/516917
Does not affect go1.21, only go built from tip.
go env
OutputWhat did you do?
Bisect says the problem started with 5fa4aac however looking at the code I don't see how this could happen and it might be a compiler bug instead.
The text was updated successfully, but these errors were encountered: