|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75859 signal handler error promoted from error to fatal error, undocumented
Submitted: 2018-01-23 03:49 UTC Modified: -
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: divinity76 at gmail dot com Assigned:
Status: Open Package: PCNTL related
PHP Version: 7.2.1 OS: Debian 9 x64and ubuntu 16.04 x64
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-01-23 03:49 UTC] divinity76 at gmail dot com
somewhere between 7.0.21 and 7.2.1 , pcntl_signal failing by trying to install a handler for SIGKILL was promoted from a catchable E_??  to a fatal error, and it's not documented. and imo, it's not an improvement (yes, it's an error and it should be reported, but it shouldn't be a _fatal_ error)

and LawnGnome@freenode #php  said: 
<LawnGnome> (...) It appears to have been due to ZEND_SIGNALS being flipped to on by default in PHP 7.1.0, which changed the codepath that installs the signal handler to one that fatals on error instead of warning. (The reason for that in general was to support asynchronous signal handling.)
<LawnGnome> I'd suggest opening a bug at — I don't know if the fix will be to change the behaviour of the signal handler installation or to update the docs, but obviously one or the other needs to happen.

Test script:
@pcntl_signal ( SIGKILL, "printf" );
echo "not fatal!";

Expected result:
not fatal!

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-03-01 21:34 UTC] hasan dot paknia at gmail dot com
Just letting you know it's happening also on version 7.1:

# php -version
PHP 7.1.15 (cli) (built: Feb 28 2018 14:06:54) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.15, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans

And I'm not able to install SIGSTOP handler:

// pcntl_signal(SIGSTOP, 'handleSignal');
Fatal error: Error installing signal handler for 19 in ...
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Dec 11 07:01:31 2023 UTC