x/tools/gopls: nil panic in types.Package.Path while writing export data (internal/gcimporter) #73854
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
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.
This stack
0BaS9w
was reported by telemetry:crash/crash
runtime.gopanic:+69
golang.org/x/tools/internal/gcimporter.iexportCommon.func1:+7
runtime.gopanic:+50
runtime.panicmem:=262
runtime.sigpanic:+19
go/types.(*Package).Path:=34
golang.org/x/tools/internal/gcimporter.(*exportWriter).exportPath:=688
golang.org/x/tools/internal/gcimporter.(*exportWriter).pkg:+4
golang.org/x/tools/internal/gcimporter.(*exportWriter).doTyp:+119
golang.org/x/tools/internal/gcimporter.(*iexporter).typOff:+4
golang.org/x/tools/internal/gcimporter.(*exportWriter).typ:+1
golang.org/x/tools/internal/gcimporter.(*exportWriter).typeList:+3
golang.org/x/tools/internal/gcimporter.(*exportWriter).doTyp:+27
golang.org/x/tools/internal/gcimporter.(*iexporter).typOff:+4
golang.org/x/tools/internal/gcimporter.(*exportWriter).typ:+1
golang.org/x/tools/internal/gcimporter.(*exportWriter).value:+1
golang.org/x/tools/internal/gcimporter.(*iexporter).doDecl:+51
golang.org/x/tools/internal/gcimporter.iexportCommon:+55
golang.org/x/tools/internal/gcimporter.IExportShallow:+8
The text was updated successfully, but these errors were encountered: