php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15254 modules are unloaded in the wrong order
Submitted: 2002-01-28 08:14 UTC Modified: 2002-06-18 03:29 UTC
From: stephensb at aciworldwide dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.1.1 OS: Linux, Solaris and win32
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: stephensb at aciworldwide dot com
New email:
PHP Version: OS:

 

 [2002-01-28 08:14 UTC] stephensb at aciworldwide dot com
zend_hash_destroy destroys things in order.  Thus, if one has
two loadable modules, one of which depends on the other by
calling a function in the initialization or finalization functions, then bad things will happen whichever order they appear in php.ini, since whichever way around they're listed,  
a function will be called after the providing library has been unloaded.

Our fix is simply to change zend_hash_destroy to traverse its list backwards (from ht->pListTail rather than ht->pListHead).

(I believe we (probably as MessagingDirect) reported this bug in PHP3 and it was fixed then, but it seems to have reappeared.)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-28 08:35 UTC] hholzgra@php.net
i remember doing something about that somewhere
around 4.0.5, too, but i can't remember the outcome :(
 [2002-02-03 20:15 UTC] yohgaki@php.net
Not only for unloading, but also loading modules have smilar problem.
Just reminding :)
 [2002-02-04 06:32 UTC] stephensb at aciworldwide dot com
For loading, I presume you're referring to the way PHP apparently loads and unloads all the modules?

If so, then yes: that's how we noticed the problem.  With our
two modules, PHP would fail to start up until we reordered
zend_hash_destroy.

Is there any reason *not* to traverse the list in reverse order in zend_hash_destroy?  It seems logical to me to try to 
destroy things in the reverse order that you created them, in general.
 [2002-06-18 03:29 UTC] derick@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC