php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80513 php 7.4 pcntl_signal not catch SIGCHLD signal
Submitted: 2020-12-14 03:31 UTC Modified: 2020-12-14 03:41 UTC
From: simapple at qq dot com Assigned:
Status: Not a bug Package: PCNTL related
PHP Version: 7.4.13 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: simapple at qq dot com
New email:
PHP Version: OS:

 

 [2020-12-14 03:31 UTC] simapple at qq dot com
Description:
------------
php 7.4 pcntl_signal not catch SIGCHLD signal.swicth php 5.5 can catch.

Test script:
---------------
<?php
declare(ticks = 1); 

pcntl_signal(SIGCHLD,function($signal){
        echo "get signal $signal";
        pcntl_wait($status);
});



$pid = pcntl_fork();
if($pid == 0){ 
        echo " i am child ".getmypid();
        sleep(1);
        exit();
}

while(1){




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-12-14 03:41 UTC] requinix@php.net
-Status: Open +Status: Not a bug -Package: Unknown/Other Function +Package: PCNTL related
 [2020-12-14 03:41 UTC] requinix@php.net
Ticks are not reliable and depend on hidden aspects of running code. A plain while(1); loop may not work.

Use pcntl_async_signals() instead.
https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.asynchronous-signal-handling
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Dec 08 20:03:34 2021 UTC