Bug #75859 [Com]: signal handler error promoted from error to fatal error, undocumented

From: Date: Thu, 01 Mar 2018 21:34:36 +0000
Subject: Bug #75859 [Com]: signal handler error promoted from error to fatal error, undocumented
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214172@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75859&edit=1

 ID:                 75859
 Comment by:         hasan dot paknia at gmail dot com
 Reported by:        divinity76 at gmail dot com
 Summary:            signal handler error promoted from error to fatal
                     error, undocumented
 Status:             Open
 Type:               Bug
 Package:            PCNTL related
 Operating System:   Debian 9 x64and ubuntu 16.04 x64
 PHP Version:        7.2.1
 Block user comment: N
 Private report:     N

 New Comment:

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 ...


Previous Comments:
------------------------------------------------------------------------
[2018-01-23 03:49:56] divinity76 at gmail dot com

Description:
------------
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 https://bugs.php.net/ — 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:
---------------
<?php
@pcntl_signal ( SIGKILL, "printf" );
echo "not fatal!";

Expected result:
----------------
not fatal!

Actual result:
--------------
(blank)


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=75859&edit=1


Thread (2 messages)

« previous php.bugs (#214172) next »