ID: 38190 Updated by: [EMAIL PROTECTED] Reported By: cosborne at gmail dot com -Status: Open +Status: Assigned Bug Type: DOM XML related Operating System: Windows Server 2K3 PHP Version: 5.1.4 Assigned To: rrichards New Comment:
Rob, it works, commit. :) Previous Comments: ------------------------------------------------------------------------ [2006-07-26 23:25:11] cosborne at gmail dot com It would appear that this has corrected the problem, however I would like to see other people's results before this was considered "fixed" ------------------------------------------------------------------------ [2006-07-26 14:13:53] [EMAIL PROTECTED] I don't have access to a Win 2K3 server, so can't reproduce. If someone has access to one and can compile source, please try with one of these libxml2 libraries and following changes: Release: http://ctindustries.net/libxml/libxml2-2.6.17.threads.zip Debug: http://ctindustries.net/libxml/libxml2-2.6.17.threadsdebug.zip You will need to add the following somwhere within ext/libxml/libxml.c for now: PHP_LIBXML_API BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { return xmlDllMain(hinstDLL, fdwReason, lpvReserved); } Also, you need to use the php_libxml2.def from within the zip and disable xsl support (no current libxslt built against that ver of libxml2). This libxml2 lib changes the way some of the threading is handled. ------------------------------------------------------------------------ [2006-07-23 12:41:33] [EMAIL PROTECTED] Rob, please take a look, seems to be something you might know about.. ------------------------------------------------------------------------ [2006-07-23 05:51:41] cosborne at gmail dot com Description: ------------ The IIS worker process (W3WP.exe) crashes with an access violation when the application pool is recycled or IIS is shutdown/restarted. A number of people have reported this bug, or related bugs, so technically this is a duplicate report, but as I believe I've determined the root cause, I believe it warrants a new report, since the others are in various states, and with various, spurious or conflicting "fixes" and "causes". Bugs almost certainly related to this include: #36853 #38111 #37575 Reproduce code: --------------- Load any PHP script hosted on an IIS server, and either wait for the worker process to be recycled after the specified idle period, or restart IIS. The IIS worker process (W3WP.exe) will fault. The fault may be "silent", causing an event to be logged. Expected result: ---------------- The worker process should exit gracefully. Actual result: -------------- As part of the PHP shutdown process, xmlGetGlobalState is called, as shown in the following stack trace: ChildEBP RetAddr 0007f9b8 01a2d4b4 php5ts!xmlGetGlobalState+0x65 0007f9bc 01a34175 php5ts!__xmlLastError+0x14 0007f9c0 01a457d6 php5ts!xmlResetLastError+0x5 0007f9c4 01a06b63 php5ts!xmlCleanupParser+0x36 0007f9c8 01a06e95 php5ts!php_libxml_shutdown+0x13 [ext\libxml\libxml.c @ 558] 0007f9cc 018472fc php5ts!zm_shutdown_libxml+0x5 [ext\libxml\libxml.c @ 634] 0007f9e4 018dc234 php5ts!module_destructor+0x4c [Zend\zend_API.c @ 1811] 0007f9fc 018dc303 php5ts!zend_hash_apply_deleter+0x24 [Zend\zend_hash.c @ 576] 0007fa0c 018421ee php5ts!zend_hash_graceful_reverse_destroy+0x13 [Zend\zend_hash.c @ 643] 0007fa24 018fbf3a php5ts!zend_shutdown+0x2e [Zend\zend.c @ 730] 0007fa3c 018fbeef php5ts!php_module_shutdown+0x3a [main\main.c @ 1615] 0007fa4c 01832550 php5ts!php_module_shutdown_wrapper+0xf [main\main.c @ 1584] ... 0007fa54 0183268d php5isapi!DllMain+0x70 0007fa74 7c82257a php5isapi!DllMain+0x1ad 0007fa94 7c818145 ntdll!LdrpCallInitRoutine+0x14 0007fba8 77e67b95 ntdll!LdrUnloadDll+0x40e 0007fbbc 5a32843a kernel32!FreeLibrary+0x41 0007fbcc 5a3275a5 w3isapi!ISAPI_DLL::Unload+0x38 0007fbd4 5a327642 w3isapi!ISAPI_DLL::~ISAPI_DLL+0x10 0007fbe0 5a324087 w3isapi!ISAPI_DLL::`scalar deleting destructor'+0xd xmlGetGlobalState creates a thread that runs xmlGlobalStateCleanupHelper, which simply waits for the calling thread to exit, then frees the global state. Herein lies the problem. Since the thread on which xmlGlobalStateCleanupHelper is in the process of unloading the php5isapi.dll module (as shown in the stack trace), and hence also unloading php5ts.dll, when this thread finally terminates, and the xmlGetGlobalStateCleanupHelper thread resumes an access violation occurs since the module has been unloaded and the memory is no longer allocated. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38190&edit=1