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/http2: data race in Server #13089

Closed
bmizerany opened this issue Oct 28, 2015 · 2 comments
Closed

x/net/http2: data race in Server #13089

bmizerany opened this issue Oct 28, 2015 · 2 comments

Comments

@bmizerany
Copy link
Contributor

@bmizerany bmizerany commented Oct 28, 2015

Running tests with -race consistent yields:

$ go test -race
==================
WARNING: DATA RACE
Read by goroutine 64:
  golang.org/x/net/http2.(*writeScheduler).take()
      /Users/bmizerany/src/golang.org/x/net/http2/writesched.go:123 +0x3af
  golang.org/x/net/http2.(*serverConn).scheduleFrameWrite()
      /Users/bmizerany/src/golang.org/x/net/http2/server.go:916 +0x3ab
  golang.org/x/net/http2.(*serverConn).writeFrame()
      /Users/bmizerany/src/golang.org/x/net/http2/server.go:802 +0xa2
  golang.org/x/net/http2.(*serverConn).serve()
      /Users/bmizerany/src/golang.org/x/net/http2/server.go:674 +0xb90
  golang.org/x/net/http2.(*Server).handleConn()
      /Users/bmizerany/src/golang.org/x/net/http2/server.go:282 +0xf93
  golang.org/x/net/http2.ConfigureServer.func1()
      /Users/bmizerany/src/golang.org/x/net/http2/server.go:193 +0xc4
  net/http.(*conn).serve()
      /usr/local/go/src/net/http/server.go:1312 +0x9ce

Previous write by goroutine 15:
  golang.org/x/net/http2.(*responseWriterState).writeChunk()
      /Users/bmizerany/src/golang.org/x/net/http2/server.go:1770 +0x4f4
  golang.org/x/net/http2.(*responseWriter).Flush()
      /Users/bmizerany/src/golang.org/x/net/http2/server.go:1793 +0x140
  golang.org/x/net/http2.(*responseWriter).handlerDone()
      /Users/bmizerany/src/golang.org/x/net/http2/server.go:1893 +0xc6
  golang.org/x/net/http2.(*serverConn).runHandler()
      /Users/bmizerany/src/golang.org/x/net/http2/server.go:1526 +0x94

Goroutine 64 (running) created at:
  net/http.(*Server).Serve()
      /usr/local/go/src/net/http/server.go:1910 +0x464

Goroutine 15 (finished) created at:
  golang.org/x/net/http2.(*serverConn).processHeaderBlockFragment()
      /Users/bmizerany/src/golang.org/x/net/http2/server.go:1384 +0x6ad
  golang.org/x/net/http2.(*serverConn).processHeaders()
      /Users/bmizerany/src/golang.org/x/net/http2/server.go:1328 +0x83a
  golang.org/x/net/http2.(*serverConn).processFrame()
      /Users/bmizerany/src/golang.org/x/net/http2/server.go:1048 +0x718
  golang.org/x/net/http2.(*serverConn).processFrameFromReader()
      /Users/bmizerany/src/golang.org/x/net/http2/server.go:998 +0xb96
  golang.org/x/net/http2.(*serverConn).serve()
      /Users/bmizerany/src/golang.org/x/net/http2/server.go:678 +0xd15
  golang.org/x/net/http2.(*Server).handleConn()
      /Users/bmizerany/src/golang.org/x/net/http2/server.go:282 +0xf93
  golang.org/x/net/http2.ConfigureServer.func1()
      /Users/bmizerany/src/golang.org/x/net/http2/server.go:193 +0xc4
  net/http.(*conn).serve()
      /usr/local/go/src/net/http/server.go:1312 +0x9ce
==================
PASS
Found 1 data race(s)
exit status 66
FAIL    golang.org/x/net/http2  10.220s
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Oct 29, 2015

CL https://golang.org/cl/16465 mentions this issue.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Oct 29, 2015

CL https://golang.org/cl/16490 mentions this issue.

@dvyukov dvyukov added the RaceReport label Oct 30, 2015
@golang golang locked and limited conversation to collaborators Nov 4, 2016
c3mb0 pushed a commit to c3mb0/net that referenced this issue Apr 2, 2018
Kill off that field and simplify the code. Also update some docs.

Thanks to Totoro W for the diagnosis in https://golang.org/cl/16465

Sadly this race was never detected due to golang/go#13097

Fixes golang/go#13089

Change-Id: Ia5400ea6733c7824e872affc3c6720bd436911fe
Reviewed-on: https://go-review.googlesource.com/16490
Reviewed-by: Blake Mizerany <blake.mizerany@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.