-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: nil pointer dereference in closeConnIfStillIdle #16208
Comments
You should include a recipe to reproduce the error in your report. Point 3 in the issue report list says
|
In addition to code, as @ALTree mentioned, does your program run under the race detector? |
@bradfitz No, not with race detector. I don't think it will be easy to reproduce by a short example. It's a large long-running program. I believe it's introduced by recent changes. I will try to do some git bisect to find out which commit. |
Does that mean you haven't tried, or it fails?
Please do. I labeled this "WaitingForInfo" since there's nothing for us to help with until we have more to go on. If you get us something soon, there's a chance it could be fixed for Go 1.7, if there's a problem. |
@bradfitz I didn't run the program with race detector, I will give it a try. |
Close because the program ran for several days with no crash at all, with race detector enabled / disabled. No way to reproduce. |
This bug occurred with me too (minio/minio#2456). However, it is not reproducible anymore. So, just wanted to encourage you to review the code if many other people experiment the same issue. |
@vadmeste, if you find a reproducible example, please file a new bug. You can reference this one. But we don't re-use old bugs. |
Just got this today after upgrading to Go 1.7. Try to see if it occurs multiple times and will file a new bug. As this occurs in a go routine outside our control, it ended up bringing down the entire service. |
@kidoman, if you find a reproducible example, please file a new bug. You can reference this one. But we don't re-use old bugs. |
Okay, I have a fuzzy theory, so let's just use this bug, since it was never fixed anyway. The crash is because func (pc *persistConn) closeConnIfStillIdle() {
t := pc.t
t.idleMu.Lock() // <--- BOOM, because t == nil As far as I can tell, the only place where return &persistConn{alt: next(cm.targetAddr, pconn.conn.(*tls.Conn))}, nil So somehow that handlePendingDial := func() {
testHookPrePendingDial()
go func() {
if v := <-dialc; v.err == nil {
t.putOrCloseIdleConn(v.pc) // <--- here
}
testHookPostPendingDial()
}()
} I don't have a repro yet, but it looks suspicious. |
Looks promising. Possibly race between setup and teardown? |
CL https://golang.org/cl/27450 mentions this issue. |
…rash after IdleConnTimeout Go 1.7 crashed after Transport.IdleConnTimeout if an HTTP/2 connection was established but but its caller no longer wanted it. (Assuming the connection cache was enabled, which it is by default) Fixes #16208 Change-Id: I9628757f7669e344f416927c77f00ed3864839e3 Reviewed-on: https://go-review.googlesource.com/27450 Reviewed-by: Andrew Gerrand <adg@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/28637 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Made more urgent by: golang/go#16208
What version of Go are you using (
|
@sudersen, you're commenting on a closed issue. Closed issues aren't tracked. If you're experiencing a problem, please file a new code and include code. There's nothing in your comment to use to help you. |
go version
)?go version devel +b75b063 Tue Jun 28 04:49:33 2016 +0000 linux/amd64
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/reus"
GORACE=""
GOROOT="/home/reus/go"
GOTOOLDIR="/home/reus/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build483039895=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
The text was updated successfully, but these errors were encountered: