-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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: instrument Sendmsg/Recvmsg and Flock #5363
Comments
Owner changed to @dvyukov. Status changed to Accepted. |
FTR, here is the change: https://golang.org/cl/8819050/ You can fix the false positive for now, by explicitly synchronizing the state inside of the process. I.e. on send: 1. touch the call context 2. put the call context into a map under the mutex 3. send call id on receive: 1. recv call id 2. find the call context in the map under the mutex 3. touch the call context this way the call context is synchronized with the map mutex. Labels changed: added racedetector. |
Sometimes I find that I was too quick making conclusions, and the race detector actually says me completely different thing. Read the report carefully, understand what exactly variable is involved in the race, what is the order or memory access (the first access in the report happened last) and what are involved goroutines. |
Another case that come up is synchronization via syscall.Flock. It's effectively a mutex, so treating it as synchronization in race detector looks reasonable. |
@randall77 would the work that you did in CL 205461 aka commit golang/net@2180aed#diff-d1efad72dc5b17dc66a46767c32fff40 be similar to what would solve this issue? Thanks and happy new year! |
The text was updated successfully, but these errors were encountered: