php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75270 SIGTERM causes return code 0 from php cli
Submitted: 2017-09-27 21:27 UTC Modified: -
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: behrlich at datto dot com Assigned:
Status: Open Package: Program Execution
PHP Version: 7.0.23 OS: Ubuntu 16.04
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-09-27 21:27 UTC] behrlich at datto dot com
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. 

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Jul 17 04:01:25 2019 UTC