Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/cmd/cover, cmd/go: -race -covermode count #12513

Closed
powerman opened this issue Sep 5, 2015 · 1 comment
Closed

x/tools/cmd/cover, cmd/go: -race -covermode count #12513

powerman opened this issue Sep 5, 2015 · 1 comment

Comments

@powerman
Copy link

powerman commented Sep 5, 2015

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:

$ cd /usr/lib/go/src/net/rpc
$ go test -v -race -covermode count
...
==================
WARNING: DATA RACE
Read by main goroutine:
  sync/atomic.LoadInt32()
      /usr/lib/go/src/runtime/race_amd64.s:185 +0xc
  testing.coverReport()
      /usr/lib/go/src/testing/cover.go:94 +0x59e
  testing.after()
      /usr/lib/go/src/testing/testing.go:643 +0x9f2
  testing.(*M).Run()
      /usr/lib/go/src/testing/testing.go:495 +0x28a
  main.main()
      net/rpc/_test/_testmain.go:132 +0x381

Previous write by goroutine 73:
  net/rpc.(*gobServerCodec).ReadRequestHeader()
      net/rpc/_test/_obj_test/server.go:460 +0x72
  net/rpc.(*Server).readRequestHeader()
      net/rpc/_test/_obj_test/server.go:686 +0xee
  net/rpc.(*Server).readRequest()
      net/rpc/_test/_obj_test/server.go:642 +0xf3
  net/rpc.(*Server).ServeCodec()
      net/rpc/_test/_obj_test/server.go:534 +0x105
  net/rpc.(*Server).ServeConn()
      net/rpc/_test/_obj_test/server.go:524 +0x2ba
  net/rpc.(*Server).ServeHTTP()
      net/rpc/_test/_obj_test/server.go:824 +0x62f
  net/http.(*ServeMux).ServeHTTP()
      /usr/lib/go/src/net/http/server.go:1541 +0x20c
  net/http/httptest.(*waitGroupHandler).ServeHTTP()
      /usr/lib/go/src/net/http/httptest/server.go:200 +0xf7
  net/http.serverHandler.ServeHTTP()
      /usr/lib/go/src/net/http/server.go:1703 +0x1f6
  net/http.(*conn).serve()
      /usr/lib/go/src/net/http/server.go:1204 +0x1087

Goroutine 73 (running) created at:
  net/http.(*Server).Serve()
      /usr/lib/go/src/net/http/server.go:1751 +0x3cd
==================
coverage: 77.5% of statements
ok      net/rpc 0.106s

Also, 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?

powerman added a commit to powerman/rpc-codec that referenced this issue Sep 5, 2015
@minux
Copy link
Member

minux commented Sep 7, 2015 via email

@minux minux closed this as completed Sep 7, 2015
mattn added a commit to mattn/goveralls that referenced this issue Sep 7, 2015
@golang golang locked and limited conversation to collaborators Sep 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants