Skip to content

x/tools/gopls: panic during internal/cache.(*analysisNode).typeCheck (crash) #67595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bakhankov opened this issue May 22, 2024 · 2 comments
Closed
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@bakhankov
Copy link

bakhankov commented May 22, 2024

gopls version: v0.15.3/go1.21.6
gopls flags:
update flags: proxy
extension version: 0.41.4
environment: Visual Studio Code linux
initialization error: undefined
issue timestamp: Wed, 22 May 2024 10:06:06 GMT
restart history:
Wed, 22 May 2024 10:05:56 GMT: activation (enabled: true)

gopls stopped on VSCode start

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

goroutine 12560 [running]:
golang.org/x/tools/gopls/internal/cache.(*analysisNode).typeCheck(0xc002cfe840, {0xc005d8d140, 0x8, 0x8})
	  analysis.go:1078  0xaf3
golang.org/x/tools/gopls/internal/cache.(*analysisNode).run(0xc002cfe840, {0x124c7e8%3F, 0xc00576f350})
	  analysis.go:826  0x206
golang.org/x/tools/gopls/internal/cache.(*analysisNode).runCached(0xc002cfe840, {0x124c7e8%3F, 0xc00576f350})
	  analysis.go:687  0x12d
golang.org/x/tools/gopls/internal/cache.(*Snapshot).Analyze.func6.1()
	  analysis.go:397  0xc9
golang.org/x/sync/errgroup.(*Group).Go.func1()
	  errgroup.go:78  0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 12559
	  errgroup.go:75  0x96
gopls stats -anon { "DirStats": { "Files": 9626, "TestdataFiles": 12, "GoFiles": 5599, "ModFiles": 2, "Dirs": 1498 }, "GOARCH": "amd64", "GOOS": "linux", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.21.6", "GoplsVersion": "v0.15.3", "InitialWorkspaceLoadDuration": "1.240260707s", "MemStats": { "HeapAlloc": 148121704, "HeapInUse": 229654528, "TotalAlloc": 1659043360 }, "WorkspaceStats": { "Files": { "Total": 5500, "Largest": 1654451, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.21.6", "AllPackages": { "Packages": 1073, "LargestPackage": 200, "CompiledGoFiles": 5805, "Modules": 137 }, "WorkspacePackages": { "Packages": 244, "LargestPackage": 200, "CompiledGoFiles": 1101, "Modules": 1 }, "Diagnostics": 28 } ] } }
(go env: {GOOS:linux GOARCH:amd64 GOCACHE:/home/***/.cache/go-build GOMODCACHE:/home/***/go/pkg/mod GOPATH:/home/***/go GOPRIVATE:https://gitlab.***.dev/lib/go GOFLAGS: GO111MODULE: GoVersion:21 GoVersionOutput:go version go1.21.6 linux/amd64
 GOWORK: GOPACKAGESDRIVER:})
(env overlay: map[])


[Info  - 12:06:05 PM] 2024/05/22 12:06:05 go/packages.Load golang/vscode-go#1
	snapshot=0
	directory=file:///home/***/projects/***
	query=[/home/***/projects/***/... builtin]
	packages=310

[Info  - 12:06:05 PM] 2024/05/22 12:06:05 go/packages.Load golang/vscode-go#1: updating metadata for 1073 packages

[Error - 12:06:05 PM] Request textDocument/semanticTokens/range failed.
  Message: semantictokens are disabled
  Code: 0 
[Error - 12:06:05 PM] Request textDocument/semanticTokens/full failed.
  Message: semantictokens are disabled
  Code: 0 
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa67e73]

goroutine 12560 [running]:
golang.org/x/tools/gopls/internal/cache.(*analysisNode).typeCheck(0xc002cfe840, {0xc005d8d140, 0x8, 0x8})
	/home/***/go/pkg/mod/golang.org/x/tools/[email protected]/internal/cache/analysis.go:1078 +0xaf3
golang.org/x/tools/gopls/internal/cache.(*analysisNode).run(0xc002cfe840, {0x124c7e8?, 0xc00576f350})
	/home/***/go/pkg/mod/golang.org/x/tools/[email protected]/internal/cache/analysis.go:826 +0x206
golang.org/x/tools/gopls/internal/cache.(*analysisNode).runCached(0xc002cfe840, {0x124c7e8?, 0xc00576f350})
	/home/***/go/pkg/mod/golang.org/x/tools/[email protected]/internal/cache/analysis.go:687 +0x12d
golang.org/x/tools/gopls/internal/cache.(*Snapshot).Analyze.func6.1()
	/home/***/go/pkg/mod/golang.org/x/tools/[email protected]/internal/cache/analysis.go:397 +0xc9
golang.org/x/sync/errgroup.(*Group).Go.func1()
	/home/***/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:78 +0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 12559
	/home/***/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x96
[Error - 12:06:06 PM] 
@hyangah
Copy link
Contributor

hyangah commented May 23, 2024

@bakhankov Thanks for the report!
Is this crash reproducible? In other words, "Go: Restart Go Language Server" or reloading the window doesn't fix the issue?

Transferring to the gopls issue tracker for investigation.

https://github.com/golang/tools/blob/429c9f0c2c0d52afd4862e9734511a94fea841b7/gopls/internal/cache/analysis.go#L1078

@hyangah hyangah changed the title gopls: automated issue report (crash) x/tools/gopls: panic during internal/cache.(*analysisNode).typeCheck (crash) May 23, 2024
@hyangah hyangah transferred this issue from golang/vscode-go May 23, 2024
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels May 23, 2024
@gopherbot gopherbot added this to the Unreleased milestone May 23, 2024
@hyangah
Copy link
Contributor

hyangah commented May 23, 2024

Duplicate of #64227

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants