Bug #78717 [NEW]: pcntl_waitpid does not return process PID on child exit
From: simon at podlipsky dot net
Operating system: MacOS Catalina
PHP version: 7.3.10
Package: PCNTL related
Bug Type: Bug
Bug description:pcntl_waitpid does not return process PID on child exit
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 bug report at https://bugs.php.net/bug.php?id=78717&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=78717&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78717&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78717&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78717&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78717&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78717&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78717&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78717&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78717&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78717&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=78717&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=78717&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78717&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78717&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78717&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78717&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78717&r=mysqlcfg
Thread (9 messages)
- simon at podlipsky dot net