Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:3399 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81989 invoked from network); 13 Jul 2003 02:17:36 -0000 Received: from unknown (HELO netphobia.fi) (213.243.181.8) by pb1.pair.com with SMTP; 13 Jul 2003 02:17:36 -0000 Received: from localhost (jani@localhost) by netphobia.fi (8.11.6/8.11.6) with ESMTP id h6D2HWx30672; Sun, 13 Jul 2003 05:17:33 +0300 X-Authentication-Warning: netphobia.fi: jani owned process doing -bs Date: Sun, 13 Jul 2003 05:17:32 +0300 (EEST) Sender: jani@netphobia.fi Reply-To: Jani Taskinen To: andi@zend.com, cc: internals@lists.php.net Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: execution timeout causes lockups in ZTS mode.. From: sniper@iki.fi (Jani Taskinen) See bug #16820 for the discussion. This patch supposedly fixes it: diff -urN php-4.2.3/Zend/zend_execute.c php-4.2.3-TO/Zend/zend_execute.c --- php-4.2.3/Zend/zend_execute.c Sun Jan 6 16:21:09 2002 +++ php-4.2.3-TO/Zend/zend_execute.c Wed Dec 18 08:51:55 2002 @@ -1047,7 +1047,7 @@ } while (1) { -#ifdef ZEND_WIN32 +#if defined(ZEND_WIN32) || defined(ZTS) if (EG(timed_out)) { zend_timeout(0); } diff -urN php-4.2.3/Zend/zend_execute_API.c php-4.2.3-TO/Zend/zend_execute_API.c --- php-4.2.3/Zend/zend_execute_API.c Sun Jan 6 16:21:09 2002 +++ php-4.2.3-TO/Zend/zend_execute_API.c Wed Dec 18 08:57:33 2002 @@ -152,7 +152,7 @@ EG(orig_error_reporting) = EG(error_reporting); EG(full_tables_cleanup) = 0; -#ifdef ZEND_WIN32 +#if defined(ZEND_WIN32) || defined(ZTS) EG(timed_out) = 0; #endif } @@ -667,6 +667,14 @@ EG(timeout_seconds), EG(timeout_seconds) == 1 ? "" : "s"); } +#ifdef ZTS +static void zend_timeout_ZTS(int dummy) +{ + TSRMLS_FETCH(); + + EG(timed_out)=1; +} +#endif #ifdef ZEND_WIN32 static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) @@ -786,7 +794,11 @@ t_r.it_value.tv_usec = t_r.it_interval.tv_sec = t_r.it_interval.tv_usec = 0; setitimer(ITIMER_PROF, &t_r, NULL); +#ifdef ZTS + signal(SIGPROF, zend_timeout_ZTS); +#else signal(SIGPROF, zend_timeout); +#endif sigemptyset(&sigset); sigaddset(&sigset, SIGPROF); sigprocmask(SIG_UNBLOCK, &sigset, NULL); diff -urN php-4.2.3/Zend/zend_globals.h php-4.2.3-TO/Zend/zend_globals.h --- php-4.2.3/Zend/zend_globals.h Thu Aug 15 02:25:57 2002 +++ php-4.2.3-TO/Zend/zend_globals.h Wed Dec 18 08:58:27 2002 @@ -164,7 +164,7 @@ /* for extended information support */ zend_bool no_extensions; -#ifdef ZEND_WIN32 +#if defined(ZEND_WIN32) || defined (ZTS) zend_bool timed_out; #endif