Bug #78717 [Com]: pcntl_waitpid does not return process PID on child exit
| From: | simon at podlipsky dot net | Date: | Sun, 10 Nov 2019 14:52:57 +0000 |
| Subject: | Bug #78717 [Com]: pcntl_waitpid does not return process PID on child exit | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-223668@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78717&edit=1
ID: 78717
Comment by: simon at podlipsky dot net
Reported by: simon at podlipsky dot net
Summary: pcntl_waitpid does not return process PID on child
exit
Status: Open
Type: Bug
Package: PCNTL related
Operating System: MacOS Catalina
PHP Version: 7.3.10
Block user comment: N
Private report: N
New Comment:
I has something to do with grpc extension.
pecl install grpc should enable the bug
Previous Comments:
------------------------------------------------------------------------
[2019-10-22 10:50:51] simon at podlipsky dot net
Tried on another macos catalina and it works there. Not sure what might be wrong on my side though.
Trying to investigate.
------------------------------------------------------------------------
[2019-10-22 09:48:10] simon at podlipsky dot net
I forgot to specify, sorry. We tested on linux 7.3.10 and it went smoothly. Trying to find another
mac with 7.3 installed
------------------------------------------------------------------------
[2019-10-22 09:46:08] nikic@php.net
Works for me on Linux, likely MacOS specific.
------------------------------------------------------------------------
[2019-10-22 09:36:30] simon at podlipsky dot net
Description:
------------
pcntl_waitpid() always returns 0 on php 7.3 but on 7.2 it returns PID of exited child.
Example call: $pid = pcntl_waitpid($procData['pid'], $status, WNOHANG);
This is script linked below output on php 7.2.23:
```
/usr/local/Cellar/php@7.2/7.2.23/bin/php script.php
Exiting child 0
unset child 0
```
This is the output on php 7.3.10:
```
/usr/local/Cellar/php/7.3.10/bin/php script.php
Exiting child 0
```
On PHP 7.3 the script never ends and is stuck in infinite while loop because if ($res ===
$procData['pid']) expects PID to be assigned in $res on child exit but
that never happens.
Test script:
---------------
https://gist.github.com/simPod/5a177947bdf864026bfc59d71d6e9d71
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78717&edit=1