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
pkg/net/rpc$ gotest under ThreadSanitizer
(http://code.google.com/p/data-race-test/wiki/ThreadSanitizerGo) outputs the following
error:
WARNING: Possible data race during write of size 1 at 0xf8400010d0: {{{
T2 (L{}):
#0 net/rpc..input ~/go/src/pkg/net/rpc/client.go:132
#1 runtime.goexit ~/go/src/pkg/runtime/proc.c:266
Concurrent read(s) happened at (OR AFTER) these points:
T1 (L{}):
#0 net/rpc..Call ~/go/src/pkg/net/rpc/client.go:286
#1 net/rpc.TestClientWriteError ~/go/src/pkg/net/rpc/server_test.go:487
#2 testing.tRunner ~/go/src/pkg/testing/testing.go:254
#3 runtime.goexit ~/go/src/pkg/runtime/proc.c:266
Location 0xf8400010d0 is 48 bytes inside a block starting at 0xf8400010a0 of size 80 allocated by T1 from heap:
#0 net/rpc..Go ~/go/src/pkg/net/rpc/client.go:255
#1 net/rpc..Call ~/go/src/pkg/net/rpc/client.go:285
#2 net/rpc.TestClientWriteError ~/go/src/pkg/net/rpc/server_test.go:487
#3 testing.tRunner ~/go/src/pkg/testing/testing.go:254
#4 runtime.goexit ~/go/src/pkg/runtime/proc.c:266
}}}
The root issue is that both send() and input() may set Call.Error and send to Call.Done.
This leads to 2 serious problems. First, there is a read-write data race (that the tool
reports) on Call.Error, since it's an interface the race can lead to arbitrary memory
corruptions and crashes. Second, if a user reuses Done channel, it will be totally
confused by two notifications about completion of a single Call.
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: