You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What operating system and processor architecture are you using (go env)?
linux/amd64
What did you do?
c.handshakeMutex.Lock()
defer c.handshakeMutex.Unlock()
if c.handshakeComplete {
alertErr = c.sendAlert(alertCloseNotify)
}
if err := c.conn.Close(); err != nil {
// c.conn.Close() calls c.ConnectionState() before returning
// this will cause a deadlock
// can the defer be removed from c.handshakeMutex.Unlock() before c.conn.Close()?
return err
}
return alertErr
}
Is there a reason I shouldn't be able to call ConnectionState from inside of my net.Conn that *tls.Conn is wrapped around?
Could the defer unlock be replaced?
thank you
The text was updated successfully, but these errors were encountered:
There's no need to hold the handshake lock across this call and it can
lead to deadlocks if the net.Conn calls back into the tls.Conn.
Fixesgolang#18426.
Change-Id: Ib1b2813cce385949d970f8ad2e52cfbd1390e624
Reviewed-on: https://go-review.googlesource.com/36561
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
There's no need to hold the handshake lock across this call and it can
lead to deadlocks if the net.Conn calls back into the tls.Conn.
Fixesgolang#18426.
Change-Id: Ib1b2813cce385949d970f8ad2e52cfbd1390e624
Reviewed-on: https://go-review.googlesource.com/36561
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
What version of Go are you using (
go version
)?go1.7
What operating system and processor architecture are you using (
go env
)?linux/amd64
What did you do?
What did you expect to see?
Close() will call c.handshakeMutex.Lock()
Close() will deadlock if c.conn.Close() calls ConnectionState()
https://golang.org/src/crypto/tls/conn.go?s=34139:34345#L1163
ConnectionState() will call c.handshakeMutex.Lock()
https://golang.org/src/crypto/tls/conn.go?s=36916:36964#L1271
What did you see instead?
Is there a reason I shouldn't be able to call ConnectionState from inside of my net.Conn that *tls.Conn is wrapped around?
Could the defer unlock be replaced?
thank you
The text was updated successfully, but these errors were encountered: