#!stacks
"sigpanic" && "token.(*File).Name" && "mapPosition:+2" && "docLinkDefinition:+5"
Issue created by stacks.
This stack jS5AtQ
was reported by telemetry:
crash/crash
runtime.gopanic:+69,+0x167
runtime.panicmem:=262,+0x197
runtime.sigpanic:+9,+0x167
go/token.(*File).Name:=114,+0x5c
golang.org/x/tools/gopls/internal/golang.mapPosition:+2,+0x63
golang.org/x/tools/gopls/internal/golang.docLinkDefinition:+5,+0xba
golang.org/x/tools/gopls/internal/golang.Definition:+53,+0x2be
golang.org/x/tools/gopls/internal/server.(*server).Definition:+19,+0x50e
golang.org/x/tools/gopls/internal/protocol.serverDispatch:+215,+0x26e1
golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.ServerHandler.func4:+5,+0x84
golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.handshaker.func5:+52,+0x908
golang.org/x/tools/gopls/internal/protocol.Handlers.MustReplyHandler.func1:+2,+0xc5
golang.org/x/tools/gopls/internal/protocol.Handlers.AsyncHandler.func2.2:+3,+0x95
runtime.goexit:+0,+0x0
golang.org/x/tools/gopls@v0.19.1 go1.24.3 windows/amd64 vscode (1)
Comment From: adonovan
I was able to reproduce the crash by putting [unsafe.Pointer]
within a doc link.
Comment From: gopherbot
Change https://go.dev/cl/684976 mentions this issue: gopls/internal/golang: cleanups while investigating golang/go#74434
Comment From: gabyhelp
Related Issues
- x/tools/gopls: Hover: nil deref in parseDocLink #70635 (closed)
- x/tools/gopls: Definition: out-of-bounds panic #73797 (closed)
- x/tools/gopls: analysisinternal.ZeroValue crash on (presumably) unsafe.Pointer #70585 (closed)
- x/tools/gopls: crash in mapPosition computing OutgoingCalls to unsafe.Slice #66923 (closed)
- x/tools/gopls: Hover: nil deref in golang.StdSymbolOf #70969 (closed)
- x/tools/gopls: CodeActions: "end \< start" panic #74394 (closed)
- x/tools/gopls: Hover: invalid nil entry in types.Defs map #69362 (closed)
- x/tools/gopls: Implementation (by signatures): nil panic in dynamicFuncCallType #74305 (closed)
- x/tools/gopls: nil deref in x/telemetry/internal/counter.(*Counter).add #73890
- x/tools/gopls: automated issue report (crash) #40433 (closed)
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Comment From: gopherbot
Change https://go.dev/cl/685095 mentions this issue: gopls/internal/golang: Definition: fix crash wrt unsafe.Pointer