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 due to lazy interface completion #47726

Closed
findleyr opened this issue Aug 16, 2021 · 6 comments
Closed

go/types: data race due to lazy interface completion #47726

findleyr opened this issue Aug 16, 2021 · 6 comments
Assignees
Milestone

Comments

@findleyr
Copy link
Contributor

@findleyr findleyr commented Aug 16, 2021

Sample failure:

https://build.golang.org/log/66aed38eb7030ee6db09e17179d26ce42d59b316

Lazy interface completion causes data races in x/tools. We need to either make interface completion concurrency-safe, or ensure that all interfaces that escape the Checker have been completed.

CC @griesemer

@findleyr findleyr added this to the Go1.18 milestone Aug 16, 2021
@griesemer
Copy link
Contributor

@griesemer griesemer commented Aug 16, 2021

Is this because Interface.Complete is not doing anything anymore? That is, would it be sufficient to revert that change? Or is it a bigger problem?

Loading

@findleyr
Copy link
Contributor Author

@findleyr findleyr commented Aug 16, 2021

Is this because Interface.Complete is not doing anything anymore? That is, would it be sufficient to revert that change? Or is it a bigger problem?

Necessary but not sufficient. Here's a failure at the dev.typeparams merge:
https://build.golang.org/log/53e6ff359c770b04ed89035e59f2038b3d87268e

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Aug 16, 2021

Change https://golang.org/cl/342710 mentions this issue: Revert "go/types: make Interface.Complete a no-op"

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Aug 17, 2021

Change https://golang.org/cl/342749 mentions this issue: go/types: check if the interface is already complete in Complete

Loading

gopherbot pushed a commit that referenced this issue Aug 17, 2021
This reverts commit fda8ee8.

Reason for revert: Interface.Complete is still necessary for safe concurrency.

For #47726

Change-Id: I8b924ca5f4af8c7d7e2b5a27bb03a5a5ed9b1d22
Reviewed-on: https://go-review.googlesource.com/c/go/+/342710
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
gopherbot pushed a commit that referenced this issue Aug 17, 2021
Once Interfaces have been completed they must never be written again,
as they may be used concurrently.

Avoid writing Interface.complete unnecessarily in Complete. Also, update
documentation to reflect that Complete must be called before the
Interface may be considered safe for concurrent use.

For #47726

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

@findleyr findleyr commented Aug 17, 2021

I believe this is fixed now, but I'll leave it open for visibility in case there are any additional flakes in the race builders.

Will close tomorrow if no additional failures.

Loading

@findleyr
Copy link
Contributor Author

@findleyr findleyr commented Aug 17, 2021

Closing as the build dashboard looks clean.

Loading

@findleyr findleyr closed this Aug 17, 2021
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