- Notifications
You must be signed in to change notification settings - Fork18.5k
Open
Description
Go version
go version go1.25.4 darwin/arm64
Output ofgo env in your module/workspace:
AR='ar'CC='clang'CGO_CFLAGS='-O2 -g'CGO_CPPFLAGS=''CGO_CXXFLAGS='-O2 -g'CGO_ENABLED='1'CGO_FFLAGS='-O2 -g'CGO_LDFLAGS='-O2 -g'CXX='clang++'GCCGO='gccgo'GO111MODULE='on'GOARCH='arm64'GOARM64='v8.0'GOAUTH='netrc'GOBIN=''GOCACHE='/Users/sh00402ml/Library/Caches/go-build'GOCACHEPROG=''GODEBUG=''GOENV='/Users/sh00402ml/Library/Application Support/go/env'GOEXE=''GOEXPERIMENT=''GOFIPS140='off'GOFLAGS=''GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/s7/kb5yld350f99p10yg8p47z3r0000gq/T/go-build483836918=/tmp/go-build -gno-record-gcc-switches -fno-common'GOHOSTARCH='arm64'GOHOSTOS='darwin'GOINSECURE=''GOMOD='/Users/sh00402ml/GolandProjects/im-server/go.mod'GOMODCACHE='/Users/sh00402ml/go/pkg/mod'GONOPROXY='xxxxx'GONOSUMDB='xxxxx'GOOS='darwin'GOPATH='/Users/sh00402ml/go'GOPRIVATE='xxxx'GOPROXY='https://goproxy.io,direct'GOROOT='/Users/sh00402ml/go/go1.25.4'GOSUMDB='sum.golang.org'GOTELEMETRY='local'GOTELEMETRYDIR='/Users/sh00402ml/Library/Application Support/go/telemetry'GOTMPDIR=''GOTOOLCHAIN='auto'GOTOOLDIR='/Users/sh00402ml/go/go1.25.4/pkg/tool/darwin_arm64'GOVCS=''GOVERSION='go1.25.4'GOWORK=''PKG_CONFIG='pkg-config'
What did you do?
- my application was a little bit complicated, i can not write a simple demo to reproduce the bug
- but there is a import code line that may help
http.DefaultTransport.(*http.Transport).MaxConnsPerHost = 100
What did you see happen?
- panic happend but the go process does not exit as expected because of a dead lock
2. how does the dead lock happend?readLoopPeekFailLocked -> closeLocked -> decConnsPerHost
then decConnsPerHost panic
back to readLoop, line 2283 did not run, means pc.mu still Locked, then we will run line 2245.
in line 2245 , we want to lock pc.mu while we have got pc.mu Locked, means we are in deadLock


- this is the detail gorutine stack text
panic-goroutine.txt
What did you expect to see?
- maybe we should defer the pc.mu.Unlock before we run the func readLoopPeekFailLocked
2. if we did so , the panic will cause process exit as expected