-
Notifications
You must be signed in to change notification settings - Fork 8k
Fix ht corruption during shutdown for bailing user stream #19849
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
base: PHP-8.3
Are you sure you want to change the base?
Conversation
This looks hacky and will likely cause leaks for resources that were not yet destroyed. |
I'm not sure there are any good solutions for bailout during shutdown. We might minimize leaking by wrapping each resource destructor call in Also note that it at least does not introduce any new leaks. The current code would already leak if the second attempt to call the destructor bails again. |
I agree this is better than before, and this is similar to how we handle bailouts in |
Okay, I adjusted the code to keep closing resources even after bailout, so that the resources don't leak. |
Unfortunately the Windows issue is legit, but I don't know what causes it and I don't have a Windows machine to test it. |
I've tried running the test in a VM, but it passed |
That termsig code converts to 0xc00000ff in hex. That means STATUS_BAD_FUNCTION_TABLE. Prediction: if you run CI without JIT, issue disappears? |
FWIW I can reproduce the issue with a release build on Windows,~~ even without this PR but with the test in this PR. Doesn't even need JIT/opcache.~~ EDIT: no wait, it does need the patch, this is über confusing.
|
For some reason it works when you don't remove the try-catch in zend_execute_API.c... |
So, goto misoptimization or something? |
This reverts commit 026b1f0.
I thought that first too. |
Alternatively if looping / goto is an issue, zend_try around the |
Seems like neither worked... If this is an existing issue, maybe it's ok to skip the test on Windows? |
This sucks, because reproducing it is also flaky. Yesterday it seemed like it is pre-existing but now it doesn't reproduce anymore. I'll try to have one more look again under a debugger in the hopes I can figure out why it is failing. |
Thanks for your effort! I was just asking because I'm unable to help. :) But if you prefer we can wait until the issue is solved. |
Fixes GH-19844