|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: gg dot cwlee at gmail dot com
New email:
PHP Version: OS:


 [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: Fri Sep 30 20:06:36 2022 UTC