Skip to content

Commit 07dd0c8

Browse files
committed
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.
1 parent d7d3669 commit 07dd0c8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/pcntl/tests/gh11498.phpt

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ pcntl_signal(SIGCHLD, function($sig, $info) use (&$processes) {
1919
}, false);
2020

2121
for ($i = 0; $i <= 5; $i++) {
22-
$process = proc_open('echo $$ > /dev/null', [], $pipes);
22+
// Sleeping ensures we get to add the process to the list before the signal is invoked.
23+
$process = proc_open('sleep 1', [], $pipes);
2324
$pid = proc_get_status($process)['pid'];
2425
$processes[$pid] = $process;
2526
}

0 commit comments

Comments
 (0)