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 x/tools -race builders #44434

Closed
findleyr opened this issue Feb 19, 2021 · 2 comments
Closed

go/types: data race in x/tools -race builders #44434

findleyr opened this issue Feb 19, 2021 · 2 comments

Comments

@findleyr
Copy link
Contributor

Following the dev.typeparams merge, we're getting failures in the -race builders on the x/tools repo.

Example failure:
https://build.golang.org/log/0dadc226267fa2479b9ae1d5e5f8c567ccfb565a

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/294411 mentions this issue: go/types: don't write during sanitizeInfo if nothing has changed

gopherbot pushed a commit that referenced this issue Feb 19, 2021
In its final phase, the typechecker walks the types it produces to
ensure that no unexpanded type instances leak through the API. However,
this also walks shared types (such as those in the universe scope),
resulting in a potential data race during concurrent typechecking
passes.

Fix this by being careful not to write if nothing needs to be changed.
Since any shared types should already be sanitized, this should
eliminate data races.

For #44434

Change-Id: Iadb2e78863efe0e974e69a00e255f26cfaf9386a
Reviewed-on: https://go-review.googlesource.com/c/go/+/294411
Trust: Robert Findley <rfindley@google.com>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
@findleyr
Copy link
Contributor Author

The builders are now passing with the above CL.

@golang golang locked and limited conversation to collaborators Feb 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants