diff --git a/NEWS b/NEWS index d52836f2709..392d9047d63 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ PHP NEWS - Core: . Fixed bug GH-14315 (Incompatible pointer type warnings). (Peter Kokot) + . Fixed bug GH-12814 (max_execution_time reached too early on MacOS 14 + when running on Apple Silicon). (Manuel Kress) - Curl: . Fixed bug GH-14307 (Test curl_basic_024 fails with curl 8.8.0). (nielsdos) diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 63967a97a74..e9b6009af05 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1555,7 +1555,9 @@ static void zend_set_timeout_ex(zend_long seconds, bool reset_signals) /* {{{ */ t_r.it_value.tv_sec = seconds; t_r.it_value.tv_usec = t_r.it_interval.tv_sec = t_r.it_interval.tv_usec = 0; -# if defined(__CYGWIN__) || defined(__PASE__) +# if defined(__CYGWIN__) || defined(__PASE__) || (defined(__aarch64__) && defined(__APPLE__)) + // ITIMER_PROF is broken in Apple Silicon system with MacOS >= 14 + // See https://openradar.appspot.com/radar?id=5583058442911744. setitimer(ITIMER_REAL, &t_r, NULL); } signo = SIGALRM; @@ -1619,7 +1621,7 @@ void zend_unset_timeout(void) /* {{{ */ 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; -# if defined(__CYGWIN__) || defined(__PASE__) +# if defined(__CYGWIN__) || defined(__PASE__) || (defined(__aarch64__) && defined(__APPLE__)) setitimer(ITIMER_REAL, &no_timeout, NULL); # else setitimer(ITIMER_PROF, &no_timeout, NULL);