From: terryoh at wins21 dot com Operating system: Windows 2000 Server PHP version: 4.3.8 PHP Bug Type: COM related Bug description: After opening ADO connection and closing it repeatedly, Apache stops service
Description: ------------ Today, my apache server stopped service. So I tested whether the apache daemon was ok or not. It worked, because the telnet 80 connection(like C:/telnet.exe 127.0.0.1 80) was successful. But I could not open any php pages on the internet explorer. I checked the memory with windows task manager and I found something strange. The allocated memory for apache was almost 1GB(998MB) and the count of the handles was almost 40000(39890). Finally I found that it was ADO-PHP problem. I could see memory and the count of handles increased when opening database and closing it repeatedly(1 try/1 second for an hour). Especially the handles were never decreased. [Steps] 1) Register any ODBC DSN(driver=SQL Server)in the control panel. 2) In PHP.INI, set the key name(odbc.default_db) with the DSN;user ID;password. 3) Start an apache service. 4) Open a test page(in the reproduce code section)in your web browser. 5) Refresh the test page repeatedly once a second. 6) Open windows task manager. If you can not see handle column on the process tab, add it(Menu->View->Column Selection->Handle). 7) After 1 minute or later, you can see the count of apache handle increase like 400->401->402->403.... Also you can see the memory increase. Reproduce code: --------------- <?php $ConnectionString = ini_get('odbc.default_db'); $AdoConn = new COM("ADODB.Connection"); $AdoConn->Open($ConnectionString); $AdoConn->Close(); unset($AdoConn); ?> ***** Web Server : Apache 1.3.28 ***** PHP : 4.3.8 ***** OS : Windows 2000 Server ***** DBMS : MSSQL2000 Enterprise Edition ***** OTHERS : MDAC 2.8 Expected result: ---------------- Windows Task Manager(Process Tab) Image name Memory Handle Apache.exe 10,840KB 200 11:00 AM Apache.exe 10,857KB 201 11:02 AM Apache.exe 10,867KB 202 11:04 AM Apache.exe 10,867KB 202 11:06 AM Apache.exe 10,867KB 202 11:08 AM Apache.exe 10,867KB 202 11:10 AM Apache.exe 10,867KB 202 11:12 AM .... Actual result: -------------- Windows Task Manager(Process Tab) Image name Memory Handle Apache.exe 10,840KB 200 11:00 AM Apache.exe 10,857KB 201 11:02 AM Apache.exe 10,867KB 202 11:04 AM Apache.exe 10,877KB 203 11:06 AM Apache.exe 10,886KB 204 11:08 AM Apache.exe 10,899KB 205 11:10 AM Apache.exe 10,910KB 206 11:12 AM .... Apache.exe 998MB 39890 -- Edit bug report at http://bugs.php.net/?id=32099&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32099&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32099&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32099&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=32099&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=32099&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32099&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32099&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32099&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32099&r=support Expected behavior: http://bugs.php.net/fix.php?id=32099&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32099&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32099&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=32099&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32099&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=32099&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32099&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32099&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32099&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32099&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32099&r=mysqlcfg