Re: potential shutdown order issue
| From: | Stanislav Malyshev | Date: | Wed, 16 Jul 2008 20:32:36 +0000 |
| Subject: | Re: potential shutdown order issue | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-39025@lists.php.net to get a copy of this message | ||
Hi!
zend_destroy_rsrc_list(&EG(regular_list)). On the next line, zend_post_deactivate_modules() is called, which steps through the module list and unloads all the dynamically loaded modules. If one of thesedl() is really troublesome...
I think this issue could be fixed by moving the zend_destroy_rsrc_list(&EG(regular_list)) call after the module shutdown. I've attached a patch demonstrating the principle (this fixes the hashtable destroyed message and I don't get anything bad like a segfault).But many resource dtors may need some action from modules they belong to. If modules are already past shutdown, that may be a problem. If we must spend time on supporting dl(), then I'd propose to fix module dtor so that it wouldn't try to access EG(regular_list) - if it happens as you described, it doesn't need it anyway. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com