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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 09:01:27 2024 UTC