Closed tonghia closed 1 month ago
gopls version: v0.15.3/go1.22.3 gopls flags: update flags: proxy extension version: 0.41.4 environment: Visual Studio Code linux initialization error: undefined issue timestamp: Thu, 09 May 2024 08:56:59 GMT restart history: Thu, 09 May 2024 08:26:00 GMT: activation (enabled: true)
ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.
Describe what you observed.
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb8cb5c] goroutine 96339 [running]: go/token.(*File).Name(...) position.go:109 golang.org/x/tools/gopls/internal/golang.mapPosition({0x1293cc8, 0xc032179e30}, 0x0%3F, {0x128b8a0, 0xc000f8ad80}, 0x0, 0x7) definition.go:301 0x5c golang.org/x/tools/gopls/internal/golang.OutgoingCalls({0x1293cc8%3F, 0xc032179d10%3F}, 0xc000f8ad80, {0x12966e0, 0xc000aec1e0}, {0x121%3F, 0x0%3F}) call_hierarchy.go:282 0xb32 golang.org/x/tools/gopls/internal/server.(*server).OutgoingCalls(0xc0003fa000, {0x1293d00%3F, 0xc0325740f0%3F}, 0xc03144c280) call_hierarchy.go:58 0x195 golang.org/x/tools/gopls/internal/protocol.serverDispatch({0x1293d00, 0xc0325740f0}, {0x12ae940, 0xc0003fa000}, 0xc032179b30, {0x1293ec0, 0xc032568fc0}) tsserver.go:131 0x4daa golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.ServerHandler.func3({0x1293d00, 0xc0325740f0}, 0xc032179b30, {0x1293ec0, 0xc032568fc0}) protocol.go:160 0x85 golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.handshaker.func4({0x1293d00, 0xc0325740f0}, 0xc032179b30, {0x1293ec0, 0xc032568fc0}) lsprpc.go:509 0x923 golang.org/x/tools/gopls/internal/protocol.Handlers.MustReplyHandler.func1({0x1293d00, 0xc0325740f0}, 0xc0320c5038, {0x1293ec0, 0xc032568fc0}) handler.go:35 0xc6 golang.org/x/tools/gopls/internal/protocol.Handlers.AsyncHandler.func2.2() handler.go:103 0x96 created by golang.org/x/tools/gopls/internal/protocol.Handlers.AsyncHandler.func2 in goroutine 141 handler.go:100 0x1c5
Thanks for filing this issue! This looks like it's another instance of golang/go#66923.
On a panic its likely it was paused at fatalpanic or fatalthrow, which also uses the unsafe package,
gopls version: v0.15.3/go1.22.3 gopls flags: update flags: proxy extension version: 0.41.4 environment: Visual Studio Code linux initialization error: undefined issue timestamp: Thu, 09 May 2024 08:56:59 GMT restart history: Thu, 09 May 2024 08:26:00 GMT: activation (enabled: true)
ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.
Describe what you observed.
gopls stats -anon
{ "DirStats": { "Files": 3916, "TestdataFiles": 0, "GoFiles": 212, "ModFiles": 1, "Dirs": 326 }, "GOARCH": "amd64", "GOOS": "linux", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.22.3", "GoplsVersion": "v0.15.3", "InitialWorkspaceLoadDuration": "3.93463926s", "MemStats": { "HeapAlloc": 107380512, "HeapInUse": 165896192, "TotalAlloc": 1646601960 }, "WorkspaceStats": { "Files": { "Total": 3878, "Largest": 4950165, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.22.3", "AllPackages": { "Packages": 717, "LargestPackage": 161, "CompiledGoFiles": 3889, "Modules": 112 }, "WorkspacePackages": { "Packages": 33, "LargestPackage": 52, "CompiledGoFiles": 226, "Modules": 1 }, "Diagnostics": 0 } ] } }