Skip to content

Commit

Permalink
Attempt to fix gh11498.phpt on MSAN
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
iluuu1994 committed Jun 30, 2023
1 parent d7d3669 commit 07dd0c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ext/pcntl/tests/gh11498.phpt
Expand Up @@ -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;
}
Expand Down

0 comments on commit 07dd0c8

Please sign in to comment.