diff options
-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; } |