-
Notifications
You must be signed in to change notification settings - Fork 18k
go/types: data race to imported object.color #69912
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
Comments
Found new dashboard test flakes for:
2024-10-16 13:52 x_tools-go1.23-linux-amd64-longtest-race tools@7310c72f release-branch.go1.23@6495ce04 x/tools/gopls/internal/test/integration/workspace.TestStdWorkspace/default (log)
|
This looks like a real data race in the the way gopls invokes the type checker. @findleyr |
Yep. I'll fix. |
While we haven't reproduced, it looks like this is a real (and longstanding) data race in go/types:
Note that in order for this race to be exercised, there must be two distinct packages type checked concurrently that dot-import the same third package, which is imported from export data. That may explain why we haven't seen this race in the past. There are multiple potential fixes:
I think we should make both fixes. In the meantime, I'm not sure whether we can reasonably work around this in gopls. I'll try to put together a minimal repro. |
Change https://go.dev/cl/621637 mentions this issue: |
Change https://go.dev/cl/621855 mentions this issue: |
Work around golang/go#69912 by punching a hole through the TypeName type to mark it black after importing. This is an unfortunate workaround, but the fix for the long-standing data race is probably not worth back-porting. For golang/go#69912 Change-Id: I583305f6e893e28b881dab932c9c4825430bc4ad Reviewed-on: https://go-review.googlesource.com/c/tools/+/621855 Reviewed-by: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Change https://go.dev/cl/622319 mentions this issue: |
Although the workaround in CL 621855 was effective for gopls, which uses go1.23, the x/tools builders using go1.22 are still bumping into this data race. This change applies the same workaround to go1.22; the data type has not changed. Fixes golang/go#69912 Fixed golang/go#70015 Change-Id: I9f12f8815a0b089a188b9d02aec9d07eb30a496a Reviewed-on: https://go-review.googlesource.com/c/tools/+/622319 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Findley <rfindley@google.com>
Found new dashboard test flakes for:
2024-11-04 16:34 x_tools-go1.22-linux-386-longtest tools@109c5fcc release-branch.go1.22@c19e5887 x/tools/gopls/internal/test/integration/workspace.TestStdWorkspace/default (log)
2024-11-04 16:34 x_tools-go1.22-linux-amd64-longtest tools@109c5fcc release-branch.go1.22@c19e5887 x/tools/gopls/internal/test/integration/workspace.TestStdWorkspace/default (log)
2024-11-04 16:34 x_tools-go1.22-linux-amd64-longtest-race tools@109c5fcc release-branch.go1.22@c19e5887 x/tools/gopls/internal/test/integration/workspace.TestStdWorkspace/default (log)
2024-11-04 16:34 x_tools-go1.22-linux-arm64-longtest tools@109c5fcc release-branch.go1.22@c19e5887 x/tools/gopls/internal/test/integration/workspace.TestStdWorkspace/default (log)
2024-11-04 18:00 x_tools-go1.22-linux-386-longtest tools@f4878ba1 release-branch.go1.22@c19e5887 x/tools/gopls/internal/test/integration/workspace.TestStdWorkspace/default (log)
2024-11-04 18:00 x_tools-go1.22-linux-amd64-longtest tools@f4878ba1 release-branch.go1.22@c19e5887 x/tools/gopls/internal/test/integration/workspace.TestStdWorkspace/default (log)
2024-11-04 18:00 x_tools-go1.22-linux-amd64-longtest-race tools@f4878ba1 release-branch.go1.22@c19e5887 x/tools/gopls/internal/test/integration/workspace.TestStdWorkspace/default (log)
2024-11-04 18:00 x_tools-go1.22-linux-arm64-longtest tools@f4878ba1 release-branch.go1.22@c19e5887 x/tools/gopls/internal/test/integration/workspace.TestStdWorkspace/default (log)
2024-11-04 18:14 x_tools-go1.22-linux-386-longtest tools@cceaf96b release-branch.go1.22@c19e5887 x/tools/gopls/internal/test/integration/workspace.TestStdWorkspace/default (log)
|
Found new dashboard test flakes for:
2024-11-04 18:14 x_tools-go1.22-linux-amd64-longtest tools@cceaf96b release-branch.go1.22@c19e5887 x/tools/gopls/internal/test/integration/workspace.TestStdWorkspace/default (log)
2024-11-04 18:14 x_tools-go1.22-linux-amd64-longtest-race tools@cceaf96b release-branch.go1.22@c19e5887 x/tools/gopls/internal/test/integration/workspace.TestStdWorkspace/default (log)
2024-11-04 18:14 x_tools-go1.22-linux-arm64-longtest tools@cceaf96b release-branch.go1.22@c19e5887 x/tools/gopls/internal/test/integration/workspace.TestStdWorkspace/default (log)
2024-11-04 18:31 x_tools-go1.22-linux-386-longtest tools@ad28b931 release-branch.go1.22@c19e5887 x/tools/gopls/internal/test/integration/workspace.TestStdWorkspace/default (log)
2024-11-04 18:31 x_tools-go1.22-linux-amd64-longtest tools@ad28b931 release-branch.go1.22@c19e5887 x/tools/gopls/internal/test/integration/workspace.TestStdWorkspace/default (log)
2024-11-04 18:31 x_tools-go1.22-linux-amd64-longtest-race tools@ad28b931 release-branch.go1.22@c19e5887 x/tools/gopls/internal/test/integration/workspace.TestStdWorkspace/default (log)
2024-11-04 18:31 x_tools-go1.22-linux-arm64-longtest tools@ad28b931 release-branch.go1.22@c19e5887 x/tools/gopls/internal/test/integration/workspace.TestStdWorkspace/default (log)
2024-11-04 18:31 x_tools-go1.22-linux-386-longtest tools@f0379e07 release-branch.go1.22@c19e5887 x/tools/gopls/internal/test/integration/workspace.TestStdWorkspace/default (log)
2024-11-04 18:31 x_tools-go1.22-linux-amd64-longtest tools@f0379e07 release-branch.go1.22@c19e5887 x/tools/gopls/internal/test/integration/workspace.TestStdWorkspace/default (log)
|
This latest batch of flakes is unrelated to this issue (not a data race); I have refined the watchflakes predicate. I'll split them into a separate issue (#70187). |
|
Still fixed. |
Issue created automatically to collect these failures.
Example (log):
— watchflakes
The text was updated successfully, but these errors were encountered: