x/tools/gopls: nil deref panic in go.test code action
Closed this issue · 3 comments
adonovan commented
#!stacks
"runtime.sigpanic" && "internal/cache.(*Package).TypesInfo:=176" && "golang.goTest:+1"
Looks like we forgot to specify needPkg: true for go.test code actions. How did this never show up earlier??
Issue created by stacks.
This stack P9Jq1Q was reported by telemetry:
crash/crashruntime.gopanic:+69runtime.panicmem:=262runtime.sigpanic:+19golang.org/x/tools/gopls/internal/cache.(*Package).TypesInfo:=176golang.org/x/tools/gopls/internal/golang.goTest:+1golang.org/x/tools/gopls/internal/golang.CodeActions:+65golang.org/x/tools/gopls/internal/server.(*server).CodeAction:+154golang.org/x/tools/gopls/internal/protocol.serverDispatch:+160golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.ServerHandler.func3:+5golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.handshaker.func4:+52golang.org/x/tools/gopls/internal/protocol.Handlers.MustReplyHandler.func1:+2golang.org/x/tools/gopls/internal/protocol.Handlers.AsyncHandler.func2.2:+3runtime.goexit:+0
golang.org/x/tools/gopls@v0.18.1 go1.24.0 darwin/arm64 neovim (6)
gabyhelp commented
Related Issues
- x/tools/gopls: CodeAction: nil panic in findMatchingDiagnostics #71028 (closed)
- x/tools/gopls: Hover: nil deref in golang.StdSymbolOf #70969 (closed)
- x/tools/gopls: Hover: invalid nil entry in types.Defs map #69362 (closed)
- x/tools/gopls: Completion: nil deref in expectedCompositeLiteralType #72136
- x/tools/gopls: nil deref in Exporter.ProcessEvent #71928
- x/tools/gopls: Hover: nil deref in parseDocLink #70635 (closed)
- x/tools/gopls: failed *types.Func type assertion in populateCommentCompletions #71273 (closed)
- x/tools/gopls: nil Signature (?) deref in Completion #70634 (closed)
- x/tools/gopls: stubmethods: nil deref of FuncType.Results in fromReturnStmt #70967 (closed)
- x/tools/gopls: "nil handle" assert in getPackageHandles #71353
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
gopherbot commented
Change https://go.dev/cl/658556 mentions this issue: gopls/internal/golang: fix crash in source.test code action
findleyr commented
As I commented on the CL, I don't think this is that surprising. needPkg was added recently, and only matters if invoked with an only= filter that excludes other code actions requiring a package.
Thanks for the fix.