Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
database/sql: Stmt.Close() causing segfault #14681
I encountered a crash in a defered Stmt.Close().
Connection is of the type *sql.DB. Am I doing something wrong or is this a weird bug.
The driver in question is https://github.com/go-sql-driver/mysql
As said I haven't actually been able to reliable reproduce it. The code in question is running on a couple dozen machines serving thousands if not millions of requests a day that run this code path and I have seen the crash happen only once in the last 5 days or so.
The codebase this happens in is quite extensive but the basic flow is something like:
So I still haven't been able to reliably reproduce the crasher yet but the following code runs into the similar other issues I've noticed.
If I remove the SetConnMaxLifeTime and ensure MaxOpen and MaxIdle are equal most of the issues seem to disappear.
What are "similar other issues"? Can you show errors/panics? If they're different from the original issue, they should probably be separate bugs.