]> granicus.if.org Git - php/commitdiff
Add the ZEND_DONT_UNLOAD_MODULES environment variable for debugging to 5.3 as
authorDerick Rethans <derick@php.net>
Tue, 6 Mar 2012 18:25:55 +0000 (18:25 +0000)
committerDerick Rethans <derick@php.net>
Tue, 6 Mar 2012 18:25:55 +0000 (18:25 +0000)
well.

Zend/README.ZEND_MM
Zend/zend_API.c

index cf9a9b7e832af10ca56ad0faae5d63eabb3e90bd..2b8cb81b4f1cfa5ff2126e71481403b35279b209 100644 (file)
@@ -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:
 ---------
 
index 25ac500aeeadac01a83c53c3ee92d1d063ad33ba..6d2ccd2c69fcfbaa8ff2a3825c53e41456e59afb 100644 (file)
@@ -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