gopls version: v0.16.0/go1.22.3 gopls flags: update flags: proxy extension version: 0.41.4 environment: Visual Studio Code darwin initialization error: undefined issue timestamp: Thu, 27 Jun 2024 11:16:18 GMT restart history: Mon, 24 Jun 2024 09:52:12 GMT: activation (enabled: true)
ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.
Describe what you observed.
panic: empty type set goroutine 10038 [running]: golang.org/x/tools/internal/typeparams.(*Free).Has(0x1400a0e7038, {0x101ca13d0, 0x14009d8f8b0}) free.go:86 0x66c golang.org/x/tools/internal/typeparams.(*Free).Has(0x1400a0e7038, {0x101ca2528, 0x1400a306b60}) free.go:111 0x534 golang.org/x/tools/internal/typeparams.(*Free).Has(0x1400a0e7038, {0x101ca2410, 0x1400aad8ae0}) free.go:52 0x6bc golang.org/x/tools/internal/typeparams.(*Free).Has(0x1400a0e7038, {0x101ca2528, 0x1400a306d20}) free.go:111 0x534 golang.org/x/tools/gopls/internal/golang.computeSizeOffsetInfo(0x1400aa21980, {0x1400a94db80, 0x4, 0x21e2%3F}, {0x101cb2f98, 0x14009d8f590%3F}) hover.go:1405 0xc4 golang.org/x/tools/gopls/internal/golang.hover({0x101ca6108, 0x1400bf40c90}, 0x1400a75f9e0, {0x101ca8e20, 0x1400a1bf620}, {0xa0e75e0%3F, 0x140%3F}) hover.go:318 0x9d4 golang.org/x/tools/gopls/internal/golang.Hover({0x101ca6108%3F, 0x1400bf40ab0%3F}, 0x1400a75f9e0, {0x101ca8e20, 0x1400a1bf620}, {0x4%3F, 0x0%3F}, 0x0) hover.go:107 0x8c golang.org/x/tools/gopls/internal/server.(*server).Hover(0x14000192600, {0x101ca6108, 0x1400bf40ab0}, 0x1400bf40810) hover.go:51 0x2dc golang.org/x/tools/gopls/internal/protocol.serverDispatch({0x101ca6140, 0x1400a55d590}, {0x101cc0050, 0x14000192600}, 0x1400bf407e0, {0x101ca6300, 0x14007d8a100}) tsserver.go:503 0xc70 golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.ServerHandler.func3({0x101ca6140, 0x1400a55d590}, 0x1400bf407e0, {0x101ca6300, 0x14007d8a100}) protocol.go:160 0x74 golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.handshaker.func4({0x101ca6140, 0x1400a55d590}, 0x1400bf407e0, {0x101ca6300, 0x14007d8a100}) lsprpc.go:509 0x6e0 golang.org/x/tools/gopls/internal/protocol.Handlers.MustReplyHandler.func1({0x101ca6140, 0x1400a55d590}, 0x1400a5695a8, {0x101ca6300, 0x14007d8a100}) handler.go:35 0xc0 golang.org/x/tools/gopls/internal/protocol.Handlers.AsyncHandler.func2.2() handler.go:103 0x90 created by golang.org/x/tools/gopls/internal/protocol.Handlers.AsyncHandler.func2 in goroutine 118 handler.go:100 0x19c
gopls stats -anon
{ "DirStats": { "Files": 11991, "TestdataFiles": 3, "GoFiles": 7496, "ModFiles": 4, "Dirs": 1669 }, "GOARCH": "arm64", "GOOS": "darwin", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.22.3", "GoplsVersion": "v0.16.0", "InitialWorkspaceLoadDuration": "3.408558708s", "MemStats": { "HeapAlloc": 110704344, "HeapInUse": 157474816, "TotalAlloc": 1666178736 }, "WorkspaceStats": { "Files": { "Total": 6634, "Largest": 8827634, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.22.3", "AllPackages": { "Packages": 1343, "LargestPackage": 166, "CompiledGoFiles": 7230, "Modules": 240 }, "WorkspacePackages": { "Packages": 3, "LargestPackage": 22, "CompiledGoFiles": 45, "Modules": 1 }, "Diagnostics": 0 } ] } }Comment From: findleyr
Thanks for the report, moving this to the github issue tracker since it is a bug in gopls.
Comment From: gabyhelp
Related Issues
- x/tools/gopls: crash importing test variant of tools file #66109 (closed)
- x/tools/gopls: InlayHint: nil panic due to ast.CallExpr.Fun with no type #67142 (closed)
- x/tools/gopls: automated issue report (crash) #48492 (closed)
- x/tools/gopls: crash in mapPosition computing OutgoingCalls to unsafe.Slice #66923 (closed)
- x/tools/gopls: interface conversion: types.Object is *types.Var, not *types.Func #67975 (closed)
- x/tools/gopls: stack overflow with type parameters (built with go1.18beta1) #50881 (closed)
- x/tools/gopls: panic after failed PosRange in xrefs.Index #67704
- x/tools/gopls: automated issue report (crash): file not found for pos = 1 (-) #66790
- x/tools/gopls: crash when primary diagnostics have invalid positions #66731 (closed)
- go/types, types2: gopls crash on method with type parameters #50427 (closed)
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Comment From: gopherbot
Change https://go.dev/cl/595555 mentions this issue: internal/typeparams: fix crash in interface hover with empty type set
Comment From: gopherbot
Change https://go.dev/cl/595556 mentions this issue: [gopls-release-branch.0.16] internal/typeparams: fix crash in interface hover with empty type set