From b09c2f899ebc14029d0936d770cced10b607f84b Mon Sep 17 00:00:00 2001 From: David Walker Date: Mon, 19 Dec 2016 14:29:18 -0700 Subject: Fixed bug #73783 Bug #73783 raises an issue with signal handling when using SIG_IGN. With PHP7.1 ZEND_SIGNALS is defaulted to on, which will for all signals set the handler as zend_signal_handler_defer. This is problematic for syscalls like sleep(), which will only return when the requisite number of seconds have elapsed, or, a non-ignored signal is raised. In this case we want to SIG_IGN SIGCHLD, however, SIG_IGN is only stored in the SIGG(handlers) array, and the actual system level handler is defined. This prevents proper signal ignoring when requeted. --- ext/pcntl/tests/bug73783.phpt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 ext/pcntl/tests/bug73783.phpt (limited to 'ext/pcntl/tests') diff --git a/ext/pcntl/tests/bug73783.phpt b/ext/pcntl/tests/bug73783.phpt new file mode 100644 index 0000000000..beacdf6b8d --- /dev/null +++ b/ext/pcntl/tests/bug73783.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #73783: (SIG_IGN needs to be set to prevent syscals from returning early) +--SKIPIF-- + +--FILE-- += 0.8) { + echo "working\n"; +} else { + echo "failed\n"; +} +?> +--EXPECTF-- +working -- cgit v1.2.1