-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Open
Labels
Milestone
Description
What steps will reproduce the problem?
write a program that synchronizes due to calls to Sendmsg and Recvmsg
build and test with -race
What do you see instead?
a race is detected
Which compiler are you using (5g, 6g, 8g, gccgo)?
6g
Which operating system are you using?
linux
Which version are you using? (run 'go version')
tip
Please provide any additional information below.
Dmitry helped me debug this. Recvmsg needs:
if rsa.Addr.Family != AF_UNSPEC {
from, err = anyToSockaddr(&rsa)
}
+ if raceenabled && err == nil {
+ raceAcquire(unsafe.Pointer(&ioSync))
+ }
Sendmsg needs:
msg.Iov = &iov
msg.Iovlen = 1
+ if raceenabled {
+ raceReleaseMerge(unsafe.Pointer(&ioSync))
+ }
Dmitry suggested that this is for after Go 1.1. Since it's a small fix, it would be nice
to do it before, but we can wait.AlekSi