php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75081 pending signals limit
Submitted: 2017-08-17 07:02 UTC Modified: -
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: konrad dot baumgart at moneyhouse dot de Assigned:
Status: Open Package: PCNTL related
PHP Version: 7.1.8 OS: Ubuntu 16.04
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: konrad dot baumgart at moneyhouse dot de
New email:
PHP Version: OS:

 

 [2017-08-17 07:02 UTC] konrad dot baumgart at moneyhouse dot de
Description:
------------
It seems php 'remembers' only first 32 signals that it receives between calls to pcntl_signal_dispatch() (or ticks).

There should be infinite queue of pending signals (or very large like 2^16 entries, or at least have current behavior described in documentation).

Current behavior is non intuitive, I tested similar C application:
- i suspended it
- i sent it many signals
- i woke it up
- it received 1 signal of each kind

Test script:
---------------
<?php
pcntl_signal(SIGTERM, function () {
    echo 'SIGALED' . PHP_EOL;
});
pcntl_signal(SIGCONT, function () {
});

for ($j = 0; $j < 32 /* works for 31*/; $j++) {
    exec('kill -' . SIGCONT . ' ' . posix_getpid());
}
exec('kill ' . posix_getpid());
pcntl_signal_dispatch();


Expected result:
----------------
'SIGALED' is outputted

Actual result:
--------------
nothing is outputted

Patches

Pull Requests

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 19:01:29 2024 UTC