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: type checking deadlock #32638

Closed
muirdm opened this issue Jun 16, 2019 · 1 comment
Closed

x/tools/gopls: type checking deadlock #32638

muirdm opened this issue Jun 16, 2019 · 1 comment
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls.
Milestone

Comments

@muirdm
Copy link

muirdm commented Jun 16, 2019

I managed to hit a type checking deadlock. All goroutines involved were waiting on <-e.ready in getPkg in lsp/cache/check.go, which suggests some sort of impossible circular dependency. In the debugger I found the below getPkg call chains from each goroutine:

go/build <- golang.org/x/tools/go/analysis/passes/asmdecl
go/doc <- go/build <- golang.org/x/tools/imports
encoding/json <- golang.org/x/tools/go/packages
net/url <- crypto/x509 <- crypto/tls <- net/http/httptrace <- net/http <- encoding/json <- golang.org/x/tools/internal/span
encoding/json <- net/url <- text/template <- go/doc

It is a deadlock, but the encoding/json <- net/url edge jumped out as not quite right until I noticed that "net/url" imports "encoding/json" in its test. So, due to the package variant issue, we are hitting circular dependencies. In particular, in this case when "text/template" imports "net/url", we ended up importing the test variant of "net/url" that also has an import for "encoding/json".

Once the variant issue is resolved so that importer.Import only ever imports the non-test variant, this issue should be resolved as well.

/cc @stamblerre @ianthehat

@gopherbot gopherbot added this to the Unreleased milestone Jun 16, 2019
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Jun 16, 2019
@stamblerre
Copy link
Contributor

This should be resolved as of https://golang.org/cl/183628. Closing.

@golang golang locked and limited conversation to collaborators Jun 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls.
Projects
None yet
Development

No branches or pull requests

3 participants