From:             vaclav dot pecuch at tiscali dot cz
Operating system: Windows 2000
PHP version:      4.3.2
PHP Bug Type:     Scripting Engine problem
Bug description:  persistent resources destructors aren't called on Windows

Description:
------------
PHP 4.3.2 on Windows doesn't call persistent resource destructors on PHP
process shutdown.

I'm using persitent resources in my PHP module, i.e.

in MINIT function I register destructors for my resources:
        mymod_rsc=zend_register_list_destructors_ex(mymod_commit_rsc,
mymod_close_rsc, MYMOD_RSC_NAME, module_number);

I add newly created resource to EG(persistent_list) by this code
list_entry new_le;
Z_TYPE(new_le) = mymod_rsc;
new_le.ptr = malloced_rsc_data_buffer;
zend_hash_update(&EG(persistent_list), hashed_details,
strlen(hashed_details)+1, (void *) &new_le, sizeof(list_entry), NULL);

Function mymod_commit_rsc is called at the end of the request while
mymod_close_rsc is never called.

I'm running PHP 4.3.2 with Apache 1.3.27 (PHP runs as Apache module) on
Windows 2000. I'm loading PHP module through "extension" directive in
PHP.INI. I've tested my module on Linux (RH 7.3, PHP 4.3.2 as Apache
module with Apache 1.3.27) and it worked - mymod_close_rsc was called at
the end of PHP process or more precisely at the end of Apache process.


Reproduce code:
---------------
The simplest example is there:
http://home.tiscali.cz/vaclav.pecuch/phptestmodule.zip

This is PHP module which registers its persistent resource in MINIT
function, implements "create_resource" function and contains some logging
(ugly but functional).

Change path settings in makefile and logfile path and filename  in C
source before build.

Expected result:
----------------
Destruction of persistent resources at the end of PHP process.

Actual result:
--------------
Destructor isn't called on Windows, is called on Linux.

-- 
Edit bug report at http://bugs.php.net/?id=24390&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=24390&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=24390&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=24390&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=24390&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=24390&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=24390&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=24390&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=24390&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=24390&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=24390&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24390&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=24390&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=24390&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=24390&r=gnused

Reply via email to