1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix 'phpdbg --help' segfault on shutdown with USE_ZEND_ALLOC=0

This hack not only breaks the handling of custom allocators, but also
breaks if zend_alloc is compiled with USE_CUSTOM_MM.
This hack is just no good, if you want leak information then use ASAN.

Closes GH-18813.
This commit is contained in:
Niels Dossche
2025-06-09 17:49:27 +02:00
parent fe3bea090e
commit 0cd3ebfc40
2 changed files with 3 additions and 6 deletions

3
NEWS
View File

@@ -39,6 +39,9 @@ PHP NEWS
. Add missing filter cleanups on phar failure. (nielsdos)
. Fixed bug GH-18642 (Signed integer overflow in ext/phar fseek). (nielsdos)
- PHPDBG:
. Fix 'phpdbg --help' segfault on shutdown with USE_ZEND_ALLOC=0. (nielsdos)
- PDO ODBC:
. Fix memory leak if WideCharToMultiByte() fails. (nielsdos)

View File

@@ -179,12 +179,6 @@ static PHP_MSHUTDOWN_FUNCTION(phpdbg) /* {{{ */
phpdbg_notice("Script ended normally");
}
/* hack to restore mm_heap->use_custom_heap in order to receive memory leak info */
if (use_mm_wrappers) {
/* ASSUMING that mm_heap->use_custom_heap is the first element of the struct ... */
*(int *) zend_mm_get_heap() = 0;
}
if (PHPDBG_G(buffer)) {
free(PHPDBG_G(buffer));
PHPDBG_G(buffer) = NULL;