x/tools/gopls: Hover: nil deref in golang.StdSymbolOf
Closed this issue · 5 comments
adonovan commented
#!stacks
"runtime.sigpanic" && "hover:+472"
Issue created by stacks.
// Handle Method.
if fn, _ := obj.(*types.Func); fn != nil {
isPtr, named := typesinternal.ReceiverNamed(fn.Signature().Recv()) // --panic--
if isPackageLevel(named.Obj()) {
for _, s := range symbols {This stack J7Opuw was reported by telemetry:
crash/crashruntime.gopanic:+69runtime.panicmem:=262runtime.sigpanic:+19golang.org/x/tools/gopls/internal/golang.StdSymbolOf:+27golang.org/x/tools/gopls/internal/golang.hover:+472golang.org/x/tools/gopls/internal/golang.Hover:+4golang.org/x/tools/gopls/internal/server.(*server).Hover:+30golang.org/x/tools/gopls/internal/protocol.serverDispatch:+335golang.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.17.1 go1.23.4 darwin/arm64 vscode (1)
golang.org/x/tools/gopls@v0.17.0 go1.23.4 linux/amd64 vscode (1)
Dups: 9xr_OA
gabyhelp commented
Related Issues
- x/tools/gopls: Hover: nil deref in parseDocLink #70635 (closed)
- x/tools/gopls: crash in Hover (telemetry) #69362
- x/tools/gopls: Hover: panic in lookup{ObjectByName,DocLinkSymbol} #69616
- x/tools/gopls: panic in hover #52211 (closed)
- x/tools/gopls: nil Signature (?) deref in Completion #70634 (closed)
- x/tools/gopls: Hover bug reported by telemetry [PE4R3g] #64244 (closed)
- x/tools/gopls: automated issue report (crash) #44300 (closed)
- x/tools/gopls: bug report in GetIfaceStubInfo #70666
- gopls: automated issue report (crash) #40464 (closed)
- x/tools/gopls: Hover bug reported by telemetry #66857 (closed)
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
adonovan commented
I assume there's the usual off-by-one in the line numbering and that the actual panic is the named.Obj dereference.
gopherbot commented
Change https://go.dev/cl/638597 mentions this issue: gopls/internal/golang: check for nil ReceiverNamed
adonovan commented
Fixed by https://go.dev/cl/638597.
adonovan commented
This stack 9xr_OA was reported by telemetry:
crash/crashruntime.gopanic:+69runtime.panicmem:=262runtime.sigpanic:+9golang.org/x/tools/gopls/internal/golang.StdSymbolOf:+27golang.org/x/tools/gopls/internal/golang.hover:+472golang.org/x/tools/gopls/internal/golang.Hover:+4golang.org/x/tools/gopls/internal/server.(*server).Hover:+30golang.org/x/tools/gopls/internal/protocol.serverDispatch:+335golang.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.17.1 go1.23.4 windows/amd64 vscode (4)