-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime/race: false positive with go + defer #42599
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
FWIW, a few observations I've made:
cc @nixprime |
Replacing
Also makes the race disappear. |
What I see in most cases is that the race address is initially the first
Later, GC frees it:
Then it is allocated as another
One possibility that I haven't been able to verify yet is that the defer is not keeping cc @mknyszek |
In support of this hypothesis: I tried replacing:
with:
And indeed:
I haven't reproduced this panic without -race yet; I'm not sure if this is because the bug is specific to the race detector, or if turning it off simply changes timings by enough to cause it to fail to reproduce. |
I think you're right that it seems a liveness bug.
|
Change https://golang.org/cl/270079 mentions this issue: |
Change https://golang.org/cl/270397 mentions this issue: |
This reports a race when run with the race detector. I don't think it should.
This fails at tip, go1.14 and go1.15. Not a release blocker.
The text was updated successfully, but these errors were encountered: