diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index e8b70840b7831..0c3917163d80d 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -830,6 +830,17 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) / /* We must re-initialize function again */ fci_cache->function_handler = NULL; } + + /* This flag is regularly checked while running user functions, but not internal + * So see whether interrupt flag was set while the function was running... */ + if (EG(vm_interrupt)) { + EG(vm_interrupt) = 0; + if (EG(timed_out)) { + zend_timeout(); + } else if (zend_interrupt_function) { + zend_interrupt_function(EG(current_execute_data)); + } + } } zend_vm_stack_free_call_frame(call); diff --git a/ext/pcntl/tests/async_signals_2.phpt b/ext/pcntl/tests/async_signals_2.phpt new file mode 100644 index 0000000000000..be631bab5ef35 --- /dev/null +++ b/ext/pcntl/tests/async_signals_2.phpt @@ -0,0 +1,29 @@ +--TEST-- +Async signals in zend_call_function +--SKIPIF-- + +--FILE-- +getMessage(), "\n"; +} + +?> +--EXPECT-- +Alarm! diff --git a/tests/basic/timeout_variation_10.phpt b/tests/basic/timeout_variation_10.phpt index b067238db500e..7680c96adf781 100644 --- a/tests/basic/timeout_variation_10.phpt +++ b/tests/basic/timeout_variation_10.phpt @@ -5,8 +5,6 @@ Timeout within shutdown function, variation if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (PHP_OS_FAMILY !== "Windows") die("skip Windows only test"); ?> ---XFAIL-- -Missing timeout check in call_user_function --FILE-- ---XFAIL-- -Missing timeout check in call_user_function --FILE--