diff options
author | Stanislav Malyshev <stas@php.net> | 2014-09-01 12:19:31 -0700 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2014-09-01 12:20:34 -0700 |
commit | 57f82819e978e34b3f488eb9a00681174584f5f3 (patch) | |
tree | faa8f8dbe9565ad94d82e8a0287a2ff7c9345d0c | |
parent | f89b7ec38950e39b9bb1b566b6c567382c42248f (diff) | |
parent | 4b9fcc01d4cd17d3933c8f9c76fb37359117ce2e (diff) | |
download | php-git-57f82819e978e34b3f488eb9a00681174584f5f3.tar.gz |
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
update NEWS
Only destruct if EG(active) in zend_shutdown(). (bug #65463, #66036)
Fix typo from commit 32314f6b6
Fix destruction order in zend_shutdown (bug #65463, #66036)
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | Zend/zend.c | 14 | ||||
-rw-r--r-- | Zend/zend_compile.h | 2 | ||||
-rw-r--r-- | Zend/zend_execute_API.c | 4 |
4 files changed, 22 insertions, 3 deletions
@@ -4,10 +4,13 @@ PHP NEWS ?? ??? 2014, PHP 5.6.1 - Core: + . Implemented FR #38409 (parse_ini_file() looses the type of booleans). (Tjerk) + . Fixed bug #65463 (SIGSEGV during zend_shutdown()). (Keyur Govande) + . Fixed bug #66036 (Crash on SIGTERM in apache process). (Keyur Govande) . Fixed bug #67878 (program_prefix not honoured in man pages). (Remi) . Fixed bug #67938 (Segfault when extending interface method with variadic). (Nikita) - . Implemented FR #38409 (parse_ini_file() looses the type of booleans). (Tjerk) + - Fileinfo: . Fixed bug #67731 (finfo::file() returns invalid mime type diff --git a/Zend/zend.c b/Zend/zend.c index 34dcc75469..891928359d 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -822,6 +822,20 @@ void zend_shutdown(TSRMLS_D) /* {{{ */ zend_shutdown_timeout_thread(); #endif zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC); + + if (EG(active)) + { + /* + * The order of destruction is important here. + * See bugs #65463 and 66036. + */ + zend_hash_reverse_apply(GLOBAL_FUNCTION_TABLE, (apply_func_t) zend_cleanup_function_data_full TSRMLS_CC); + zend_hash_reverse_apply(GLOBAL_CLASS_TABLE, (apply_func_t) zend_cleanup_user_class_data TSRMLS_CC); + zend_cleanup_internal_classes(TSRMLS_C); + zend_hash_reverse_apply(GLOBAL_FUNCTION_TABLE, (apply_func_t) clean_non_persistent_function_full TSRMLS_CC); + zend_hash_reverse_apply(GLOBAL_CLASS_TABLE, (apply_func_t) clean_non_persistent_class_full TSRMLS_CC); + } + zend_destroy_modules(); virtual_cwd_deactivate(TSRMLS_C); diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index f86a41ae2b..876e8ec5f2 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -686,6 +686,8 @@ ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce TSRMLS_DC); ZEND_API void zend_cleanup_internal_classes(TSRMLS_D); ZEND_API int zend_cleanup_function_data(zend_function *function TSRMLS_DC); ZEND_API int zend_cleanup_function_data_full(zend_function *function TSRMLS_DC); +ZEND_API int clean_non_persistent_function_full(zend_function *function TSRMLS_DC); +ZEND_API int clean_non_persistent_class_full(zend_class_entry **ce TSRMLS_DC); ZEND_API void destroy_zend_function(zend_function *function TSRMLS_DC); ZEND_API void zend_function_dtor(zend_function *function); diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index af32e91f28..243da3fde1 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -109,7 +109,7 @@ static int clean_non_persistent_function(zend_function *function TSRMLS_DC) /* { } /* }}} */ -static int clean_non_persistent_function_full(zend_function *function TSRMLS_DC) /* {{{ */ +ZEND_API int clean_non_persistent_function_full(zend_function *function TSRMLS_DC) /* {{{ */ { return (function->type == ZEND_INTERNAL_FUNCTION) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE; } @@ -121,7 +121,7 @@ static int clean_non_persistent_class(zend_class_entry **ce TSRMLS_DC) /* {{{ */ } /* }}} */ -static int clean_non_persistent_class_full(zend_class_entry **ce TSRMLS_DC) /* {{{ */ +ZEND_API int clean_non_persistent_class_full(zend_class_entry **ce TSRMLS_DC) /* {{{ */ { return ((*ce)->type == ZEND_INTERNAL_CLASS) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE; } |