php.net |  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
Votes:1
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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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
Description:
------------
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.

Thanks.
Chris

Reproduce code:
---------------
<?php
$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;

$userDB=odbc_connect($dsn,"","");
odbc_close($userDB);
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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

#ifdef PHP_CURL_NEED_OPENSSL_TSL
	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

#ifdef PHP_CURL_NEED_OPENSSL_TSL
	{
		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] cmb@php.net
-Package: ODBC related +Package: OpenSSL related
 [2020-08-11 13:24 UTC] cmb@php.net
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] <https://github.com/php/php-src/blob/php-8.0.0beta1/ext/curl/interface.c#L1169-L1182>
[2] <https://www.openssl.org/docs/man1.0.2/man3/CRYPTO_THREADID_set_callback.html>
 [2021-12-18 22:07 UTC] bukka@php.net
-Package: OpenSSL related +Package: cURL related
 [2021-12-18 22:07 UTC] bukka@php.net
I don't see how this is OpenSSL ext related. It seems like curl ext issue to me.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 12:01:30 2024 UTC