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
runtime/race: false negative on fmt.Fprintf #6790
Labels
Comments
The problem is in the fmt package internal synchronized cache. When the goroutines are executes sequentially one-by-one, the cache's mutex looks exactly as if it synchronizes accesses to the buf. If I increase number of goroutines to 1000 and runt with GOMAXPROCS=16, then the race is detected -- some goroutines happen to run concurrently in the racy section of code. sync.Pool would help here, because it may expose less synchronization to the race detector. Another counter-measure can be to introduce more random preemption when running under race detector. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: