ID:               33156
 Updated by:       [EMAIL PROTECTED]
 Reported By:      tomo at groovecast dot org
 Status:           Open
 Bug Type:         Scripting Engine problem
 Operating System: win32 / Cygwin
 PHP Version:      5.*, 4.* (2005-06-20)
 New Comment:

set_time_limit() does not work unter WinXP/Cygwin, Win2k/Cygwin.
Verified with 4.3.11, 4.4.0RC1, 5.0.4, 5.1.0b1, 5.1-dev.

It works on the same machine under Linux.

Reproduce code:
---------------
<?php
ini_set('display_errors', 0);    
echo "Start\n";
function boo()
{
        echo "Shutdown\n";
}
register_shutdown_function("boo");
/* not necessary, just to show the error sooner */
set_time_limit(1); 
/* infinite loop to simulate long processing */
for (;;) { }
echo "End\n";
?>

Expected result:
----------------
The script terminates after 1 second

Actual result:
--------------
The script loops until it gets interrupted:

$ date; php 005a.php; date
Mon Jun 20 09:45:11     2005
Content-type: text/html
X-Powered-By: PHP/4.3.11

Start
^C
Mon Jun 20 09:48:18     2005


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

[2005-05-28 01:33:25] tomo at groovecast dot org

I tried php5-200505272030, and the problem remains. windows native
version is not the case. It's a cygwin API problem.

cygwin's setitimer implementation is following.

at cygwin-1.5.16-1/winsup/cygwin/timer.cc:354
extern "C" int
setitimer (int which, const struct itimerval *value, struct itimerval
*ovalue)
{
  if (which != ITIMER_REAL)
    {
      set_errno (EINVAL);
      return -1;
    }
--snipped--

As you can see setitimer(ITIMER_PROF, ...) fails, and no signal will be
generated.

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

[2005-05-27 08:49:07] [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-05-27 01:18:04] tomo at groovecast dot org

Description:
------------
Since Cygwin-1.5.16-1 implements setitimer (ITIMER_REAL, ...) only,
tests/func/005a.phpt test always fails. This problem also happens with
php5.



Reproduce code:
---------------
tests/func/005a.phpt contents.

Expected result:
----------------
Start
Shutdown



Actual result:
--------------
Start



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


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

Reply via email to