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

net/http: test race on linux/amd64 trybot #17868

Closed
cespare opened this issue Nov 9, 2016 · 7 comments
Closed

net/http: test race on linux/amd64 trybot #17868

cespare opened this issue Nov 9, 2016 · 7 comments
Milestone

Comments

@cespare
Copy link
Contributor

cespare commented Nov 9, 2016

I see a race on the linux-amd64-race trybot running over some unrelated code (CL 32923):

https://storage.googleapis.com/go-build-log/17537d3e/linux-amd64-race_d3fd3644.log

I see that there are some recent test-flake-related commits in net/http but I cannot reproduce the race locally within a few test -race runs so I don't know whether it's fixed or not.

==================
WARNING: DATA RACE
Write at 0x00c420c44080 by goroutine 426:
  net/http.(*http2serverConn).newWriterAndRequestNoBody()
      /tmp/workdir/go/src/net/http/h2_bundle.go:4479 +0xaa4
  net/http.(*http2serverConn).newWriterAndRequest()
      /tmp/workdir/go/src/net/http/h2_bundle.go:4382 +0x4cc
  net/http.(*http2serverConn).processHeaders()
      /tmp/workdir/go/src/net/http/h2_bundle.go:4240 +0x4ac
  net/http.(*http2serverConn).processFrame()
      /tmp/workdir/go/src/net/http/h2_bundle.go:3930 +0x4d9
  net/http.(*http2serverConn).processFrameFromReader()
      /tmp/workdir/go/src/net/http/h2_bundle.go:3889 +0x8af
  net/http.(*http2serverConn).serve()
      /tmp/workdir/go/src/net/http/h2_bundle.go:3527 +0xacf
  net/http.(*http2Server).ServeConn()
      /tmp/workdir/go/src/net/http/h2_bundle.go:3166 +0xc82
  net/http.http2ConfigureServer.func1()
      /tmp/workdir/go/src/net/http/h2_bundle.go:3048 +0xe7
  net/http.(*conn).serve()
      /tmp/workdir/go/src/net/http/server.go:1709 +0x1952

Previous read at 0x00c420c44080 by goroutine 355:
  [failed to restore the stack]

Goroutine 426 (running) created at:
  net/http.(*Server).Serve()
      /tmp/workdir/go/src/net/http/server.go:2608 +0x35f
  net/http/httptest.(*Server).goServe.func1()
      /tmp/workdir/go/src/net/http/httptest/server.go:236 +0xa2

Goroutine 355 (finished) created at:
  net/http.(*http2responseWriter).CloseNotify()
      /tmp/workdir/go/src/net/http/h2_bundle.go:4932 +0x129
  net/http_test.testTransportAndServerSharedBodyRace.func2()
      /tmp/workdir/go/src/net/http/serve_test.go:3362 +0x93
  net/http.HandlerFunc.ServeHTTP()
      /tmp/workdir/go/src/net/http/server.go:1895 +0x51
  net/http.serverHandler.ServeHTTP()
      /tmp/workdir/go/src/net/http/server.go:2508 +0xbc
  net/http.initNPNRequest.ServeHTTP()
      /tmp/workdir/go/src/net/http/server.go:3028 +0x109
  net/http.(*initNPNRequest).ServeHTTP()
      <autogenerated>:318 +0x98
  net/http.(Handler).ServeHTTP-fm()
      /tmp/workdir/go/src/net/http/h2_bundle.go:4251 +0x64
  net/http.(*http2serverConn).runHandler()
      /tmp/workdir/go/src/net/http/h2_bundle.go:4529 +0x96
==================
@cespare
Copy link
Contributor Author

cespare commented Nov 9, 2016

/cc @bradfitz

@bradfitz
Copy link
Contributor

bradfitz commented Nov 9, 2016

Previous read at 0x00c420c44080 by goroutine 355:
  [failed to restore the stack]

Well, that's frickin' useless.

/cc @dvyukov @ianlancetaylor

@dvyukov
Copy link
Member

dvyukov commented Nov 9, 2016

$ GORACE="atexit_sleep_ms=0 history_size=7" stress -failure="DATA RACE" -p 16 ./http.test -test.short

gives full report in a minute:

1 second passes in backend, proxygone= false
1 second passes in backend, proxygone= false
==================
WARNING: DATA RACE
Write at 0x00c4206a9100 by goroutine 304:
  net/http.(*http2serverConn).newWriterAndRequestNoBody()
      /home/dvyukov/src/go/src/net/http/h2_bundle.go:4479 +0xaa4
  net/http.(*http2serverConn).newWriterAndRequest()
      /home/dvyukov/src/go/src/net/http/h2_bundle.go:4382 +0x4cc
  net/http.(*http2serverConn).processHeaders()
      /home/dvyukov/src/go/src/net/http/h2_bundle.go:4240 +0x4ac
  net/http.(*http2serverConn).processFrame()
      /home/dvyukov/src/go/src/net/http/h2_bundle.go:3930 +0x4d9
  net/http.(*http2serverConn).processFrameFromReader()
      /home/dvyukov/src/go/src/net/http/h2_bundle.go:3889 +0x8af
  net/http.(*http2serverConn).serve()
      /home/dvyukov/src/go/src/net/http/h2_bundle.go:3527 +0xacf
  net/http.(*http2Server).ServeConn()
      /home/dvyukov/src/go/src/net/http/h2_bundle.go:3166 +0xc82
  net/http.http2ConfigureServer.func1()
      /home/dvyukov/src/go/src/net/http/h2_bundle.go:3048 +0xe7
  net/http.(*conn).serve()
      /home/dvyukov/src/go/src/net/http/server.go:1709 +0x1952

Previous read at 0x00c4206a9100 by goroutine 218:
  net/http.(*http2responseWriter).CloseNotify.func1()
      /home/dvyukov/src/go/src/net/http/h2_bundle.go:4930 +0x3f

Goroutine 304 (running) created at:
  net/http.(*Server).Serve()
      /home/dvyukov/src/go/src/net/http/server.go:2608 +0x35f
  net/http/httptest.(*Server).goServe.func1()
      /home/dvyukov/src/go/src/net/http/httptest/server.go:236 +0xa2

Goroutine 218 (finished) created at:
  net/http.(*http2responseWriter).CloseNotify()
      /home/dvyukov/src/go/src/net/http/h2_bundle.go:4932 +0x129
  net/http_test.testTransportAndServerSharedBodyRace.func2()
      /home/dvyukov/src/go/src/net/http/serve_test.go:3362 +0x93
  net/http.HandlerFunc.ServeHTTP()
      /home/dvyukov/src/go/src/net/http/server.go:1895 +0x51
  net/http.serverHandler.ServeHTTP()
      /home/dvyukov/src/go/src/net/http/server.go:2508 +0xbc
  net/http.initNPNRequest.ServeHTTP()
      /home/dvyukov/src/go/src/net/http/server.go:3028 +0x109
  net/http.(*initNPNRequest).ServeHTTP()
      <autogenerated>:318 +0x98
  net/http.(Handler).ServeHTTP-fm()
      /home/dvyukov/src/go/src/net/http/h2_bundle.go:4251 +0x64
  net/http.(*http2serverConn).runHandler()
      /home/dvyukov/src/go/src/net/http/h2_bundle.go:4529 +0x96

@bradfitz bradfitz self-assigned this Nov 9, 2016
@bradfitz bradfitz added this to the Go1.8 milestone Nov 9, 2016
@bradfitz
Copy link
Contributor

bradfitz commented Nov 9, 2016

https://go-review.googlesource.com/33013

@gopherbot
Copy link

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

@FZambia
Copy link

FZambia commented Jan 29, 2017

@bradfitz hello, just came across panic that most probably caused by this issue. I am a bit lost - why data race fix like this have not been included into go1.7.5? Should we use golang.org/x/net/http2 to avoid waiting for next Go stable release to get fixes inside HTTP/2?

@bradfitz
Copy link
Contributor

You can wait two days for Go 1.8 final.

@golang golang locked and limited conversation to collaborators Jan 29, 2018
c3mb0 pushed a commit to c3mb0/net that referenced this issue Apr 2, 2018
Fixes golang/go#17868

Change-Id: I7f9d85f404198d68757d7ca5bb8b1e7aafaafa8b
Reviewed-on: https://go-review.googlesource.com/33013
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
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