#37558 [Opn->Asn]: timeout functionality doesn't work after a second PHP starup on the same thread

From: Date: Wed, 24 May 2006 20:07:20 +0000
Subject: #37558 [Opn->Asn]: timeout functionality doesn't work after a second PHP starup on the same thread
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-97536@lists.php.net to get a copy of this message
ID: 37558 Updated by: tony2001@php.net 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

« previous php.bugs (#97536) next »