Skip to content

x/net/http2: id(*) < evictCount(*) panic #72940

@zkcrescent

Description

@zkcrescent

Go version

go1.23.3

Output of go env in your module/workspace:

GO111MODULE='on'
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/wangbailu/Library/Caches/go-build'
GOENV='/Users/wangbailu/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/wangbailu/go/pkg/mod'
GONOPROXY='gitlab.hypergryph.net'
GONOSUMDB='gitlab.hypergryph.net'
GOOS='darwin'
GOPATH='/Users/wangbailu/go'
GOPRIVATE='gitlab.hypergryph.net'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.23.3'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/wangbailu/Library/Application Support/go/telemetry'
GCCGO='gccgo'
GOARM64='v8.0'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/wangbailu/go/src/gitlab.hypergryph.net/web/golang/url-shortener/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/xv/_533xxcx35jf59f06099m5sdqd8mcg/T/go-build2936925539=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

panic: id (944) <= evictCount (946)

goroutine 2004 [running]:
vendor/[golang.org/x/net/http2/hpack.(*headerFieldTable).idToIndex](http://golang.org/x/net/http2/hpack.(*headerFieldTable).idToIndex)(0xc000056100, 0xc000e9b110?)
	/usr/local/go/src/vendor/[golang.org/x/net/http2/hpack/tables.go:118](http://golang.org/x/net/http2/hpack/tables.go:118) +0xbd
vendor/[golang.org/x/net/http2/hpack.(*headerFieldTable).search](http://golang.org/x/net/http2/hpack.(*headerFieldTable).search)(0xc000056100, {{0xc00026ea50, 0xd}, {0xc0001a9620, 0x20}, 0x0})
	/usr/local/go/src/vendor/[golang.org/x/net/http2/hpack/tables.go:105](http://golang.org/x/net/http2/hpack/tables.go:105) +0xe5
vendor/[golang.org/x/net/http2/hpack.(*Encoder).searchTable](http://golang.org/x/net/http2/hpack.(*Encoder).searchTable)(0xc000056100, {{0xc00026ea50, 0xd}, {0xc0001a9620, 0x20}, 0x0})
	/usr/local/go/src/vendor/[golang.org/x/net/http2/hpack/encode.go:97](http://golang.org/x/net/http2/hpack/encode.go:97) +0x85
vendor/[golang.org/x/net/http2/hpack.(*Encoder).WriteField](http://golang.org/x/net/http2/hpack.(*Encoder).WriteField)(0xc000056100, {{0xc00026ea50, 0xd}, {0xc0001a9620, 0x20}, 0x0})
	/usr/local/go/src/vendor/[golang.org/x/net/http2/hpack/encode.go:62](http://golang.org/x/net/http2/hpack/encode.go:62) +0x145
net/http.(*http2ClientConn).writeHeader(0xc00026ea40?, {0xc00026ea50?, 0xffffffffffffffff?}, {0xc0001a9620?, 0xc0007067e0?})
	/usr/local/go/src/net/http/h2_bundle.go:9331 +0x148
net/http.(*http2ClientConn).encodeHeaders.func3({0xc00026ea40?, 0xc0007067e0?}, {0xc0001a9620, 0x20})
	/usr/local/go/src/net/http/h2_bundle.go:9265 +0x71
net/http.(*http2ClientConn).encodeHeaders.func1(0xc0007fcbb8)
	/usr/local/go/src/net/http/h2_bundle.go:9226 +0x627
net/http.(*http2ClientConn).encodeHeaders(0xc0003c4300, 0xc000704f00, 0x1, {0x0, 0x0}, 0x40)
	/usr/local/go/src/net/http/h2_bundle.go:9258 +0x58c
net/http.(*http2clientStream).encodeAndWriteHeaders(0xc0004e5500, 0xc000704f00)
	/usr/local/go/src/net/http/h2_bundle.go:8721 +0x2e9
net/http.(*http2clientStream).writeRequest(0xc0004e5500, 0xc000704f00, 0x0)
	/usr/local/go/src/net/http/h2_bundle.go:8617 +0x535
net/http.(*http2clientStream).doRequest(0xc0004e5500, 0x1a52b10?, 0xc0000e9110?)
	/usr/local/go/src/net/http/h2_bundle.go:8551 +0x56
created by net/http.(*http2ClientConn).roundTrip in goroutine 562
	/usr/local/go/src/net/http/h2_bundle.go:8456 +0x3d8

I've met upper panic when I use fiber web framwork , it's based on fasthttp, and I've found related issue . By some self-check, I find out that this panic point to golang.org/x/net/http2 package. and there are some related issue 69316 43051 in current repo but neither fixed.

this phenomenon could happed in different browsers(firefox, chrome), and could be solved by disable http2 when building with -tags nethttpomithttp2

What did you see happen?

Panic.

What did you expect to see?

running correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions