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:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC