``` #!stacks "gopanic" && "DocumentURI.Path" ``` Issue created by [stacks](https://pkg.go.dev/golang.org/x/telemetry/cmd/stacks). Why is the deferred call to recoverHandlerPanic in serverDispatch not causing recovery?? This stack `cX84Vw` was [reported by telemetry](https://telemetry.go.dev/data/2025-07-14): - `crash/crash` - [`runtime.gopanic:+69,+0x167`](https://cs.opensource.google/go/go/+/go1.24.4:src/runtime/panic.go;l=811) - [`golang.org/x/tools/gopls/internal/protocol.DocumentURI.Path:+9,+0x3e`](https://cs.opensource.google/go/x/tools/+/gopls/v0.19.1:gopls/internal/protocol/uri.go;l=89) - [`golang.org/x/tools/gopls/internal/protocol.DocumentURI.Clean:+1,+0x17`](https://cs.opensource.google/go/x/tools/+/gopls/v0.19.1:gopls/internal/protocol/uri.go;l=72) - [`golang.org/x/tools/gopls/internal/cache.(*Session).SnapshotOf:+1,+0x44`](https://cs.opensource.google/go/x/tools/+/gopls/v0.19.1:gopls/internal/cache/session.go;l=383) - [`golang.org/x/tools/gopls/internal/cache.(*Session).FileOf:+1,+0x2a`](https://cs.opensource.google/go/x/tools/+/gopls/v0.19.1:gopls/internal/cache/session.go;l=459) - [`golang.org/x/tools/gopls/internal/server.(*server).DidCreateFiles:+7,+0x12a`](https://cs.opensource.google/go/x/tools/+/gopls/v0.19.1:gopls/internal/server/workspace.go;l=152) - [`golang.org/x/tools/gopls/internal/protocol.serverDispatch:+650,+0x36db`](https://cs.opensource.google/go/x/tools/+/gopls/v0.19.1:gopls/internal/protocol/tsserver.go;l=820) - [`golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.ServerHandler.func4:+5,+0x84`](https://cs.opensource.google/go/x/tools/+/gopls/v0.19.1:gopls/internal/protocol/protocol.go;l=159) - [`golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.handshaker.func5:+52,+0x908`](https://cs.opensource.google/go/x/tools/+/gopls/v0.19.1:gopls/internal/lsprpc/lsprpc.go;l=542) - [`golang.org/x/tools/gopls/internal/protocol.Handlers.MustReplyHandler.func1:+2,+0xc5`](https://cs.opensource.google/go/x/tools/+/gopls/v0.19.1:internal/jsonrpc2/handler.go;l=35) - [`golang.org/x/tools/gopls/internal/protocol.Handlers.AsyncHandler.func2.2:+3,+0x95`](https://cs.opensource.google/go/x/tools/+/gopls/v0.19.1:internal/jsonrpc2/handler.go;l=104) - `runtime.goexit:+0,+0x0` ``` golang.org/x/tools/gopls@v0.19.1 go1.24.4 windows/amd64 other,vscode (1) ``` Dups: AkviVw n8SKgg yYgMqQ pIsUQw
Issue created by stacks.
Why is the deferred call to recoverHandlerPanic in serverDispatch not causing recovery??
This stack
cX84Vwwas reported by telemetry:crash/crashruntime.gopanic:+69,+0x167golang.org/x/tools/gopls/internal/protocol.DocumentURI.Path:+9,+0x3egolang.org/x/tools/gopls/internal/protocol.DocumentURI.Clean:+1,+0x17golang.org/x/tools/gopls/internal/cache.(*Session).SnapshotOf:+1,+0x44golang.org/x/tools/gopls/internal/cache.(*Session).FileOf:+1,+0x2agolang.org/x/tools/gopls/internal/server.(*server).DidCreateFiles:+7,+0x12agolang.org/x/tools/gopls/internal/protocol.serverDispatch:+650,+0x36dbgolang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.ServerHandler.func4:+5,+0x84golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.handshaker.func5:+52,+0x908golang.org/x/tools/gopls/internal/protocol.Handlers.MustReplyHandler.func1:+2,+0xc5golang.org/x/tools/gopls/internal/protocol.Handlers.AsyncHandler.func2.2:+3,+0x95runtime.goexit:+0,+0x0Dups: AkviVw n8SKgg yYgMqQ pIsUQw