php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35988 Unknown persistent list entry type in module shutdown
Submitted: 2006-01-13 02:46 UTC Modified: 2006-03-14 16:16 UTC
From: screen at brainkrash dot com Assigned: dmitry
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2006-01-13 (snap) OS: Win32
Private report: No CVE-ID:
 [2006-01-13 02:46 UTC] screen at brainkrash dot com
Description:
------------
A problem on win32 in plist_entry_destructor when running sockets as a shared library (php_sockets.dll). Tested on all php versions from 4.4.1 forward to CVS snapshot version php5.1-win32-200601111130.



Reproduce code:
---------------
start apache

execute:
<?php
  $sock = pfsockopen('127.0.0.1', 3306, $errno, $errstr);
?>

stop apache

Expected result:
----------------
Normal clean apache shutdown.

Actual result:
--------------
First-chance exception in Apache.exe (NTDLL.DLL): 0xC0000005: Access Violation.

NTDLL! 7c9105f8()
_emalloc(unsigned int 7507988) line 182 + 29 bytes
_erealloc(void * 0x007e5dc8, unsigned int 0, int 79) line 339 + 10 bytes
xbuf_format_converter(smart_str * 0x0006fdac, const char * 0x009a0458 `string', char * 0x0006fe44) line 212 + 69 bytes
vspprintf(char * * 0x0006fde4, unsigned int 0, const char * 0x009a0458 `string', char * 0x0006fe44) line 727
php_error_cb(int 7482400, const char * 0x00000002, const unsigned int 10033100, const char * 0x00000000, char * 0x009a0458 `string') line 659
zend_error(int 8159293, const char * 0x00000002) line 950 + 23 bytes
plist_entry_destructor(void * 0x0102de68) line 216 + 16 bytes
zend_hash_apply_deleter(_hashtable * 0x007bad73, bucket * 0x01009e28) line 574 + 6 bytes
zend_hash_graceful_reverse_destroy(_hashtable * 0x01009e28) line 641
zend_destroy_rsrc_list(_hashtable * 0x01009e28, void * * * 0x00fcb288) line 239 + 10 bytes
executor_globals_dtor(_zend_executor_globals * 0x01009c58, void * * * 0x00fcb288) line 506 + 7 bytes
tsrm_shutdown() line 180 + 4 bytes
php_apache_server_shutdown(void * 0x00000000) line 335
run_cleanups(cleanup_t * * 0x0026ad70) line 1953
apr_pool_destroy(apr_pool_t * 0x0040183d) line 734
destroy_and_exit_process(process_rec * 0x00268de8, int 0) line 210
main(int 4201858, const char * const * 0x00000005) line 625 + 8 bytes
APACHE! mainCRTStartup + 227 bytes
KERNEL32! 7c816d4f()


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-13 03:24 UTC] sniper@php.net
1) Have you installed PHP cleanly? Make sure you delete EVERY php related DLL, etc. before installing new versions.
2) What extensions do you load in your php.ini?
3) What zend extensions do you load in your php.ini?

 [2006-01-13 03:37 UTC] screen at brainkrash dot com
All my php dlls are isolated in a directory extracted from the zip distribution. The trace debug log shows all dlls loaded from the appropriate locations.

Loaded symbols for 'C:\apache\php\php5apache2.dll'
Loaded symbols for 'C:\apache\php\php5ts.dll'
Loaded 'C:\apache\php\ext\php_sockets.dll', no matching symbolic information found.

I've tested this with all of zend extensions disabled (sometimes i use xdebug) as well as all extensions disabled with the exception of php_sockets.dll.
 [2006-01-13 04:49 UTC] sniper@php.net
Dmitry, can you take a look?
 [2006-01-16 16:57 UTC] dmitry@php.net
I reprofuced the crash with Apache2 using ApacheMonitor.exe

The problem is not releated to socket, but to persistent resources. Under Apache2/win32 PHP doesn't free resources on thread exit and frees them on apache shutdown using tsrm_shutdown(). But tsrm_shutdown() is called after zend_shutdown(), when "HashTable list_destructors" is already destoyed. As result we got crash trying to access "list_destructors" from "plist_entry_destructor".

 [2006-03-14 16:16 UTC] dmitry@php.net
Fixed in CVS HEAD and PHP_5_1
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 08:02:33 2014 UTC