Skip to content

Commit ecf8986

Browse files
author
Derick Rethans
committed
Add the ZEND_DONT_UNLOAD_MODULES environment variable for debugging to 5.3 as
well.
1 parent abd5670 commit ecf8986

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Zend/README.ZEND_MM

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ Zend MM disabled:
2424

2525
$ USE_ZEND_ALLOC=0 valgrind --leak-check=full sapi/cli/php -r 'leak();'
2626

27+
Shared extensions:
28+
------------------
29+
30+
Since PHP 5.4 it is possible to prevent shared extensions from unloading so
31+
that valgrind can correctly track the memory leaks in shared extensions. For
32+
this there is the ZEND_DONT_UNLOAD_MODULES environment variable. If set, then
33+
DL_UNLOAD() is skipped during the shutdown of shared extensions.
34+
2735
Tweaking:
2836
---------
2937

Zend/zend_API.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2137,7 +2137,7 @@ void module_destructor(zend_module_entry *module) /* {{{ */
21372137

21382138
#if HAVE_LIBDL
21392139
#if !(defined(NETWARE) && defined(APACHE_1_BUILD))
2140-
if (module->handle) {
2140+
if (module->handle && !getenv("ZEND_DONT_UNLOAD_MODULES")) {
21412141
DL_UNLOAD(module->handle);
21422142
}
21432143
#endif

0 commit comments

Comments
 (0)