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 internal/lsp/cache.(*View).populateProcessEnv() #39865

Open
findleyr opened this issue Jun 25, 2020 · 0 comments
Open
Labels
Milestone

Comments

@findleyr
Copy link

@findleyr findleyr commented Jun 25, 2020

See https://storage.googleapis.com/go-build-log/b1377469/linux-amd64-race_4dd4e316.log

WARNING: DATA RACE
Write at 0x00c001586210 by goroutine 41:
  golang.org/x/tools/internal/lsp/cache.(*View).populateProcessEnv()
      /workdir/gopath/src/golang.org/x/tools/internal/lsp/cache/view.go:477 +0x31d
  golang.org/x/tools/internal/lsp/cache.(*View).RunProcessEnvFunc()
      /workdir/gopath/src/golang.org/x/tools/internal/lsp/cache/view.go:393 +0x14e
  golang.org/x/tools/internal/lsp/source.(*completer).unimportedPackages()
      /workdir/gopath/src/golang.org/x/tools/internal/lsp/source/completion.go:1124 +0x16a1
  golang.org/x/tools/internal/lsp/source.(*completer).lexical()
      /workdir/gopath/src/golang.org/x/tools/internal/lsp/source/completion.go:1075 +0x106c
  golang.org/x/tools/internal/lsp/source.Completion()
      /workdir/gopath/src/golang.org/x/tools/internal/lsp/source/completion.go:586 +0x1a6f
  golang.org/x/tools/internal/lsp/source_test.(*runner).callCompletion()
      /workdir/gopath/src/golang.org/x/tools/internal/lsp/source/source_test.go:244 +0x77d
  golang.org/x/tools/internal/lsp/source_test.(*runner).RankCompletion()
      /workdir/gopath/src/golang.org/x/tools/internal/lsp/source/source_test.go:221 +0x38a
  golang.org/x/tools/internal/lsp/tests.Tests.RankCompletion-fm()
      /workdir/gopath/src/golang.org/x/tools/internal/lsp/tests/tests.go:126 +0x10d
  golang.org/x/tools/internal/lsp/tests.Run.func1.1()
      /workdir/gopath/src/golang.org/x/tools/internal/lsp/tests/tests.go:463 +0x243
  testing.tRunner()
      /workdir/go/src/testing/testing.go:1108 +0x202

Previous read at 0x00c001586210 by goroutine 1486:
  golang.org/x/tools/internal/imports.(*ProcessEnv).mustGetEnv()
      /workdir/gopath/src/golang.org/x/tools/internal/imports/fix.go:781 +0x44
  golang.org/x/tools/internal/imports.(*ProcessEnv).goroot()
      /workdir/gopath/src/golang.org/x/tools/internal/imports/fix.go:773 +0xb3
  golang.org/x/tools/internal/imports.(*ProcessEnv).buildContext()
      /workdir/gopath/src/golang.org/x/tools/internal/imports/fix.go:847 +0xe4
  golang.org/x/tools/internal/imports.(*gopathResolver).scan()
      /workdir/gopath/src/golang.org/x/tools/internal/imports/fix.go:1272 +0x258
  golang.org/x/tools/internal/imports.getCandidatePkgs()
      /workdir/gopath/src/golang.org/x/tools/internal/imports/fix.go:643 +0xaa6
  golang.org/x/tools/internal/imports.PrimeCache()
      /workdir/gopath/src/golang.org/x/tools/internal/imports/fix.go:667 +0x14a
  golang.org/x/tools/internal/lsp/cache.(*View).refreshProcessEnv()
      /workdir/gopath/src/golang.org/x/tools/internal/lsp/cache/view.go:450 +0x1be
  golang.org/x/tools/internal/lsp/cache.(*View).refreshProcessEnv-fm()
      /workdir/gopath/src/golang.org/x/tools/internal/lsp/cache/view.go:440 +0x44

CC @heschik

@gopherbot gopherbot added this to the Unreleased milestone Jun 25, 2020
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.5.0 Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.