x/tools/gopls: nil deref in (*types.Package).Path within gcimporter
Opened this issue · 2 comments
adonovan commented
#!stacks
"types.(*Package).Path" && "golang.org/x/tools/internal/gcimporter.(*exportWriter).exportPath"
Issue created by stacks.
(I assume it's a nil pointer. It could be an invalid pointer if this is yet another instance of memory corruption.)
This stack t1Et8g was reported by telemetry:
gopls/buggolang.org/x/tools/gopls/internal/util/bug.report:+35,+0x393golang.org/x/tools/gopls/internal/util/bug.Reportf:+1,+0x27golang.org/x/tools/internal/gcimporter.iexportCommon.func1:+4,+0x6bruntime.gopanic:+50,+0x123runtime.panicmem:=262,+0x2ffruntime.sigpanic:+19,+0x2ccgo/types.(*Package).Path:=34,+0x6cgolang.org/x/tools/internal/gcimporter.(*exportWriter).exportPath:=696,+0x68golang.org/x/tools/internal/gcimporter.(*exportWriter).pkg:+4,+0x64golang.org/x/tools/internal/gcimporter.(*exportWriter).doTyp:+73,+0x1cfgolang.org/x/tools/internal/gcimporter.(*iexporter).typOff:+4,+0x8bgolang.org/x/tools/internal/gcimporter.(*exportWriter).typ:+1,+0x2fgolang.org/x/tools/internal/gcimporter.(*exportWriter).typeList:+3,+0x7bgolang.org/x/tools/internal/gcimporter.(*exportWriter).doTyp:+27,+0x493golang.org/x/tools/internal/gcimporter.(*iexporter).typOff:+4,+0x8bgolang.org/x/tools/internal/gcimporter.(*exportWriter).typ:+1,+0x2f
golang.org/x/tools/gopls@v0.20.0 go1.24.5 darwin/arm64 neovim,vscode (1)
Dups: siaToA
adonovan commented
This stack siaToA was reported by telemetry:
crash/crashruntime.gopanic:+69,+0x153golang.org/x/tools/internal/gcimporter.iexportCommon.func1:+14,+0xdbruntime.gopanic:+50,+0x123runtime.panicmem:=262,+0x2ffruntime.sigpanic:+19,+0x2ccgo/types.(*Package).Path:=34,+0x6cgolang.org/x/tools/internal/gcimporter.(*exportWriter).exportPath:=696,+0x68golang.org/x/tools/internal/gcimporter.(*exportWriter).pkg:+4,+0x64golang.org/x/tools/internal/gcimporter.(*exportWriter).doTyp:+73,+0x1cfgolang.org/x/tools/internal/gcimporter.(*iexporter).typOff:+4,+0x8bgolang.org/x/tools/internal/gcimporter.(*exportWriter).typ:+1,+0x2fgolang.org/x/tools/internal/gcimporter.(*exportWriter).typeList:+3,+0x7bgolang.org/x/tools/internal/gcimporter.(*exportWriter).doTyp:+27,+0x493golang.org/x/tools/internal/gcimporter.(*iexporter).typOff:+4,+0x8bgolang.org/x/tools/internal/gcimporter.(*exportWriter).typ:+1,+0x2fgolang.org/x/tools/internal/gcimporter.(*exportWriter).value:+1,+0x33golang.org/x/tools/internal/gcimporter.(*iexporter).doDecl:+51,+0x69bgolang.org/x/tools/internal/gcimporter.iexportCommon:+62,+0x2a3golang.org/x/tools/internal/gcimporter.IExportShallow:+8,+0x6b
golang.org/x/tools/gopls@v0.20.0 go1.24.5 darwin/arm64 neovim,vscode (1)
gabyhelp commented
Related Issues
- x/tools/gopls: nil panic in types.Package.Path while writing export data (internal/gcimporter) #73854
- x/tools/gopls: objectpath: panic due to nil *types.Signature #75575
- x/tools/gopls: OutgoingCalls: nil *Package deref crash (likely our nemesis error.Error) #75230 (closed)
- x/tools/gopls: CodeActions: nil panic in refactorRewriteEliminateDotImport #74581
- x/tools/gopls/internal/mcp: symbol references tool panics in ObjectLocation after nil result from types.LookupFieldOrMethod #74904 (closed)
- x/tools/gopls: SEGV in gcimporter.iexportCommon (bad SP) #72135
- x/tools/gopls/internal/cache: nil deref in modindex.Index.Lookup #74055 (closed)
- x/tools/gopls: impossible nil deref in reflect package #75207
- x/tools/gopls: Package.Path called on nil Package in AddTestForFunc #73687 (closed)
- x/tools/gopls: "failed to find object for objectPath" bug in gcimporter #73588
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)