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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: behrlich at datto dot com
New email:
PHP Version: OS:

 

 [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: Sun Sep 22 18:01:26 2019 UTC