php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5927 Incorrect shutdown order of modules
Submitted: 2000-08-02 17:39 UTC Modified: 2000-12-30 11:48 UTC
From: ddebene at messagingdirect dot com Assigned:
Status: Closed Package: Dynamic loading
PHP Version: 4.0.1pl2 OS: Redhat Linux 6.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ddebene at messagingdirect dot com
New email:
PHP Version: OS:

 

 [2000-08-02 17:39 UTC] ddebene at messagingdirect dot com
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;

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-27 05:34 UTC] sniper@php.net
Is this still happeningn with latest snapshot
from http://snaps.php.net/ ?

--Jani
 [2000-12-30 11:48 UTC] sniper@php.net
No feedback, considered fixed.

--Jani
 [2004-04-21 10:18 UTC] xuefer at 21cn dot com
this should be a feature request
as of current php4.3.6, it still shutdown a before b
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 15:01:34 2025 UTC