|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2021-06-23 08:09 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 17 15:00:01 2025 UTC |
got the same issue on following system: cat /etc/issue Ubuntu 20.04.2 LTS \n \l php -v PHP 7.4.21 (cli) (built: Jul 1 2021 16:09:41) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.21, Copyright (c), by Zend Technologies with blackfire v1.62.0~linux-x64-non_zts74, https://blackfire.io, by Blackfire