]> granicus.if.org Git - php/commitdiff
Fix dl() module unloading in post deactivate
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 18 Apr 2019 08:10:15 +0000 (10:10 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 18 Apr 2019 08:10:15 +0000 (10:10 +0200)
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

index 33d74db1a65f9146b8b319219ae370c6b8413642..fbac5e47eca1978943c38c55ec3bf55217c88984 100644 (file)
@@ -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;