com php-src: Workaround to fix bug #74093 (Maximum execution time of n+2 seconds exceed not written in error_log): NEWS Zend/z end_execute_API.c

[email protected] (Xinchen Hui)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    1242f53ddb018cdba93a9ffe4f56554a6471901f
Author:    Xinchen Hui <[email protected]>         Wed, 15 Feb 2017 12:27:56 +0800
Parents:   930ce02048471361bd0016ebf99d26bc5fdb4d04
Branches:  PHP-7.1 master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=1242f53ddb018cdba93a9ffe4f56554a6471901f

Log:
Workaround to fix bug #74093 (Maximum execution time of n+2 seconds exceed not written in error_log)

Use a different exit code for hard_timeout, 124 is used by linux
timeout:http://man7.org/linux/man-pages/man1/timeout.1.html
"If the command times out, and --preserve-status is not set, then exit with status 124"

Bugs:
https://bugs.php.net/74093

Changed paths:
  M  NEWS
  M  Zend/zend_execute_API.c


Diff:
diff --git a/NEWS b/NEWS
index 4dfcf14..a5c22b1 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ PHP                                                                        NEWS
 ?? ??? 2017, PHP 7.1.3
 
 - Core:
+  . Fixed bug #74093 (Maximum execution time of n+2 seconds exceed not written
+    in error_log). (Laruence)
   . Fixed bug #73989 (PHP 7.1 Segfaults within Symfony test suite).
     (Dmitry, Laruence)
   . Fixed bug #74084 (Out of bound read - zend_mm_alloc_small). (Laruence)
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 8f79881..e021985 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -1203,7 +1203,7 @@ static void zend_timeout_handler(int dummy) /* {{{ */
 		if (output_len > 0) {
 			write(2, log_buffer, MIN(output_len, sizeof(log_buffer)));
 		}
-		_exit(1);
+		_exit(124);
     }
 #endif
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.