From: Derick Rethans Date: Tue, 6 Mar 2012 18:25:55 +0000 (+0000) Subject: Add the ZEND_DONT_UNLOAD_MODULES environment variable for debugging to 5.3 as X-Git-Tag: PHP-5.4.1-RC1~26^2~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ecf8986a9aac031a8739c9632d289a7e826b7454;p=php Add the ZEND_DONT_UNLOAD_MODULES environment variable for debugging to 5.3 as well. --- diff --git a/Zend/README.ZEND_MM b/Zend/README.ZEND_MM index cf9a9b7e83..2b8cb81b4f 100644 --- a/Zend/README.ZEND_MM +++ b/Zend/README.ZEND_MM @@ -24,6 +24,14 @@ Zend MM disabled: $ USE_ZEND_ALLOC=0 valgrind --leak-check=full sapi/cli/php -r 'leak();' +Shared extensions: +------------------ + +Since PHP 5.4 it is possible to prevent shared extensions from unloading so +that valgrind can correctly track the memory leaks in shared extensions. For +this there is the ZEND_DONT_UNLOAD_MODULES environment variable. If set, then +DL_UNLOAD() is skipped during the shutdown of shared extensions. + Tweaking: --------- diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 25ac500aee..6d2ccd2c69 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2137,7 +2137,7 @@ void module_destructor(zend_module_entry *module) /* {{{ */ #if HAVE_LIBDL #if !(defined(NETWARE) && defined(APACHE_1_BUILD)) - if (module->handle) { + if (module->handle && !getenv("ZEND_DONT_UNLOAD_MODULES")) { DL_UNLOAD(module->handle); } #endif