From 39f3374be5611cdea90c3fe9b69ba7622244c8bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Sun, 29 Oct 2023 12:17:48 +0100 Subject: [PATCH 1/2] fix: don't delete an unitialized timer (#12537) --- Zend/zend_max_execution_timer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Zend/zend_max_execution_timer.c b/Zend/zend_max_execution_timer.c index b1c83e9cbb3..480631dcb16 100644 --- a/Zend/zend_max_execution_timer.c +++ b/Zend/zend_max_execution_timer.c @@ -41,12 +41,13 @@ ZEND_API void zend_max_execution_timer_init(void) /* {{{ */ sev.sigev_signo = SIGRTMIN; sev.sigev_notify_thread_id = (pid_t) syscall(SYS_gettid); - EG(pid) = getpid(); // Measure wall time instead of CPU time as originally planned now that it is possible https://github.com/php/php-src/pull/6504#issuecomment-1370303727 if (timer_create(CLOCK_BOOTTIME, &sev, &EG(max_execution_timer_timer)) != 0) { zend_strerror_noreturn(E_ERROR, errno, "Could not create timer"); } + EG(pid) = getpid(); + # ifdef MAX_EXECUTION_TIMERS_DEBUG fprintf(stderr, "Timer %#jx created on thread %d\n", (uintmax_t) EG(max_execution_timer_timer), sev.sigev_notify_thread_id); # endif From 29dbc4ae83ba06c16d2ba37a5689352b7e3e057d Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Sun, 29 Oct 2023 12:19:56 +0100 Subject: [PATCH 2/2] [ci skip] NEWS --- NEWS | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS b/NEWS index ee42cf7c4eb..6dac57d6a3b 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ PHP NEWS . Fixed bug GH-12468 (Double-free of doc_comment when overriding static property via trait). (ilutov) . Fixed segfault caused by weak references to FFI objects. (sj-i) + . Fixed max_execution_time: don't delete an unitialized timer. (Kévin Dunglas) - DOM: . Fix registerNodeClass with abstract class crashing. (nielsdos)