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/net/context/ctxhttp: data race reported by test #12990

Closed
Sajmani opened this issue Oct 19, 2015 · 3 comments
Closed

x/net/context/ctxhttp: data race reported by test #12990

Sajmani opened this issue Oct 19, 2015 · 3 comments

Comments

@Sajmani
Copy link
Contributor

Sajmani commented Oct 19, 2015

The ctxhttp test fails under the race detector:

% go test -race golang.org/x/net/context/ctxhttp
==================
WARNING: DATA RACE
Write by goroutine 14:
  sync.raceWrite()
      /usr/local/google/home/sameer/go/src/sync/race.go:41 +0x2e
  sync.(*WaitGroup).Wait()
      /usr/local/google/home/sameer/go/src/sync/waitgroup.go:124 +0xf9
  net/http/httptest.(*Server).Close()
      /usr/local/google/home/sameer/go/src/net/http/httptest/server.go:168 +0x80
  golang.org/x/net/context/ctxhttp.doRequest()
      /usr/local/google/home/sameer/gocode/src/golang.org/x/net/context/ctxhttp/ctxhttp_test.go:71 +0x129
  golang.org/x/net/context/ctxhttp.TestCancel()
      /usr/local/google/home/sameer/gocode/src/golang.org/x/net/context/ctxhttp/ctxhttp_test.go:37 +0x106
  testing.tRunner()
      /usr/local/google/home/sameer/go/src/testing/testing.go:456 +0xdc

Previous read by goroutine 20:
  sync.raceRead()
      /usr/local/google/home/sameer/go/src/sync/race.go:37 +0x2e
  sync.(*WaitGroup).Add()
      /usr/local/google/home/sameer/go/src/sync/waitgroup.go:66 +0xfa
  net/http/httptest.(*waitGroupHandler).ServeHTTP()
      /usr/local/google/home/sameer/go/src/net/http/httptest/server.go:198 +0x5c
  net/http.serverHandler.ServeHTTP()
      /usr/local/google/home/sameer/go/src/net/http/server.go:1816 +0x206
  net/http.(*conn).serve()
      /usr/local/google/home/sameer/go/src/net/http/server.go:1315 +0x117c

Goroutine 14 (running) created at:
  testing.RunTests()
      /usr/local/google/home/sameer/go/src/testing/testing.go:561 +0xaa3
  testing.(*M).Run()
      /usr/local/google/home/sameer/go/src/testing/testing.go:494 +0xe4
  main.main()
      golang.org/x/net/context/ctxhttp/_test/_testmain.go:58 +0x20f

Goroutine 20 (running) created at:
  net/http.(*Server).Serve()
      /usr/local/google/home/sameer/go/src/net/http/server.go:1864 +0x464
==================
PASS
Found 1 data race(s)
FAIL    golang.org/x/net/context/ctxhttp    1.339s
@Sajmani Sajmani assigned Sajmani and adg and unassigned Sajmani Oct 19, 2015
@bradfitz bradfitz changed the title ctxhttp: data race reported by test x/net/context/ctxhttp: data race reported by test Oct 19, 2015
@ianlancetaylor
Copy link
Contributor

I think this is related to #12789.

@bradfitz
Copy link
Contributor

Yeah, there are several dups open already.

@adg
Copy link
Contributor

adg commented Oct 20, 2015

@Sajmani I have nothing to do with this code, either.

@adg adg removed their assignment Oct 20, 2015
@golang golang locked and limited conversation to collaborators Oct 24, 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

5 participants