ID:               35298
 User updated by:  alacn dot uhahaa at gmail dot com
 Reported By:      alacn dot uhahaa at gmail dot com
-Status:           No Feedback
+Status:           Open
 Bug Type:         Reproducible crash
 Operating System: Windows 2003
 PHP Version:      4.4.1
 New Comment:

its not fixed on cvs yet, it happens both on php 4.4.1 and php5
series.

it happens when iis is recycling the process, iis tell php that it will
free the library, php perform cleanup tasks and return, but, if zend
timeout thread is running while this happens and php return before zend
timeout thread end, it will crash, because the timeout thread will
execute on a freed (unloaded) place.

this is causing "zend window timeout" error on windows 2003
(for both php5 and php4)


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

[2005-11-28 01:00:02] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

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

[2005-11-20 22:20:23] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip



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

[2005-11-20 20:08:24] alacn dot uhahaa at gmail dot com

yah, i think its fixed now,

at zend_execute_API.c

[...]

static WNDCLASS wc;
static HWND timeout_window;
static HANDLE timeout_thread_event;
static DWORD timeout_thread_id;
static int timeout_thread_initialized=0;

static HANDLE timeout_thread_finish_event; //added

[...]

static unsigned __stdcall timeout_thread_proc(void *pArgs)
{
[...]
DestroyWindow(timeout_window);
UnregisterClass(wc.lpszClassName, NULL);

SetEvent(timeout_thread_finish_event); //added

return 0;
}


void zend_init_timeout_thread()
{
timeout_thread_event = CreateEvent(NULL, FALSE, FALSE, NULL);

timeout_thread_finish_event = CreateEvent(0, 0, 0, 0); //added

_beginthreadex(NULL, 0, timeout_thread_proc, NULL, 0,
&timeout_thread_id);
WaitForSingleObject(timeout_thread_event, INFINITE);
}


void zend_shutdown_timeout_thread()
{
if (!timeout_thread_initialized) {
  return;
}
PostThreadMessage(timeout_thread_id, WM_QUIT, 0, 0);

WaitForSingleObject(timeout_thread_finish_event, 30000); //added
}

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

[2005-11-20 19:45:39] alacn dot uhahaa at gmail dot com

i think that it could be fixed with WaitForSingleObject, making it wait
a bit of time to the timeout thread end.

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

[2005-11-20 19:40:01] alacn dot uhahaa at gmail dot com

the problem is at zend_execute_API.c

the access violation happens when it free the library before
timeout_thread_proc() finish,

at zend_shutdown_timeout_thread()
after PostThreadMessage it should wait some time to the
timeout_thread_proc() finish.

if it dont wait, the timeout_thread_proc() will walk in NULL bytes
because the code was released by the IIS

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/35298

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

Reply via email to