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
database/sql: hang when driver panics #13677
Labels
Milestone
Comments
CL https://golang.org/cl/18046 mentions this issue. |
rsc
added a commit
that referenced
this issue
Jan 8, 2016
For #13677, but there is more to do. Change-Id: Id1af999dc972d07cdfc771e5855a1a7dca47ca96 Reviewed-on: https://go-review.googlesource.com/18046 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
I fixed the ones that I've seen buggy cgo-based database drivers hit. I think we'll leave the rest for Go 1.7 since these are in some cases actual logic changes to database/sql. |
jbowens
added a commit
to jbowens/go
that referenced
this issue
Aug 29, 2016
The existing implementation may deadlock if the driver.Conn implementation panics, so use defers to ensure mutexes are unlocked even if the driver panics. For golang#13677, but there is more to do.
CL https://golang.org/cl/27995 mentions this issue. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Debugging a hang in a program using Go 1.6.
Looks like the sqlite3 driver has buggy cgo usage, which triggers a panic during a call to a driver method with one of the database/sql locks held. The panic invokes some deferred functions higher up the stack without unlocking the lock. Those functions try to get the lock for themselves and deadlock. Looks like maybe database/sql needs to use defer to guard its various calls into the driver.
I started this for the driver.Stmt methods, but there are a lot.
/cc @bradfitz
The text was updated successfully, but these errors were encountered: