[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-cvs
Subject:    [PHP-CVS] [php-src] PHP-8.1: Attempt to fix gh11498.phpt on MSAN
From:       Ilija Tovilo <noreply () php ! net>
Date:       2023-06-30 7:56:37
Message-ID: CHhEnojPCAZo0YGdpjARtKdqvuQD6cyecpRVVWM () main ! php ! net
[Download RAW message or body]

Author: Ilija Tovilo (iluuu1994)
Date: 2023-06-30T09:39:19+02:00

Commit: https://github.com/php/php-src/commit/07dd0c80a8d530721d69471a7ce81cd60524ac95
Raw diff: https://github.com/php/php-src/commit/07dd0c80a8d530721d69471a7ce81cd60524ac95.diff

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.

Changed paths:
  M  ext/pcntl/tests/gh11498.phpt


Diff:

diff --git a/ext/pcntl/tests/gh11498.phpt b/ext/pcntl/tests/gh11498.phpt
index a9dc784ff6aa..4a9f87a94d82 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;
 }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic