Bug #81195 [Opn]: pcntl_fork() cause child process hungup.
| From: | requinix@php.net | Date: | Wed, 23 Jun 2021 08:44:11 +0000 |
| Subject: | Bug #81195 [Opn]: pcntl_fork() cause child process hungup. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-234601@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81195&edit=1
ID: 81195
Updated by: requinix@php.net
Reported by: jedemon at gmail dot com
Summary: pcntl_fork() cause child process hungup.
Status: Open
Type: Bug
Package: PCNTL related
Operating System: CentOS7 and Ubuntu16
PHP Version: 7.4.20
Block user comment: N
Private report: N
New Comment:
I can't reproduce on Ubuntu 18.04.
If pcntl_wait is indeed waiting then that means the process has a child, and I don't see how
your -r code could create a third (grand)child process. While it hangs, how many "php"
processes are running on the system?
Previous Comments:
------------------------------------------------------------------------
[2021-06-23 08:09:28] jedemon at gmail dot com
Description:
------------
From php7.4.11 to php7.4.20, when execute pcntl_fork(), the forked child process will not terminate.
Execute this line:
php -r "\pcntl_fork(); if(posix_getpid()){pcntl_wait(\$st);} echo
'exit'.PHP_EOL;"
and shell will hung.
This dose not happen in under PHP7.4.10, nor in above PHP8.0+. Tested on Centos7 and Ubuntu16.04.
There is no related info I can find out.
Test script:
---------------
php -r "\pcntl_fork(); if(posix_getpid()){pcntl_wait(\$st);} echo
'exit'.PHP_EOL;"
Expected result:
----------------
exit
exit
Actual result:
--------------
exit
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81195&edit=1