Skip to content

Commit 26f54eb

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: [ci skip] NEWS Fix timer leak (#13027)
2 parents bafb17a + 29cb814 commit 26f54eb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Zend/zend_max_execution_timer.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535

3636
ZEND_API void zend_max_execution_timer_init(void) /* {{{ */
3737
{
38+
pid_t pid = getpid();
39+
40+
if (EG(pid) == pid) {
41+
return;
42+
}
43+
3844
struct sigevent sev;
3945
sev.sigev_notify = SIGEV_THREAD_ID;
4046
sev.sigev_value.sival_ptr = &EG(max_execution_timer_timer);
@@ -48,9 +54,9 @@ ZEND_API void zend_max_execution_timer_init(void) /* {{{ */
4854

4955
EG(pid) = getpid();
5056

51-
# ifdef MAX_EXECUTION_TIMERS_DEBUG
57+
# ifdef MAX_EXECUTION_TIMERS_DEBUG
5258
fprintf(stderr, "Timer %#jx created on thread %d\n", (uintmax_t) EG(max_execution_timer_timer), sev.sigev_notify_thread_id);
53-
# endif
59+
# endif
5460

5561
sigaction(sev.sigev_signo, NULL, &EG(oldact));
5662
}

0 commit comments

Comments
 (0)