Skip to content
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

Fix GH-17509: Apache parent and subrequest double bailout #17653

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bukka
Copy link
Member

@bukka bukka commented Jan 31, 2025

What happens is that zend_first_try sets EG(bailout) to NULL. If that happens in subrequest that shares the globals with parent request, then the EG(bailout) gets reset for the parent and if there is a bailout in the parent, it fails because the jump address is not set. I think that technically we don't really need zend_first_try but I guess it's kind of a protection against extra jump after the last bailout. This restores the parent bailout at the end of the handler so parent knows where to jump.

@bukka
Copy link
Member Author

bukka commented Jan 31, 2025

Just few notes.

It fixes GH-17509.

There is currently no test setup but I just started working on it as part of WST project: https://github.com/wstool/wst-php-apache2handler . There are still some issues that I need to sort out. After I make it work I will also add a test for this. Eventually I will also think how to best integrate it to the PHP CI.

@bukka
Copy link
Member Author

bukka commented Jan 31, 2025

Hmm doesn't look like this is completely fixed if there are more subrequests like in https://bugs.php.net/bug.php?id=80558 . Moving to draft

@bukka bukka marked this pull request as draft January 31, 2025 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant