From 07dd0c80a8d530721d69471a7ce81cd60524ac95 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 30 Jun 2023 09:39:19 +0200 Subject: [PATCH] Attempt to fix gh11498.phpt on MSAN The issue might be that due to slow instrumentation the process might end before we get to add it to the processes list. If the SIGCHLD handler executes before adding the process to the list it will never be removed again. --- ext/pcntl/tests/gh11498.phpt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/pcntl/tests/gh11498.phpt b/ext/pcntl/tests/gh11498.phpt index a9dc784ff6a..4a9f87a94d8 100644 --- a/ext/pcntl/tests/gh11498.phpt +++ b/ext/pcntl/tests/gh11498.phpt @@ -19,7 +19,8 @@ pcntl_signal(SIGCHLD, function($sig, $info) use (&$processes) { }, false); for ($i = 0; $i <= 5; $i++) { - $process = proc_open('echo $$ > /dev/null', [], $pipes); + // Sleeping ensures we get to add the process to the list before the signal is invoked. + $process = proc_open('sleep 1', [], $pipes); $pid = proc_get_status($process)['pid']; $processes[$pid] = $process; }