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've added instrumentation to syscall.Sendfile(), so that it synchronizes with
syscall.Read(), but race builder still shows a race.
It's either another bug in race detector, or bug in the test.
What is strange is that race detector detector says that fd.close() happened before
Sendfile() according to wall clock time. It means that something really weird happens in
the test.
http://build.golang.org/log/bf2017abd5123b784f65272a7cc3eb8f1ccf3e13
WARNING: DATA RACE
Read by goroutine 142:
net.sendFile()
/usr/local/go/src/pkg/net/sendfile_linux.go:47 +0x5da
net.(*TCPConn).ReadFrom()
/usr/local/go/src/pkg/net/tcpsock_posix.go:80 +0x49
net/http.(*response).ReadFrom()
/usr/local/go/src/pkg/net/http/server.go:161 +0x11c
io.CopyN()
/usr/local/go/src/pkg/io/io.go:305 +0x1a0
net/http.serveContent()
/usr/local/go/src/pkg/net/http/fs.go:236 +0xaa0
net/http.ServeContent()
/usr/local/go/src/pkg/net/http/fs.go:118 +0x184
net/http_test.func·024()
/usr/local/go/src/pkg/net/http/fs_test.go:551 +0x19f
??()
-:0 +0x401038a1
net/http/httptest.(*waitGroupHandler).ServeHTTP()
/usr/local/go/src/pkg/net/http/httptest/server.go:180 +0xcb
net/http.(*conn).serve()
/usr/local/go/src/pkg/net/http/server.go:681 +0x7a7
Previous write by goroutine 15:
os.(*file).close()
/usr/local/go/src/pkg/os/file_unix.go:110 +0x15e
os.(*File).Close()
/usr/local/go/src/pkg/os/file_unix.go:99 +0x43
net/http_test.TestServeContent()
/usr/local/go/src/pkg/net/http/fs_test.go:626 +0x1710
testing.tRunner()
/usr/local/go/src/pkg/testing/testing.go:301 +0x8f
Goroutine 142 (running) created at:
net/http.(*Server).Serve()
/usr/local/go/src/pkg/net/http/server.go:1116 +0x45e
Goroutine 15 (running) created at:
testing.RunTests()
/usr/local/go/src/pkg/testing/testing.go:377 +0xa8b
testing.Main()
/usr/local/go/src/pkg/testing/testing.go:313 +0xcd
main.main()
net/http/_test/_testmain.go:301 +0xda
runtime.main()
/usr/local/go/src/pkg/runtime/proc.c:248 +0x91
The text was updated successfully, but these errors were encountered:
I can reproduce it locally in 1 of 50 runs. It still says that close() happens before
sendfile(), so it's not that detector misses some synchronization.
Does anybody see how it can happen?
It looks that DefaultClient.Do(req) does not wait for sendfile...
The text was updated successfully, but these errors were encountered: