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 accessing flags #33392

Closed
jayconrod opened this issue Jul 31, 2019 · 2 comments
Closed

x/tools/gopls: data race accessing flags #33392

jayconrod opened this issue Jul 31, 2019 · 2 comments
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. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@jayconrod
Copy link
Contributor

Log 1: https://storage.googleapis.com/go-build-log/fe8a8664/linux-amd64-race_e77173df.log

==================
WARNING: DATA RACE
Read at 0x00c0001055e0 by goroutine 111:
  golang.org/x/tools/internal/lsp/cmd.(*cmdClient).LogMessage()
      /workdir/gopath/src/golang.org/x/tools/internal/lsp/cmd/cmd.go:252 +0x373
  golang.org/x/tools/internal/lsp/protocol.clientHandler.Deliver()
      /workdir/gopath/src/golang.org/x/tools/internal/lsp/protocol/tsclient.go:55 +0xab9
  golang.org/x/tools/internal/lsp/protocol.(*clientHandler).Deliver()
      :1 +0x94
  golang.org/x/tools/internal/jsonrpc2.(*Conn).Run.func1()
      /workdir/gopath/src/golang.org/x/tools/internal/jsonrpc2/jsonrpc2.go:370 +0x1c5

Previous write at 0x00c0001055e0 by goroutine 39:
golang.org/x/tools/internal/tool.addFlags()
/workdir/go/src/flag/flag.go:112 +0x8ca
golang.org/x/tools/internal/tool.addFlags()
/workdir/gopath/src/golang.org/x/tools/internal/tool/tool.go:167 +0xb14
golang.org/x/tools/internal/tool.Main()
/workdir/gopath/src/golang.org/x/tools/internal/tool/tool.go:89 +0x204
golang.org/x/tools/internal/lsp/cmd_test.(*runner).Diagnostics.func1()
/workdir/gopath/src/golang.org/x/tools/internal/lsp/cmd/check_test.go:25 +0xc6
golang.org/x/tools/internal/lsp/cmd_test.captureStdOut()
/workdir/gopath/src/golang.org/x/tools/internal/lsp/cmd/cmd_test.go:92 +0x1b6
golang.org/x/tools/internal/lsp/cmd_test.(*runner).Diagnostics()
/workdir/gopath/src/golang.org/x/tools/internal/lsp/cmd/check_test.go:24 +0x28e
golang.org/x/tools/internal/lsp/tests.Run.func2()
/workdir/gopath/src/golang.org/x/tools/internal/lsp/tests/tests.go:276 +0x19e
testing.tRunner()
/workdir/go/src/testing/testing.go:909 +0x199

Goroutine 111 (running) created at:
golang.org/x/tools/internal/jsonrpc2.(*Conn).Run()
/workdir/gopath/src/golang.org/x/tools/internal/jsonrpc2/jsonrpc2.go:354 +0x7f3

Goroutine 39 (running) created at:
testing.(*T).Run()
/workdir/go/src/testing/testing.go:960 +0x651
golang.org/x/tools/internal/lsp/tests.Run()
/workdir/gopath/src/golang.org/x/tools/internal/lsp/tests/tests.go:267 +0x1fb
golang.org/x/tools/internal/lsp/cmd_test.testCommandLine()
/workdir/gopath/src/golang.org/x/tools/internal/lsp/cmd/cmd_test.go:45 +0x319
golang.org/x/tools/go/packages/packagestest.TestAll.func1()
/workdir/gopath/src/golang.org/x/tools/go/packages/packagestest/export.go:101 +0x91
testing.tRunner()
/workdir/go/src/testing/testing.go:909 +0x199

Log 2: https://build.golang.org/log/fc6af8558a1f11307b1dd3113a1a7c5e744e451a

==================
WARNING: DATA RACE
Read at 0x00c000119ae0 by goroutine 241:
  golang.org/x/tools/internal/lsp/cmd.(*cmdClient).LogMessage()
      /workdir/gopath/src/golang.org/x/tools/internal/lsp/cmd/cmd.go:252 +0x373
  golang.org/x/tools/internal/lsp/protocol.clientHandler.Deliver()
      /workdir/gopath/src/golang.org/x/tools/internal/lsp/protocol/tsclient.go:55 +0xaba
  golang.org/x/tools/internal/lsp/protocol.(*clientHandler).Deliver()
      :1 +0x94
  golang.org/x/tools/internal/jsonrpc2.(*Conn).Run.func1()
      /workdir/gopath/src/golang.org/x/tools/internal/jsonrpc2/jsonrpc2.go:370 +0x18b

Previous write at 0x00c000119ae0 by goroutine 35:
golang.org/x/tools/internal/tool.addFlags()
/workdir/go/src/flag/flag.go:112 +0x8dc
golang.org/x/tools/internal/tool.addFlags()
/workdir/gopath/src/golang.org/x/tools/internal/tool/tool.go:167 +0xb28
golang.org/x/tools/internal/tool.Main()
/workdir/gopath/src/golang.org/x/tools/internal/tool/tool.go:89 +0x205
golang.org/x/tools/internal/lsp/cmd_test.(*runner).Diagnostics.func1()
/workdir/gopath/src/golang.org/x/tools/internal/lsp/cmd/check_test.go:25 +0xc6
golang.org/x/tools/internal/lsp/cmd_test.captureStdOut()
/workdir/gopath/src/golang.org/x/tools/internal/lsp/cmd/cmd_test.go:92 +0x194
golang.org/x/tools/internal/lsp/cmd_test.(*runner).Diagnostics()
/workdir/gopath/src/golang.org/x/tools/internal/lsp/cmd/check_test.go:24 +0x28f
golang.org/x/tools/internal/lsp/tests.Run.func2()
/workdir/gopath/src/golang.org/x/tools/internal/lsp/tests/tests.go:276 +0x19e
testing.tRunner()
/workdir/go/src/testing/testing.go:865 +0x163

Goroutine 241 (running) created at:
golang.org/x/tools/internal/jsonrpc2.(*Conn).Run()
/workdir/gopath/src/golang.org/x/tools/internal/jsonrpc2/jsonrpc2.go:354 +0x876

Goroutine 35 (running) created at:
testing.(*T).Run()
/workdir/go/src/testing/testing.go:916 +0x65a
golang.org/x/tools/internal/lsp/tests.Run()
/workdir/gopath/src/golang.org/x/tools/internal/lsp/tests/tests.go:267 +0x1fb
golang.org/x/tools/internal/lsp/cmd_test.testCommandLine()
/workdir/gopath/src/golang.org/x/tools/internal/lsp/cmd/cmd_test.go:45 +0x2d4
golang.org/x/tools/go/packages/packagestest.TestAll.func1()
/workdir/gopath/src/golang.org/x/tools/go/packages/packagestest/export.go:101 +0x91
testing.tRunner()
/workdir/go/src/testing/testing.go:865 +0x163

cc @stamblerre

@jayconrod jayconrod added the Testing An issue that has been verified to require only test changes, not just a test failure. label Jul 31, 2019
@jayconrod jayconrod added this to the Unreleased milestone Jul 31, 2019
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Jul 31, 2019
@stamblerre
Copy link
Contributor

I think that this is related to @ianthehat's changes to the internal/jsonrpc2 package, so he will likely have more insight when he's back in the office.

@stamblerre stamblerre added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 31, 2019
@stamblerre stamblerre changed the title x/tools/internal/lsp: data race accessing flags x/tools/gopls: data race accessing flags Jul 31, 2019
@gopherbot
Copy link

Change https://golang.org/cl/189944 mentions this issue: internal/lsp: fix data race in cmd tests

@golang golang locked and limited conversation to collaborators Aug 12, 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. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

3 participants