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, x/tools/internal/lsp/source: data race in internal/lsp/cache.(*View).populateProcessEnv() #39865

Closed
findleyr opened this issue Jun 25, 2020 · 1 comment

Comments

@findleyr
Copy link
Contributor

@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 removed this from the Unreleased milestone Jul 2, 2020
@stamblerre stamblerre added this to the gopls/v0.5.0 milestone Jul 2, 2020
@dmitshur dmitshur changed the title x/tools/gopls: data race in internal/lsp/cache.(*View).populateProcessEnv() x/tools/gopls, x/tools/internal/lsp/source: data race in internal/lsp/cache.(*View).populateProcessEnv() Jul 6, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Jul 7, 2020

Change https://golang.org/cl/241317 mentions this issue: internal/lsp/cache: fix race in RunProcessEnvFunc

@gopherbot gopherbot closed this in 065b96d Jul 7, 2020
@stamblerre stamblerre removed this from the gopls/v0.5.0 milestone Jul 9, 2020
@stamblerre stamblerre added this to the gopls/v0.4.4 milestone Jul 9, 2020
@golang golang locked and limited conversation to collaborators Jul 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants