From: Joe Watkins Date: Mon, 27 Feb 2017 17:55:14 +0000 (+0000) Subject: Merge branch 'PHP-7.0' into PHP-7.1 X-Git-Tag: php-7.1.3RC1~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7aa59a444039908c0d42371fa4eaffb4089decbf;p=php Merge branch 'PHP-7.0' into PHP-7.1 * PHP-7.0: fix crash in phpdbg shutdown process when opcache is loaded --- 7aa59a444039908c0d42371fa4eaffb4089decbf diff --cc sapi/phpdbg/phpdbg.c index 320c8afac6,37314e6183..121f1edb17 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@@ -231,20 -228,10 +231,19 @@@ static PHP_MSHUTDOWN_FUNCTION(phpdbg) / zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD]); zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_COND]); zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP]); - zend_hash_destroy(&PHPDBG_G(file_sources)); zend_hash_destroy(&PHPDBG_G(seek)); zend_hash_destroy(&PHPDBG_G(registered)); - zend_hash_destroy(&PHPDBG_G(watchpoints)); - zend_llist_destroy(&PHPDBG_G(watchlist_mem)); + phpdbg_destroy_watchpoints(); + + if (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)) { + phpdbg_notice("stop", "type=\"normal\"", "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));