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

go/types: data race in validType #35049

Closed
bcmills opened this issue Oct 21, 2019 · 2 comments
Closed

go/types: data race in validType #35049

bcmills opened this issue Oct 21, 2019 · 2 comments

Comments

@bcmills
Copy link
Member

@bcmills bcmills commented Oct 21, 2019

From https://storage.googleapis.com/go-build-log/03978a97/linux-amd64-race_5ad45efa.log.

The read and write are at the same locations reported in #34921 (comment) — apparently CL 201838 fixed only one of the two races.

==================
WARNING: DATA RACE
Read at 0x00c000f559f0 by goroutine 95:
  go/types.(*Checker).validType()
      /workdir/go/src/go/types/decl.go:320 +0x48c
  go/types.(*Checker).validType()
      /workdir/go/src/go/types/decl.go:301 +0x249
  go/types.(*Checker).validType()
      /workdir/go/src/go/types/decl.go:323 +0x826
  go/types.(*Checker).validType()
      /workdir/go/src/go/types/decl.go:301 +0x249
  go/types.(*Checker).validType()
      /workdir/go/src/go/types/decl.go:323 +0x826
  go/types.(*Checker).typeDecl.func1()
      /workdir/go/src/go/types/decl.go:536 +0x8f
  go/types.(*Checker).processDelayed()
      /workdir/go/src/go/types/check.go:281 +0x5a
  go/types.(*Checker).checkFiles()
      /workdir/go/src/go/types/check.go:257 +0xf1
  go/types.(*Checker).Files()
      /workdir/go/src/go/types/check.go:246 +0xd3c
  golang.org/x/tools/go/packages.(*loader).loadPackage()
      /workdir/gopath/src/golang.org/x/tools/go/packages/packages.go:835 +0x9e1
  golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
      /workdir/gopath/src/golang.org/x/tools/go/packages/packages.go:685 +0x258
  sync.(*Once).doSlow()
      /workdir/go/src/sync/once.go:66 +0x100
  sync.(*Once).Do()
      /workdir/go/src/sync/once.go:57 +0x68
  golang.org/x/tools/go/packages.(*loader).loadRecursive()
      /workdir/gopath/src/golang.org/x/tools/go/packages/packages.go:673 +0x74
  golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1()
      /workdir/gopath/src/golang.org/x/tools/go/packages/packages.go:680 +0x42

Previous write at 0x00c000f559f0 by goroutine 215:
  go/types.(*Checker).validType()
      /workdir/go/src/go/types/decl.go:322 +0x708
  go/types.(*Checker).validType()
      /workdir/go/src/go/types/decl.go:301 +0x249
  go/types.(*Checker).validType()
      /workdir/go/src/go/types/decl.go:323 +0x826
  go/types.(*Checker).typeDecl.func1()
      /workdir/go/src/go/types/decl.go:536 +0x8f
  go/types.(*Checker).processDelayed()
      /workdir/go/src/go/types/check.go:281 +0x5a
  go/types.(*Checker).checkFiles()
      /workdir/go/src/go/types/check.go:257 +0xf1
  go/types.(*Checker).Files()
      /workdir/go/src/go/types/check.go:246 +0xd3c
  golang.org/x/tools/go/packages.(*loader).loadPackage()
      /workdir/gopath/src/golang.org/x/tools/go/packages/packages.go:835 +0x9e1
  golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
      /workdir/gopath/src/golang.org/x/tools/go/packages/packages.go:685 +0x258
  sync.(*Once).doSlow()
      /workdir/go/src/sync/once.go:66 +0x100
  sync.(*Once).Do()
      /workdir/go/src/sync/once.go:57 +0x68
  golang.org/x/tools/go/packages.(*loader).loadRecursive()
      /workdir/gopath/src/golang.org/x/tools/go/packages/packages.go:673 +0x74
  golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1()
      /workdir/gopath/src/golang.org/x/tools/go/packages/packages.go:680 +0x42

Goroutine 95 (running) created at:
  golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
      /workdir/gopath/src/golang.org/x/tools/go/packages/packages.go:679 +0x218
  sync.(*Once).doSlow()
      /workdir/go/src/sync/once.go:66 +0x100
  sync.(*Once).Do()
      /workdir/go/src/sync/once.go:57 +0x68
  golang.org/x/tools/go/packages.(*loader).loadRecursive()
      /workdir/gopath/src/golang.org/x/tools/go/packages/packages.go:673 +0x74
  golang.org/x/tools/go/packages.(*loader).refine.func2()
      /workdir/gopath/src/golang.org/x/tools/go/packages/packages.go:619 +0x42

Goroutine 215 (finished) created at:
  golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
      /workdir/gopath/src/golang.org/x/tools/go/packages/packages.go:679 +0x218
  sync.(*Once).doSlow()
      /workdir/go/src/sync/once.go:66 +0x100
  sync.(*Once).Do()
      /workdir/go/src/sync/once.go:57 +0x68
  golang.org/x/tools/go/packages.(*loader).loadRecursive()
      /workdir/gopath/src/golang.org/x/tools/go/packages/packages.go:673 +0x74
  golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1()
      /workdir/gopath/src/golang.org/x/tools/go/packages/packages.go:680 +0x42
==================
--- FAIL: TestIssue32814 (5.63s)
    --- FAIL: TestIssue32814/GOPATH (3.73s)
        testing.go:853: race detected during execution of test
    testing.go:853: race detected during execution of test
FAIL
FAIL	golang.org/x/tools/go/packages	101.552s

This is currently blocking #31749.

@griesemer
Copy link
Contributor

@griesemer griesemer commented Oct 21, 2019

Yes, looks like the same problem I had fixed in underlying() - just missed this one. On it.

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Oct 21, 2019

Change https://golang.org/cl/202483 mentions this issue: go/types: don't update package-external types when checking validity

Loading

@gopherbot gopherbot closed this in 51504f0 Oct 22, 2019
@golang golang locked and limited conversation to collaborators Oct 21, 2020
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