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: closeStream has panic #59601

Closed
liyikun opened this issue Apr 13, 2023 · 1 comment
Closed

x/net/http2: closeStream has panic #59601

liyikun opened this issue Apr 13, 2023 · 1 comment

Comments

@liyikun
Copy link

liyikun commented Apr 13, 2023

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

$ go version
$ go version go1.18.10 linux/amd64

Does this issue reproduce with the latest release?

no

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/opt/tiger/.cache/go-build"
GOENV="/tmp/.config-cgrv5v93nk6ie7i27hog/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/opt/tiger/compile_path/pkg/mod"
GONOPROXY="gitlab.everphoto.cn,git.xxxx.org,sysrepo.xxxx.org,git.smartisan.com"
GONOSUMDB="code.xxxx.org,gitlab.everphoto.cn,git.xxxx.org,sysrepo.xxxx.org,git.smartisan.com"
GOOS="linux"
GOPATH="/opt/tiger/compile_path"
GOPRIVATE="gitlab.everphoto.cn,git.xxxx.org,sysrepo.xxxx.org,git.smartisan.com"
GOPROXY="https://goproxy.xxxx.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.10"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="xxxx"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build157967966=/tmp/go-build -gno-record-gcc-switches"

What did you do?

h2s = &http2.Server{}
	server = &http.Server{
		Handler: h2c.NewHandler(
			handlers,
			h2s),
		IdleTimeout: time.Minute * 3,
	}
	err := http2.ConfigureServer(server, h2s)
	if err != nil {
		...
	}

	listener, err := net.Listen("tcp", fmt.Sprintf(":%s", global.port))
	if err != nil {
		...
	}

	if err := server.Serve(listener); err != nil && err != http.ErrServerClosed {
		...
	}

What did you expect to see?

not panic

What did you see instead?

2023/04/13 11:06:13 http: panic serving 10.111.0.47:59954: runtime error: invalid memory address or nil pointer dereference
goroutine 1174517 [running]:
net/http.(*conn).serve.func1()
/usr/local/go/src/net/http/server.go:1826 +0xbf
panic({0x124f660, 0x22be090})
/usr/local/go/src/runtime/panic.go:844 +0x258
time.(*Timer).Reset(0x1245f20?, 0xc004f8b140?)
/usr/local/go/src/time/sleep.go:135 +0x14
golang.org/x/net/http2.(*serverConn).closeStream(0xc004bc4000, 0xc004c78e70, {0x1a13380, 0xc00025c810})
/opt/tiger/compile_path/pkg/mod/golang.org/x/net@v0.2.0/http2/server.go:1641 +0x17b
golang.org/x/net/http2.(*serverConn).closeAllStreamsOnConnClose(0xc004bc4000)
/opt/tiger/compile_path/pkg/mod/golang.org/x/net@v0.2.0/http2/server.go:864 +0xca
golang.org/x/net/http2.(*serverConn).serve(0xc004bc4000)
/opt/tiger/compile_path/pkg/mod/golang.org/x/net@v0.2.0/http2/server.go:920 +0x6c5
golang.org/x/net/http2.(*Server).ServeConn(0xc004855a80, {0x1a249c8?, 0xc00000c2f8}, 0xc00480b990)
/opt/tiger/compile_path/pkg/mod/golang.org/x/net@v0.2.0/http2/server.go:504 +0xb8c
golang.org/x/net/http2/h2c.h2cHandler.ServeHTTP({{0x1a169c0?, 0xc0001b6168?}, 0xc004855a80?}, {0x1a200b0, 0xc004f8c380}, 0xc004f6fb00)
/opt/tiger/compile_path/pkg/mod/golang.org/x/net@v0.2.0/http2/h2c/h2c.go:116 +0x54b
net/http.serverHandler.ServeHTTP({0xc004f8afc0?}, {0x1a200b0, 0xc004f8c380}, 0xc004f6fb00)
/usr/local/go/src/net/http/server.go:2920 +0x443
net/http.(*conn).serve(0xc004f57680, {0x1a20cd8, 0xc000233530})
/usr/local/go/src/net/http/server.go:1967 +0x5d7
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:3075 +0x4db

@seankhliao
Copy link
Member

That's way out of date, please user newer versions.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants