Skip to content

Commit 54248b1

Browse files
NattyNarwhalnikic
authored andcommitted
IBM i PASE doesn't support ITIMER_PROF
Like Cygwin, this platform needs to use a real-time timer. This was based on a patch by @kadler, but it didn't handle unsetting the timer, so the timeout would continue to be active, triggering `hard_timeout` unexpectedly. The patch is fixed to handle unsetting. Closes GH-6503.
1 parent 10c9d61 commit 54248b1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Zend/zend_execute_API.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@ static void zend_set_timeout_ex(zend_long seconds, int reset_signals) /* {{{ */
12941294
t_r.it_value.tv_sec = seconds;
12951295
t_r.it_value.tv_usec = t_r.it_interval.tv_sec = t_r.it_interval.tv_usec = 0;
12961296

1297-
# ifdef __CYGWIN__
1297+
# if defined(__CYGWIN__) || defined(__PASE__)
12981298
setitimer(ITIMER_REAL, &t_r, NULL);
12991299
}
13001300
signo = SIGALRM;
@@ -1356,7 +1356,7 @@ void zend_unset_timeout(void) /* {{{ */
13561356

13571357
no_timeout.it_value.tv_sec = no_timeout.it_value.tv_usec = no_timeout.it_interval.tv_sec = no_timeout.it_interval.tv_usec = 0;
13581358

1359-
# ifdef __CYGWIN__
1359+
# if defined(__CYGWIN__) || defined(__PASE__)
13601360
setitimer(ITIMER_REAL, &no_timeout, NULL);
13611361
# else
13621362
setitimer(ITIMER_PROF, &no_timeout, NULL);

Zend/zend_signal.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ ZEND_API zend_signal_globals_t zend_signal_globals;
6262
static void zend_signal_handler(int signo, siginfo_t *siginfo, void *context);
6363
static int zend_signal_register(int signo, void (*handler)(int, siginfo_t*, void*));
6464

65-
#ifdef __CYGWIN__
65+
#if defined(__CYGWIN__) || defined(__PASE__)
66+
/* Matches zend_excute_API.c; these platforms don't support ITIMER_PROF. */
6667
#define TIMEOUT_SIG SIGALRM
6768
#else
6869
#define TIMEOUT_SIG SIGPROF

0 commit comments

Comments
 (0)