golang / vscode-go

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

gopls: automated issue report (crash) #3399

Closed Dmarcotrigiano closed 1 month ago

Dmarcotrigiano commented 1 month ago

gopls version: v0.15.3/go1.22.1 gopls flags: update flags: proxy extension version: 0.41.4 environment: Visual Studio Code darwin initialization error: undefined issue timestamp: Thu, 23 May 2024 11:09:19 GMT restart history: Thu, 23 May 2024 11:08:51 GMT: activation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

Working from a bus, on mobile hotspot (unsure if there are network requests). Program for a few seconds and gopls crashes. Reloaded VsCode, and the same events transpired.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x105410c5c]

goroutine 4422 [running]:
golang.org/x/tools/gopls/internal/cache.(*analysisNode).typeCheck(0x140008fa0b0, {0x14003a00180, 0xb, 0xb})
      analysis.go:1078  0x86c
golang.org/x/tools/gopls/internal/cache.(*analysisNode).run(0x140008fa0b0, {0x105bc09e8, 0x14002a1c630})
      analysis.go:826  0x174
golang.org/x/tools/gopls/internal/cache.(*analysisNode).runCached(0x140008fa0b0, {0x105bc09e8, 0x14002a1c630})
      analysis.go:687  0x100
golang.org/x/tools/gopls/internal/cache.(*Snapshot).Analyze.func6.1()
      analysis.go:397  0xa4
golang.org/x/sync/errgroup.(*Group).Go.func1()
      errgroup.go:78  0x58
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 4421
      errgroup.go:75  0x98
gopls stats -anon { "DirStats": { "Files": 101, "TestdataFiles": 0, "GoFiles": 41, "ModFiles": 1, "Dirs": 46 }, "GOARCH": "arm64", "GOOS": "darwin", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.22.1", "GoplsVersion": "v0.15.3", "InitialWorkspaceLoadDuration": "918.374542ms", "MemStats": { "HeapAlloc": 32386408, "HeapInUse": 53829632, "TotalAlloc": 402255440 }, "WorkspaceStats": { "Files": { "Total": 2040, "Largest": 395026, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.22.2", "AllPackages": { "Packages": 385, "LargestPackage": 155, "CompiledGoFiles": 2065, "Modules": 54 }, "WorkspacePackages": { "Packages": 15, "LargestPackage": 16, "CompiledGoFiles": 59, "Modules": 1 }, "Diagnostics": 982 } ] } }

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.

hyangah commented 1 month ago

Duplicate of golang/go#64227

Thanks for the report @Dmarcotrigiano !