|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33156 cygwin version of setitimer doesn't accept ITIMER_PROF
Submitted: 2005-05-27 01:18 UTC Modified: 2005-07-12 09:19 UTC
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:3 (100.0%)
From: tomo at groovecast dot org Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.*, 4.* (2005-06-20) OS: win32 / Cygwin
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: tomo at groovecast dot org
New email:
PHP Version: OS:


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

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-27 08:49 UTC]
Please try using this CVS snapshot:
For Windows:

 [2005-05-28 01:33 UTC] 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/
extern "C" int
setitimer (int which, const struct itimerval *value, struct itimerval *ovalue)
  if (which != ITIMER_REAL)
      set_errno (EINVAL);
      return -1;

As you can see setitimer(ITIMER_PROF, ...) fails, and no signal will be generated.
 [2005-06-20 13:20 UTC]
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:
ini_set('display_errors', 0);    
echo "Start\n";
function boo()
	echo "Shutdown\n";
/* not necessary, just to show the error sooner */
/* 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

Mon Jun 20 09:48:18     2005
 [2005-06-23 12:03 UTC]
Verified with PHP5.1.0b2
 [2005-06-25 12:33 UTC]
Verified with php5-200506250830
 [2005-06-29 21:31 UTC]
I've made a patch that fixes this:

With it, I've been able to finish 'make test', which was impossible otherwise.
 [2005-07-12 09:19 UTC]
Fixed in CVS HEAD, PHP_5_0 and PHP_4_4.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Jan 22 02:01:24 2021 UTC