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: 2010-02-10 12:21 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: ODBC related
PHP Version: 5.2.12 OS: Windows XP
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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())
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon May 25 19:01:24 2020 UTC