ID:               37558
 Updated by:       [EMAIL PROTECTED]
 Reported By:      p dot desarnaud at wanadoo dot fr
-Status:           Open
+Status:           Assigned
 Bug Type:         Scripting Engine problem
 Operating System: win32
 PHP Version:      5CVS-2006-05-23 (snap)
-Assigned To:      
+Assigned To:      dmitry


Previous Comments:
------------------------------------------------------------------------

[2006-05-23 08:22:33] p dot desarnaud at wanadoo dot fr

Description:
------------
On win32 platform, if I try to startup/shutdown PHP several times
during the same thread, after the 2nd startup, the timeout
functionality doesn't work, and there is an Windows exception (invalid
handle) during the 2nd shutdown.

Reproduce code:
---------------
// 1° startup
php_module_startup(...) 
.... 
php_module_shutdown(..)
..
// 2° startup/shutdown
php_module_startup(...) 
// from now the function zend_set_timeout() will not work

Actual result:
--------------
The static variable timeout_thread_initalized declared in the file
zend_execute_API.c is not reset to 0 after a shutdown, and so, the next
startup will not initialize the timeout thread, and the next shutdown
will try to close an invalid handle
"CloseHandle(timeout_thread_handle)" inside the function
zend_shutdown_timeout_thread(), and I get an exception .

The patch to solve the problem :

--- fix/zend_execute_API.c 2006-04-21 00:49:20.000000000 +0200
+++ zend_execute_API.c 2006-05-23 09:20:38.953125000 +0200
@@ -1339,6 +1339,7 @@
/* Wait for thread termination */
WaitForSingleObject(timeout_thread_handle, 5000);
CloseHandle(timeout_thread_handle);
+ timeout_thread_initialized=0;
}
#endif


But, is it allowed to startup/shutdown several times during the same
thread ???
If yes: there is a bug on Win32... If no: there is no bug.. 


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37558&edit=1

Reply via email to