Skip to content
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

x/tools/gopls: panic in internal/lsp/cache.typeCheckBatch.importMap #61512

Closed
danp opened this issue Jul 21, 2023 · 3 comments
Closed

x/tools/gopls: panic in internal/lsp/cache.typeCheckBatch.importMap #61512

danp opened this issue Jul 21, 2023 · 3 comments
Assignees
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

@danp
Copy link
Contributor

danp commented Jul 21, 2023

Using golang/tools@7ba5690. Have had gopls crashes occasionally since I pulled tools tip over the last few days but haven't been able to track them down. After turning debug things on I had a crash and got this:

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

goroutine 2316805 [running]:
golang.org/x/tools/gopls/internal/lsp/cache.(*typeCheckBatch).importMap.func1(0x1035260a0?)
	/Users/dan/go/src/golang.org/x/tools/gopls/internal/lsp/cache/check.go:706 +0x98
golang.org/x/tools/gopls/internal/lsp/cache.(*typeCheckBatch).importMap(0x1401fa584b0, {0x14012acebd0, 0x2b})
	/Users/dan/go/src/golang.org/x/tools/gopls/internal/lsp/cache/check.go:715 +0x8c
golang.org/x/tools/gopls/internal/lsp/cache.(*typeCheckBatch).importPackage(0x1401fa584b0, {0x103644868, 0x14020345c20}, 0x1400786cfc0, {0x14034872c80, 0xc3, 0x140})
	/Users/dan/go/src/golang.org/x/tools/gopls/internal/lsp/cache/check.go:541 +0x150
golang.org/x/tools/gopls/internal/lsp/cache.(*typeCheckBatch).getImportPackage(0x1401fa584b0, {0x103644868, 0x14020345c20}, {0x14012acebd0, 0x2b})
	/Users/dan/go/src/golang.org/x/tools/gopls/internal/lsp/cache/check.go:473 +0x5d8
golang.org/x/tools/gopls/internal/lsp/cache.(*snapshot).forEachPackageInternal.func1()
	/Users/dan/go/src/golang.org/x/tools/gopls/internal/lsp/cache/check.go:395 +0x30
golang.org/x/sync/errgroup.(*Group).Go.func1()
	/Users/dan/Library/Caches/go-mod/golang.org/x/sync@v0.3.0/errgroup/errgroup.go:75 +0x58
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 2315848
	/Users/dan/Library/Caches/go-mod/golang.org/x/sync@v0.3.0/errgroup/errgroup.go:72 +0x98

Seems to be triggered when I change branches but not always.

@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 Jul 21, 2023
@gopherbot gopherbot added this to the Unreleased milestone Jul 21, 2023
@danp
Copy link
Contributor Author

danp commented Jul 21, 2023

Possibly related to golang/tools@ffc82f3?

@findleyr findleyr self-assigned this Jul 24, 2023
@findleyr findleyr modified the milestones: Unreleased, gopls/v0.12.5 Jul 24, 2023
@findleyr
Copy link
Contributor

Thanks very much for the report!

@gopherbot
Copy link

Change https://go.dev/cl/513095 mentions this issue: gopls/internal/lsp/cache: use correct metadata in resolveImportGraph

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