You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried making a go program that has two routines runnig that writes to and read from a variable . The writes and read were protected by locks ,but since locks does not guarantee order of execution data race could happen . The race detector is not detecting that
There's no race on l (i.e. two or more threads accessing l concurrently, at least one on write); the fact that the order of execution of the goroutines is not guaranteed is not a data race.
ALTree
changed the title
data race detector not detecting data race when mutex is used
runtime/race: race detector not detecting data race when mutex is used
Jan 15, 2017
This is not a data race, this is a high-level logical race. The race detector detects only data races.
Most logical races are intentional and it is not possible to distinguish between intentional and harmful unintentional races.
WAI
What version of Go are you using (
go version
)?go version go1.6.4 linux/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/sarath/go"
GORACE=""
GOROOT="/home/sarath/goroot"
GOTOOLDIR="/home/sarath/goroot/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
What did you do?
I tried making a go program that has two routines runnig that writes to and read from a variable . The writes and read were protected by locks ,but since locks does not guarantee order of execution data race could happen . The race detector is not detecting that
Here is play link : https://play.golang.org/p/MGpRIkE2-L
What did you expect to see?
Data race error stack
What did you see instead?
No data race detected though it occured
The text was updated successfully, but these errors were encountered: