Skip to content

x/tools/gopls: nil panic in types.Package.Path while writing export data (internal/gcimporter) #73854

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

Open
adonovan opened this issue May 23, 2025 · 1 comment
Labels
BugReport Issues describing a possible bug in the Go implementation. gopls/telemetry-wins gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@adonovan
Copy link
Member

#!stacks
"gopanic"

Issue created by stacks.

If you walk all the way up the stack, you get to this line, which writes the value of a constant. It passes pkg=nil (meaning "the current package"), yet somehow the nil pkg is plumbed all the way down to exportPath, which assumes it is non-nil.

func (w *exportWriter) value(typ types.Type, v constant.Value) {
	w.typ(typ, nil)

This stack 0BaS9w was reported by telemetry:

golang.org/x/tools/[email protected] go1.23.8 darwin/arm64 other,vscode (25)
@adonovan adonovan added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. gopls/telemetry-wins labels May 23, 2025
@adonovan adonovan changed the title x/tools/gopls: nil panic in types.Package.Pathwhile writing export data x/tools/gopls: nil panic in types.Package.Path while writing export data (interna/l/gcimporter) May 23, 2025
@gopherbot gopherbot added this to the Unreleased milestone May 23, 2025
@gabyhelp gabyhelp added the BugReport Issues describing a possible bug in the Go implementation. label May 23, 2025
@adonovan adonovan changed the title x/tools/gopls: nil panic in types.Package.Path while writing export data (interna/l/gcimporter) x/tools/gopls: nil panic in types.Package.Path while writing export data (internal/gcimporter) May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugReport Issues describing a possible bug in the Go implementation. gopls/telemetry-wins gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants