#!stacks
"go/types.(*Package).Path:=34" && "gcimporter.(*exportWriter).exportPath:=688"
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:
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
golang.org/x/tools/gopls@v0.18.1 go1.23.8 darwin/arm64 other,vscode (25)
Comment From: gabyhelp
Related Issues
- x/tools/gopls: crash exporting constant with partially defined type #60891 (closed)
- x/tools/gopls: SEGV in gcimporter.iexportCommon (bad SP) #72135
- x/tools/gopls: nil deref in Exporter.ProcessEvent #71928
- x/tools/gopls: Package.Path called on nil Package in AddTestForFunc #73687 (closed)
- x/tools/gopls: nil *types.Package panic in testKind #73096 (closed)
- runtime: SEGV in mapaccess2 (go1.23.2 darwin/amd64) #71123
- x/tools/gopls: "failed to find object for objectPath" bug in gcimporter #73588
- x/tools/gopls: nil deref panic in go.test code action #72907 (closed)
- x/tools/gopls: Rename: type assertion panics in renameImports #71656 (closed)
- x/tools/gopls: "package name is %q, want %q" bug in typeCheckBatch.importPackage #64235
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Comment From: adonovan
This stack ChWbnw
was reported by telemetry:
crash/crash
runtime.gopanic:+69
runtime.goPanicIndex:+2
golang.org/x/tools/gopls/internal/golang.Definition:+107
golang.org/x/tools/gopls/internal/server.(*server).Definition:+19
golang.org/x/tools/gopls/internal/protocol.serverDispatch:+215
golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.ServerHandler.func3:+5
golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.handshaker.func4:+52
golang.org/x/tools/gopls/internal/protocol.Handlers.MustReplyHandler.func1:+2
golang.org/x/tools/gopls/internal/protocol.Handlers.AsyncHandler.func2.2:+3
runtime.goexit:+0
golang.org/x/tools/gopls@v0.18.1 go1.24.2 darwin/arm64 vscode (1)
This stack wY83jw
was reported by telemetry:
crash/crash
runtime.gopanic:+69
runtime.panicmem:=262
runtime.sigpanic:+19
golang.org/x/tools/gopls/internal/cache.(*Snapshot).GoCommandInvocation:+5
golang.org/x/tools/gopls/internal/server.(*commandHandler).Vendor.func1:+10
golang.org/x/tools/gopls/internal/server.(*commandHandler).run.func2:+3
golang.org/x/tools/gopls/internal/server.(*commandHandler).run:+81
golang.org/x/tools/gopls/internal/server.(*commandHandler).Vendor:+1
golang.org/x/tools/gopls/internal/protocol/command.Dispatch:+226
golang.org/x/tools/gopls/internal/server.(*server).ExecuteCommand:+28
golang.org/x/tools/gopls/internal/protocol.serverDispatch:+674
golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.ServerHandler.func3:+5
golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.handshaker.func4:+52
golang.org/x/tools/gopls/internal/protocol.Handlers.MustReplyHandler.func1:+2
golang.org/x/tools/gopls/internal/protocol.Handlers.AsyncHandler.func2.2:+3
runtime.goexit:+0
golang.org/x/tools/gopls@v0.18.1 go1.24.0 darwin/arm64 neovim,vscode (5)
This stack v95MAw
was reported by telemetry:
crash/crash
runtime.gopanic:+69
runtime.panicmem:=262
runtime.sigpanic:+19
golang.org/x/tools/gopls/internal/golang.hover:+216
golang.org/x/tools/gopls/internal/golang.Hover:+4
golang.org/x/tools/gopls/internal/server.(*server).Hover:+30
golang.org/x/tools/gopls/internal/protocol.serverDispatch:+335
golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.ServerHandler.func3:+5
golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.handshaker.func4:+52
golang.org/x/tools/gopls/internal/protocol.Handlers.MustReplyHandler.func1:+2
golang.org/x/tools/gopls/internal/protocol.Handlers.AsyncHandler.func2.2:+3
runtime.goexit:+0
golang.org/x/tools/gopls@v0.18.1 go1.23.6 linux/amd64 vscode (1)
This stack 9iXGhQ
was reported by telemetry:
crash/crash
runtime.gopanic:+69
golang.org/x/tools/refactor/satisfy.(*Finder).expr:+168
golang.org/x/tools/refactor/satisfy.(*Finder).call:+26
golang.org/x/tools/refactor/satisfy.(*Finder).exprN:+9
golang.org/x/tools/refactor/satisfy.(*Finder).stmt:+35
golang.org/x/tools/refactor/satisfy.(*Finder).stmt:+90
golang.org/x/tools/refactor/satisfy.(*Finder).stmt:+204
golang.org/x/tools/refactor/satisfy.(*Finder).stmt:+90
golang.org/x/tools/refactor/satisfy.(*Finder).Find:+19
golang.org/x/tools/gopls/internal/golang.(*renamer).satisfy:+27
golang.org/x/tools/gopls/internal/golang.(*renamer).checkMethod:+178
golang.org/x/tools/gopls/internal/golang.(*renamer).check:+16
golang.org/x/tools/gopls/internal/golang.renameObjects:+24
golang.org/x/tools/gopls/internal/golang.renameExported:+56
golang.org/x/tools/gopls/internal/golang.renameOrdinary:+157
golang.org/x/tools/gopls/internal/golang.Rename:+24
golang.org/x/tools/gopls@v0.18.1 go1.24.1 darwin/arm64 vscode (2)
This stack PrtfKQ
was reported by telemetry:
crash/crash
runtime.gopanic:+69
go/types.(*Checker).handleBailout:+7
go/types.(*Checker).Files.deferwrap1:+0
runtime.gopanic:+50
go/types.setDefType:+7
go/types.(*Checker).typInternal:+175
go/types.(*Checker).definedType:+1
go/types.(*Checker).typeDecl:+55
go/types.(*Checker).objDecl:+141
go/types.(*Checker).packageObjects:+59
go/types.(*Checker).checkFiles:+29
go/types.(*Checker).Files:+13
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).checkPackage:+73
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getPackage.func1:+49
golang.org/x/tools/gopls/internal/cache.(*futureCache[...]).get:+32
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getPackage:+1
golang.org/x/tools/gopls@v0.18.1 go1.23.6 windows/amd64 vscode (1)
golang.org/x/tools/gopls@v0.18.1 go1.23.6 linux/amd64 vscode (1)
This stack r1YMdg
was reported by telemetry:
crash/crash
runtime.gopanic:+69
runtime.panicmem:=262
runtime.sigpanic:+9
golang.org/x/tools/gopls/internal/golang.hover:+216
golang.org/x/tools/gopls/internal/golang.Hover:+4
golang.org/x/tools/gopls/internal/server.(*server).Hover:+30
golang.org/x/tools/gopls/internal/protocol.serverDispatch:+335
golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.ServerHandler.func3:+5
golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.handshaker.func4:+52
golang.org/x/tools/gopls/internal/protocol.Handlers.MustReplyHandler.func1:+2
golang.org/x/tools/gopls/internal/protocol.Handlers.AsyncHandler.func2.2:+3
runtime.goexit:+0
golang.org/x/tools/gopls@v0.18.1 go1.23.6 windows/amd64 vscode (1)
This stack Cys7zA
was reported by telemetry:
crash/crash
runtime.gopanic:+69
runtime.goPanicSliceAcap:+2
golang.org/x/tools/gopls/internal/cache/parsego.fixInitStmt:+10
golang.org/x/tools/gopls/internal/cache/parsego.fixAST.func1:+27
golang.org/x/tools/gopls/internal/cache/parsego.walkASTWithParent.func1:+17
go/ast.inspector.Visit:+1
go/ast.Walk:+1
go/ast.Walk:+224
go/ast.walkList[...]:=21
go/ast.Walk:+178
go/ast.Walk:+299
go/ast.walkList[...]:=21
go/ast.Walk:+308
go/ast.Inspect:=372
golang.org/x/tools/gopls/internal/cache/parsego.walkASTWithParent:+2
golang.org/x/tools/gopls/internal/cache/parsego.fixAST:+2
golang.org/x/tools/gopls/internal/cache/parsego.Parse:+57
golang.org/x/tools/gopls/internal/cache.(*parseCache).startParse.func1:+5
golang.org/x/tools/internal/memoize.(*Promise).run.func2.1:+7
golang.org/x/tools/gopls@v0.18.1 go1.24.0 linux/amd64 neovim (1)