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: HTTP/2 SETTINGS frame being read incorrectly #37059

Closed
x04 opened this issue Feb 5, 2020 · 5 comments
Closed

net/http: HTTP/2 SETTINGS frame being read incorrectly #37059

x04 opened this issue Feb 5, 2020 · 5 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@x04
Copy link

x04 commented Feb 5, 2020

What version of Go are you using (go version)?

$ go version
go version go1.14beta1 windows/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\\AppData\Local\go-build
set GOENV=C:\Users\\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS= -mod=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\\go
set GOPRIVATE=
set GOPROXY=direct
set GOROOT=C:\Users\\go\go1.14beta1
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Users\\go\go1.14beta1\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\\go\go1.14beta1\src\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\\AppData\Local\Temp\go-build787882606=/tmp/go-build -gno-record-gcc-switches

What did you do?

I outputted all HTTP/2 frames that are received by the net/http server corresponding to their type, and when looking at the SETTINGS frames the first settings ID always appears to be wrong.

For example, the first setting from Chrome is 0x1 or SETTINGS_HEADER_TABLE_SIZE, but the ID outputted by when looping through the settings in the frame is 239 when the expected value is 1.

Another example would be when I used Go's http.Client and the first setting is always 0x2 or SETTINGS_ENABLE_PUSH, but the outputted value 16384 when the expected value is 2.

What did you expect to see?

(Read above for explanation on what I'm talking about)
Expected first setting ID from latest Chrome: 1, SETTINGS_HEADER_TABLE_SIZE
Expected first setting ID from Go's http client: 2, SETTINGS_ENABLE_PUSH

What did you see instead?

(Read above for explanation on what I'm talking about)
"Received" first setting ID from latest Chrome: 239
"Received" first setting ID from Go's http client: 16384

@x04 x04 changed the title HTTP/2 net/http: HTTP/2 SETTINGS frame being read incorrectly Feb 5, 2020
@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 7, 2020
@dmitshur
Copy link
Contributor

dmitshur commented Feb 7, 2020

@x04 Do you know if this happens with Go 1.13 or 1.12 too?

/cc @bradfitz per owners.

@networkimprov
Copy link

cc @fraenkel re http2

@fraenkel
Copy link
Contributor

fraenkel commented Feb 8, 2020

@x04 is there a reproducer? Can you run with http2debug so we can see what is being processed?

@bradfitz
Copy link
Contributor

bradfitz commented Feb 8, 2020

I don't understand the bug report.

Let's see some code and GODEBUG=http2debug=2 log output first as @fraenkel suggested.

@bradfitz bradfitz added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Feb 8, 2020
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Mar 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

6 participants