-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP Embed SAPI not saving and restoring signal handlers. #8029
Comments
PHP 7.4 is no longer actively supported, but I assume this affects newer versions as well. The problem is that we don't call |
Ah yes thank you, you are correct. I will retest on newer versions but I think you're correct. |
@theonemcdonald Did you verify if this affects newer PHP versions as well? |
Finally had a chance to test on a newer PHP version: v8.1.6 to be specific. This appears to still be an issue. I've been working on a side project to add scripting support to another project. What I'm seeing here is a stack overflow when the main program is shutting down. It still isn't clear to me if there is something incorrect with the host program or with PHP.
Edit: Some more to the story. The host program has a plugin API with several callbacks. Instead of wrapping the embed call, I decided to try invoking
More evidence of signal confusion For interested parties, the project I am working on adding scripting support to is https://github.com/clicon/clixon, plugin documentation at https://clixon-docs.readthedocs.io/en/latest/plugins.html?highlight=signal#plugin-callback-guidelines, not that I expect anyone here in this community in particular to diagnose an issue there, but there's obviously an edge case here that I think we all could benefit from understanding a root cause |
I'm not 100% sure (and I only tested with PHP 7.4.11), but I have a problem which I think is related to this. Haven't done much testing, I opt'ed to recompile and disable ZEND_SIGNALS as a workaround.
|
I'm tinkering with this again, any thoughts? |
I believe I have a fix worth submitting: #9672 Basically the original signal handlers are already being saved in the true global |
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:
Without the signal save/restore wrapping the embed block, the zend_signal_handler and defer handler is still handling the dispatching of signals, which is likely not what a user would want once outside an embed block.
PHP Version
7.4.27
Operating System
No response
The text was updated successfully, but these errors were encountered: