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

Open
x04 opened this issue Feb 5, 2020 · 4 comments
Open

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

x04 opened this issue Feb 5, 2020 · 4 comments

Comments

@x04
Copy link

@x04 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

This comment has been minimized.

Copy link
Member

@dmitshur 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

This comment has been minimized.

Copy link

@networkimprov networkimprov commented Feb 7, 2020

cc @fraenkel re http2

@fraenkel

This comment has been minimized.

Copy link
Contributor

@fraenkel fraenkel commented Feb 8, 2020

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

@bradfitz

This comment has been minimized.

Copy link
Contributor

@bradfitz 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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