[php-src] Issue #8029: PHP Embed SAPI not saving and restoring signal handlers.

From: Date: Thu, 03 Feb 2022 17:21:55 +0000
Subject: [php-src] Issue #8029: PHP Embed SAPI not saving and restoring signal handlers.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-239457@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/8029 Author: theonemcdonald ### Description I would expect the the execution context to be restored following the PHP_EMBED_END_BLOCK() macro, but this doesn't seem to be the case for signal handlers. here is a toy function to call a php function from a specified file: ```C /* Early work to call a php function from a specified script file */ void call_php_function(char *file_name, char *function_name) { zend_file_handle file_handle; zval retval = {0}; zend_fcall_info fci = {0}; zend_fcall_info_cache fci_cache = {0}; sigset_t oldsigset; struct sigaction oldsigaction[32] = {0,}; some_signal_save_function(&oldsigset, oldsigaction); PHP_EMBED_START_BLOCK(0, NULL) zend_stream_init_filename(&file_handle, file_name); php_execute_script(&file_handle); ZVAL_STRING(&fci.function_name, function_name); fci.size = sizeof fci; fci.retval = &retval; zend_call_function(&fci, &fci_cache); PHP_EMBED_END_BLOCK() some_signal_restore_function(&oldsigset, oldsigaction); } ``` ### PHP Version 7.4.27 ### Operating System _No response_

« previous php.bugs (#239457) next »