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

Comments

@jayconrod
Copy link
Contributor

@jayconrod jayconrod commented Jul 31, 2019

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 label Jul 31, 2019
@jayconrod jayconrod added this to the Unreleased milestone Jul 31, 2019
@gopherbot gopherbot added the gopls label Jul 31, 2019
@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Jul 31, 2019

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 changed the title x/tools/internal/lsp: data race accessing flags x/tools/gopls: data race accessing flags Jul 31, 2019
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Aug 13, 2019

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

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.