Bug #75270 [NEW]: SIGTERM causes return code 0 from php cli

From: Date: Wed, 27 Sep 2017 21:27:43 +0000
Subject: Bug #75270 [NEW]: SIGTERM causes return code 0 from php cli
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-211402@lists.php.net to get a copy of this message
From: behrlich at datto dot com Operating system: Ubuntu 16.04 PHP version: 7.0.23 Package: Program Execution Bug Type: Bug Bug description:SIGTERM causes return code 0 from php cli Description: ------------ kill -TERM [php pid] PHP CLI returns 0 rather than the expected 143 (128 + interrupt code). This is NOT the case for other interrupts, for example SIGINT results in return code 130 (128 + 2) as expected. I am not able to reproduce this in PHP 5. I can work around this by using the pcntl_signal handlers to correct the response codes, but this involves enabling ticks which is undesirable for my application. Test script: --------------- #!/usr/bin/php -q <?php sleep(120); #(interrupt this process with kill -TERM [pid]) Expected result: ---------------- Program return code 143 for SIGTERM. Actual result: -------------- Program return code 0 for SIGTERM. -- Edit bug report at https://bugs.php.net/bug.php?id=75270&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75270&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75270&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75270&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=75270&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=75270&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=75270&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=75270&r=needscript Try newer version: https://bugs.php.net/fix.php?id=75270&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=75270&r=support Expected behavior: https://bugs.php.net/fix.php?id=75270&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=75270&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=75270&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=75270&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75270&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=75270&r=dst IIS Stability: https://bugs.php.net/fix.php?id=75270&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=75270&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=75270&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=75270&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=75270&r=mysqlcfg

« previous php.bugs (#211402) next »