golang / vscode-go

Go extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=golang.Go
Other
3.86k stars 741 forks source link

gopls: automated issue report (crash) #3322

Closed hajimehoshi closed 5 months ago

hajimehoshi commented 5 months ago

gopls version: v0.15.2/go1.22.0 gopls flags: update flags: proxy extension version: 0.41.2 environment: Visual Studio Code darwin initialization error: undefined issue timestamp: Sun, 07 Apr 2024 17:23:24 GMT restart history: Sun, 24 Mar 2024 12:10:07 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=0x2 addr=0x88 pc=0x104d52510]

goroutine 1601705 [running]:
golang.org/x/tools/internal/imports.(*ProcessEnv).ClearModuleInfo(0x140001a5dd0)
      mod.go:318  0x60
golang.org/x/tools/gopls/internal/cache.(*importsState).runProcessEnvFunc(0x14000390f50, {0x1055a06e8%3F, 0x14004127530%3F}, 0x1401b459b00, 0x14021768de8)
      imports.go:164  0x22c
golang.org/x/tools/gopls/internal/cache.(*Snapshot).RunProcessEnvFunc(...)
      view.go:439
golang.org/x/tools/gopls/internal/golang.allImportsFixes({0x1055a06e8%3F, 0x14004127410%3F}, 0x1401b459b00, 0x14015316c40)
      format.go:118  0xc8
golang.org/x/tools/gopls/internal/golang.CodeActions({0x1055a06e8, 0x14004127410}, 0x1401b459b00, {0x1055a19c0, 0x140108ce600}, {{0x1b459b00%3F, 0x140%3F}, {0x5c3cac0%3F, 0x1%3F}}, {0x105c3cac0, ...}, ...)
      codeaction.go:44  0x194
golang.org/x/tools/gopls/internal/server.(*server).CodeAction(0x140002c6000, {0x1055a0720%3F, 0x1400736a550%3F}, 0x14000341650)
      code_action.go:117  0x4f0
golang.org/x/tools/gopls/internal/protocol.serverDispatch({0x1055a0720, 0x1400736a550}, {0x1055b9c20, 0x140002c6000}, 0x14004127350, {0x1055a08e0, 0x14008f07c00})
      tsserver.go:256  0x1dc8
golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.ServerHandler.func3({0x1055a0720, 0x1400736a550}, 0x14004127350, {0x1055a08e0, 0x14008f07c00})
      protocol.go:160  0x74
golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.handshaker.func4({0x1055a0720, 0x1400736a550}, 0x14004127350, {0x1055a08e0, 0x14008f07c00})
      lsprpc.go:509  0x6e0
golang.org/x/tools/gopls/internal/protocol.Handlers.MustReplyHandler.func1({0x1055a0720, 0x1400736a550}, 0x14000c3c1e0, {0x1055a08e0, 0x14008f07c00})
      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 72
      handler.go:100  0x19c
gopls stats -anon { "DirStats": { "Files": 4940, "TestdataFiles": 148, "GoFiles": 469, "ModFiles": 1, "Dirs": 444 }, "GOARCH": "arm64", "GOOS": "darwin", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.22.0", "GoplsVersion": "v0.15.2", "InitialWorkspaceLoadDuration": "1.722216458s", "MemStats": { "HeapAlloc": 104009192, "HeapInUse": 155770880, "TotalAlloc": 1121839760 }, "WorkspaceStats": { "Files": { "Total": 1892, "Largest": 901652, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.22.2", "AllPackages": { "Packages": 470, "LargestPackage": 155, "CompiledGoFiles": 1996, "Modules": 18 }, "WorkspacePackages": { "Packages": 176, "LargestPackage": 23, "CompiledGoFiles": 394, "Modules": 1 }, "Diagnostics": 0 } ] } }
OPTIONAL: If you would like to share more information, you can attach your complete gopls logs. NOTE: THESE MAY CONTAIN SENSITIVE INFORMATION ABOUT YOUR CODEBASE. DO NOT SHARE LOGS IF YOU ARE WORKING IN A PRIVATE REPOSITORY.
findleyr commented 5 months ago

Duplicate of golang/go#66490. We're working on a gopls@v0.15.3 release with a fix.