-
Notifications
You must be signed in to change notification settings - Fork 18k
go/types: race condition due to lazy initialization of universeError #47345
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
@mdempsky thanks for that repro! This is because we lazily write the interface type set. We should eagerly add an empty type set for interfaces in the universe. |
Change https://golang.org/cl/336910 mentions this issue: |
…ces in the universe As of CL 334894, type sets are lazily evaluated on interfaces. For the universe interfaces error and comparable, this can lead to data races when type checking concurrently. Fix this by computing their type set when they are defined. Tested using the repro from #47345. I considered checking this in as a test, but it probably wouldn't add much value going forward. Fixes #47345 Change-Id: I014a511b8e3c092c86201a8bfc7f5f494f8f20e8 Reviewed-on: https://go-review.googlesource.com/c/go/+/336910 Trust: Robert Findley <[email protected]> Run-TryBot: Robert Findley <[email protected]> Reviewed-by: Robert Griesemer <[email protected]>
It seems that gopherbot did not find the 'fixes' line on the previous CL, because it was not the first mention of this issue? In any case, closing as fixed. |
FWIW, gopherbot did, but GitHub won't close issues via commits until those commits are merged back to the main branch of the repo (so for |
@zikaeroh that makes sense, thanks for the explanation! |
This program triggers a race condition in go/types on dev.typeparams since 24f9eb2:
/cc @findleyr @griesemer
The text was updated successfully, but these errors were encountered: