PHP 4.0 Bug #5927: Incorrect shutdown order of modules

From: Date: Wed, 02 Aug 2000 15:39:10 +0000
Subject: PHP 4.0 Bug #5927: Incorrect shutdown order of modules
Groups: php.dev 
Request: Send a blank email to php-dev+get-27466@lists.php.net to get a copy of this message
From: ddebene@messagingdirect.com Operating system: Redhat Linux 6.1 PHP version: 4.0.1pl2 PHP Bug Type: Dynamic loading related Bug description: Incorrect shutdown order of modules This occurs with statically or dynamically linked modules, but I am only experiencing it myself with dynamically linked extensions. I have configured PHP to load two extensions I have created at run time, let's call them A and B. A relies on behaviour of B. I have ordered them in the php.ini file so that A is before B, and thus A gets initialized before B (which is required for B to work properly). However, on shutdown, A is also shutdown before B, and since B requires A to be still running to shut down, there is a core dump. Modules should be getting shut down in the reverse order that they are started, to preserve dependencies. I've actually patched this myself, here is the simple fix: Zend/zend_hash.c 539c539 < p = ht->pListHead; --- > p = ht->pListTail; 542c542 < p = p->pListNext; --- > p = p->pListLast;

« previous php.dev (#27466) next »