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: data race in golang.org/x/tools/gopls/internal/hooks.updateAnalyzers #36872

Closed
bcmills opened this issue Jan 29, 2020 · 1 comment
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Soon This needs to be done soon. (regressions, serious bugs, outages) Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Jan 29, 2020

There appears to be a highly reproducible data race in golang.org/x/tools/gopls/internal/hooks.updateAnalyzers.

I'm not sure when it was introduced, but it has been present since at least January 17. It reproduces on the master Go branch, so seems to be distinct from #36687 / #36605, but the regression may have gone unnoticed because folks assumed the failure was due to that known issue.

==================
WARNING: DATA RACE
Write at 0x00c0001ce168 by goroutine 3336:
  golang.org/x/tools/gopls/internal/hooks.updateAnalyzers()
      /tmp/workdir/gopath/src/golang.org/x/tools/gopls/internal/hooks/analysis.go:27 +0x598
  golang.org/x/tools/gopls/internal/hooks.Options()
      /tmp/workdir/gopath/src/golang.org/x/tools/gopls/internal/hooks/hooks.go:20 +0x9e
  golang.org/x/tools/gopls/test_test.commandLineOptions()
      /tmp/workdir/gopath/src/golang.org/x/tools/gopls/test/gopls_test.go:31 +0x72
  golang.org/x/tools/internal/lsp/cmd.(*connection).initialize()
      /tmp/workdir/gopath/src/golang.org/x/tools/internal/lsp/cmd/cmd.go:241 +0x47d
  golang.org/x/tools/internal/lsp/cmd.(*Application).connect()
      /tmp/workdir/gopath/src/golang.org/x/tools/internal/lsp/cmd/cmd.go:214 +0xfd6
  golang.org/x/tools/internal/lsp/cmd.(*check).Run()
      /tmp/workdir/gopath/src/golang.org/x/tools/internal/lsp/cmd/check.go:45 +0xf5
  golang.org/x/tools/internal/tool.Run()
      /tmp/workdir/gopath/src/golang.org/x/tools/internal/tool/tool.go:152 +0x304
  golang.org/x/tools/internal/lsp/cmd.(*Application).Run()
      /tmp/workdir/gopath/src/golang.org/x/tools/internal/lsp/cmd/cmd.go:144 +0x3f5
  golang.org/x/tools/internal/tool.Run()
      /tmp/workdir/gopath/src/golang.org/x/tools/internal/tool/tool.go:152 +0x304
  golang.org/x/tools/internal/lsp/cmd/test.(*runner).RunGoplsCmd()
      /tmp/workdir/gopath/src/golang.org/x/tools/internal/lsp/cmd/test/cmdtest.go:124 +0x611
  golang.org/x/tools/internal/lsp/cmd/test.(*runner).Diagnostics()
      /tmp/workdir/gopath/src/golang.org/x/tools/internal/lsp/cmd/test/check.go:25 +0x1d0
  golang.org/x/tools/internal/lsp/tests.Run.func9.1()
      /tmp/workdir/gopath/src/golang.org/x/tools/internal/lsp/tests/tests.go:421 +0xff
  testing.tRunner()
      /tmp/workdir/go/src/testing/testing.go:909 +0x199

Previous read at 0x00c0001ce168 by goroutine 911:
  golang.org/x/tools/internal/lsp/source.analyses()
      /tmp/workdir/gopath/src/golang.org/x/tools/internal/lsp/source/diagnostics.go:183 +0x174
  golang.org/x/tools/internal/lsp/source.Diagnostics()
      /tmp/workdir/gopath/src/golang.org/x/tools/internal/lsp/source/diagnostics.go:91 +0x739
  golang.org/x/tools/internal/lsp.(*Server).diagnose.func1.1()
      /tmp/workdir/gopath/src/golang.org/x/tools/internal/lsp/diagnostics.go:58 +0x1cb

Goroutine 3336 (running) created at:
  testing.(*T).Run()
      /tmp/workdir/go/src/testing/testing.go:960 +0x651
  golang.org/x/tools/internal/lsp/tests.Run.func9()
      /tmp/workdir/gopath/src/golang.org/x/tools/internal/lsp/tests/tests.go:419 +0x150
  testing.tRunner()
      /tmp/workdir/go/src/testing/testing.go:909 +0x199

Goroutine 911 (finished) created at:
  golang.org/x/tools/internal/lsp.(*Server).diagnose.func1()
      /tmp/workdir/gopath/src/golang.org/x/tools/internal/lsp/diagnostics.go:50 +0x180
==================

https://build.golang.org/log/f7db3764074af31a34e7d962ee2823f33b0f900d
https://build.golang.org/log/7b6daf671d11414e7fbc350bc2b72e29979b1df9
https://build.golang.org/log/3069a09330d09d029376218be5c0f3b6183d0de4
https://build.golang.org/log/96fc4ff5af399f1e2a524746a8347f097a0d23dd
https://build.golang.org/log/4b14b2f9f4ef18c9873b10ee20ab45f00ebb43ac

@bcmills bcmills added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Soon This needs to be done soon. (regressions, serious bugs, outages) labels Jan 29, 2020
@bcmills bcmills added this to the gopls/v0.3.0 milestone Jan 29, 2020
@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 Jan 29, 2020
@bcmills
Copy link
Contributor Author

bcmills commented Jan 29, 2020

Duplicate of #36699

@bcmills bcmills marked this as a duplicate of #36699 Jan 29, 2020
@bcmills bcmills closed this as completed Jan 29, 2020
@golang golang locked and limited conversation to collaborators Jan 28, 2021
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. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Soon This needs to be done soon. (regressions, serious bugs, outages) Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

2 participants