#27640 [Asn->Csd]: [PATCH] memory leak of registered_zend_ini_directives table
| From: | andi@php.net | Date: | Sun, 23 May 2004 16:06:13 +0000 |
| Subject: | #27640 [Asn->Csd]: [PATCH] memory leak of registered_zend_ini_directives table | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-59910@lists.php.net to get a copy of this message | ||
ID: 27640
Updated by: andi@php.net
Reported By: msisolak at yahoo dot com
-Status: Assigned
+Status: Closed
Bug Type: Zend Engine 2 problem
Operating System: Windows 2000
PHP Version: 5.0.0RC1
Assigned To: andi
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2004-04-13 13:10:26] sniper@php.net
Andi, please take a look.
------------------------------------------------------------------------
[2004-03-18 16:42:49] msisolak at yahoo dot com
Description:
------------
Under thread-safe builds the registered_zend_ini_directives hash table
leaks (verified under Win32 with a _CrtDumpMemoryLeaks() call at the
bottom of the CLI main() function). There is a
zend_ini_global_shutdown() function in zend_ini.c to free this table,
but it never gets called.
A suggested patch:
--- main.c.orig Thu Mar 18 16:34:09 2004
+++ main.c Thu Mar 18 16:34:22 2004
@@ -1523,9 +1523,9 @@
/* close down the ini config */
php_shutdown_config();
+ zend_ini_global_shutdown(TSRMLS_C);
#ifndef ZTS
- zend_ini_shutdown(TSRMLS_C);
shutdown_memory_manager(CG(unclean_shutdown), 1 TSRMLS_CC);
#endif
Since registered_zend_ini_directives is the same as EG(ini_directives)
under non-thread safe builds, calling zend_ini_global_shutdown() in
either case should be fine.
Reproduce code:
---------------
Just calling "php.exe -v" caused the memory leak - no script is
required.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27640&edit=1