From ed4c24274bc45aae3b18f26d19db06b42624ecdf Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 18 Apr 2019 10:10:15 +0200 Subject: [PATCH] Fix dl() module unloading in post deactivate FOREACH_END_DEL() does not call the destructor by itself, we need to explicitly call it. Due to the missing dtor call the functions were not unregistered early, which resulted in later shutdown segfaults. --- Zend/zend_API.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 33d74db1a65..fbac5e47eca 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2608,6 +2608,7 @@ ZEND_API void zend_post_deactivate_modules(void) /* {{{ */ if (module->type != MODULE_TEMPORARY) { break; } + module_destructor(module); } ZEND_HASH_FOREACH_END_DEL(); } else { zend_module_entry **p = module_post_deactivate_handlers;