We are looking at reordering the PDO statement-free dtors to fix a
resource leak in PDO_OCI. Let me know if this will affect other
drivers.
Chris
*** pdo_stmt.c.orig 2015-07-15 09:56:18.986187123 -0700
--- pdo_stmt.c 2015-07-15 09:57:22.292453715 -0700
*** 2300,2305 ****
--- 2300,2309 ----
PDO_API void php_pdo_free_statement(pdo_stmt_t *stmt)
{
-
if (stmt->methods && stmt->methods->dtor) {
-
stmt->methods->dtor(stmt);
-
if (stmt->bound_params) {}
zend_hash_destroy(stmt->bound_params);
FREE_HASHTABLE(stmt->bound_params);
*** 2316,2324 ****
stmt->bound_columns = NULL;
}
- if (stmt->methods && stmt->methods->dtor) {
-
stmt->methods->dtor(stmt);
- }
if (stmt->query_string) {
efree(stmt->query_string);
}
--- 2320,2325 ----
Hi cjones,
I've tried runinng the pdo_pgsql tests but I'm getting a (potentially
unrelated) failure.
I'll try to investigate and run the tests for other extensions as soon
as I can find some time.
Cheers
We are looking at reordering the PDO statement-free dtors to fix a
resource leak in PDO_OCI. Let me know if this will affect other
drivers.Chris
*** pdo_stmt.c.orig 2015-07-15 09:56:18.986187123 -0700
--- pdo_stmt.c 2015-07-15 09:57:22.292453715 -0700
*** 2300,2305 ****
--- 2300,2309 ----PDO_API void php_pdo_free_statement(pdo_stmt_t *stmt)
{
if (stmt->methods && stmt->methods->dtor) {
stmt->methods->dtor(stmt);
} if (stmt->bound_params) { zend_hash_destroy(stmt->bound_params); FREE_HASHTABLE(stmt->bound_params);
*** 2316,2324 ****
stmt->bound_columns = NULL;
}
if (stmt->methods && stmt->methods->dtor) {
stmt->methods->dtor(stmt);
} if (stmt->query_string) { efree(stmt->query_string); }
--- 2320,2325 ----
--
Matteo Beccati
Development & Consulting - http://www.beccati.com/
Hi Christopher,
Hi cjones,
I've tried runinng the pdo_pgsql tests but I'm getting a (potentially
unrelated) failure.I'll try to investigate and run the tests for other extensions as soon
as I can find some time.
so... pdo_pgsql and pdo_sqlite seemed to be unaffected, but the
pdo_mysql test suite started leaking, at least when compiled with no
debug and mysqlnd.
=====================================================================
Number of tests : 172 164
Tests skipped : 8 ( 4.7%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 0 ( 0.0%) ( 0.0%)
Expected fail : 4 ( 2.3%) ( 2.4%)
Tests leaked : 53 ( 30.8%) ( 32.3%)
Tests passed : 107 ( 62.2%) ( 65.2%)
Time taken : 429 seconds
Cheers
Matteo Beccati
Development & Consulting - http://www.beccati.com/