{"action":"opened","issue":{"url":"https://api.github.com/repos/golang/go/issues/12513","labels_url":"https://api.github.com/repos/golang/go/issues/12513/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/12513/comments","events_url":"https://api.github.com/repos/golang/go/issues/12513/events","html_url":"https://github.com/golang/go/issues/12513","id":105019079,"number":12513,"title":"x/tools/cmd/cover, cmd/go: -race -covermode count","user":{"login":"powerman","id":1354301,"avatar_url":"https://avatars.githubusercontent.com/u/1354301?v=3","gravatar_id":"","url":"https://api.github.com/users/powerman","html_url":"https://github.com/powerman","followers_url":"https://api.github.com/users/powerman/followers","following_url":"https://api.github.com/users/powerman/following{/other_user}","gists_url":"https://api.github.com/users/powerman/gists{/gist_id}","starred_url":"https://api.github.com/users/powerman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/powerman/subscriptions","organizations_url":"https://api.github.com/users/powerman/orgs","repos_url":"https://api.github.com/users/powerman/repos","events_url":"https://api.github.com/users/powerman/events{/privacy}","received_events_url":"https://api.github.com/users/powerman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-05T10:27:30Z","updated_at":"2015-09-05T10:27:30Z","closed_at":null,"body":"This combination of options (used, for example, by https://github.com/mattn/goveralls -race) report a lot of DATA RACE on all go versions, even on some standard libraries (usually on the line with open/closing bracket). For example:\r\n```sh\r\n$ cd /usr/lib/go/src/net/rpc\r\n$ go test -v -race -covermode count\r\n...\r\n==================\r\nWARNING: DATA RACE\r\nRead by main goroutine:\r\n  sync/atomic.LoadInt32()\r\n      /usr/lib/go/src/runtime/race_amd64.s:185 +0xc\r\n  testing.coverReport()\r\n      /usr/lib/go/src/testing/cover.go:94 +0x59e\r\n  testing.after()\r\n      /usr/lib/go/src/testing/testing.go:643 +0x9f2\r\n  testing.(*M).Run()\r\n      /usr/lib/go/src/testing/testing.go:495 +0x28a\r\n  main.main()\r\n      net/rpc/_test/_testmain.go:132 +0x381\r\n\r\nPrevious write by goroutine 73:\r\n  net/rpc.(*gobServerCodec).ReadRequestHeader()\r\n      net/rpc/_test/_obj_test/server.go:460 +0x72\r\n  net/rpc.(*Server).readRequestHeader()\r\n      net/rpc/_test/_obj_test/server.go:686 +0xee\r\n  net/rpc.(*Server).readRequest()\r\n      net/rpc/_test/_obj_test/server.go:642 +0xf3\r\n  net/rpc.(*Server).ServeCodec()\r\n      net/rpc/_test/_obj_test/server.go:534 +0x105\r\n  net/rpc.(*Server).ServeConn()\r\n      net/rpc/_test/_obj_test/server.go:524 +0x2ba\r\n  net/rpc.(*Server).ServeHTTP()\r\n      net/rpc/_test/_obj_test/server.go:824 +0x62f\r\n  net/http.(*ServeMux).ServeHTTP()\r\n      /usr/lib/go/src/net/http/server.go:1541 +0x20c\r\n  net/http/httptest.(*waitGroupHandler).ServeHTTP()\r\n      /usr/lib/go/src/net/http/httptest/server.go:200 +0xf7\r\n  net/http.serverHandler.ServeHTTP()\r\n      /usr/lib/go/src/net/http/server.go:1703 +0x1f6\r\n  net/http.(*conn).serve()\r\n      /usr/lib/go/src/net/http/server.go:1204 +0x1087\r\n\r\nGoroutine 73 (running) created at:\r\n  net/http.(*Server).Serve()\r\n      /usr/lib/go/src/net/http/server.go:1751 +0x3cd\r\n==================\r\ncoverage: 77.5% of statements\r\nok  \tnet/rpc\t0.106s\r\n```\r\n\r\nAlso, according to travis reports, all Go versions except 1.4 exit from `go test` with non-zero status in this case while 1.4 exit with zero status, but that's probably should be another bug report?"}}