|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50966 Some resource leak (odbc_connect and odbc_close) using dbase or Microsoft Acces
Submitted: 2010-02-08 11:19 UTC Modified: 2021-12-18 22:07 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: gg dot cwlee at gmail dot com Assigned:
Status: Open Package: cURL related
PHP Version: 5.2.12 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
19 + 17 = ?
Subscribe to this entry?

 [2010-02-08 11:19 UTC] gg dot cwlee at gmail dot com
We have a resource leak problem when using Apache 2.2.11 and PHP 5.2.12 with odbc_connect() and odbc_close() functions on dbase or Microsoft Access.
From my observe, it will leak some (Nonpaged) kernel Memory and some handles not free by the Apache(HTTPD.EXE).
And I also tested no this resource leak problem on Apache 2.2.11 and PHP 5.2.0.


Reproduce code:
$dsnMDB = "DRIVER=Microsoft Access Driver (*.mdb);UID=admin;UserCommitSync=Yes;Threads=3;SafeTransactions=0;PageTimeout=5;MaxScanRows=8;MaxBufferSize=2048;FIL=MS Access;DriverId=25;DefaultDir=D:\;DBQ=D:\db1.mdb;";
$dsnDBF = "DRIVER=Microsoft dBase Driver (*.dbf);UID=admin;UserCommitSync=Yes;Threads=3;Statistics=0;SafeTransactions=0;PageTimeout=5;MaxScanRows=8;MaxBufferSize=2048;FIL=dBase IV;DriverId=277;Deleted=1;DefaultDir=D:\;DBQ=D:\datasource\;CollatingSequence=ASCII;";

$dsn= $dsnDBF;



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-10 12:21 UTC] gg dot cwlee at gmail dot com
We identify the problem is within php_curl.dll. We are using PHP v5.2.12, and find that all newer PHP versions have this problem. We have to backtrack to the older PHP v5.2.0 before this problem disappears.

The problem source code:

PHP v5.2.12 ext\curl\interface.c Line 670

	if (!CRYPTO_get_id_callback()) {
		int i, c = CRYPTO_num_locks();

		php_curl_openssl_tsl = malloc(c * sizeof(MUTEX_T));

PHP v5.2.0 ext\curl\interface.c Line 609

		int i, c = CRYPTO_num_locks();
		php_curl_openssl_tsl = malloc(c * sizeof(MUTEX_T));

The only difference is the if statement:

if (!CRYPTO_get_id_callback())
 [2020-08-11 13:24 UTC]
-Package: ODBC related +Package: OpenSSL related
 [2020-08-11 13:24 UTC]
Apparently, we're still using CRYPTO_set_id_callback() and
friends[1], although that API is deprecated as of OpenSSL 1.0.0 in
favor of CRYPTO_THREADID_set_callback()[2].

[1] <>
[2] <>
 [2021-12-18 22:07 UTC]
-Package: OpenSSL related +Package: cURL related
 [2021-12-18 22:07 UTC]
I don't see how this is OpenSSL ext related. It seems like curl ext issue to me.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Oct 01 12:05:53 2022 UTC