Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix inconsistent behavior when zend-max-execution-timers is enabled #19786

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

Closed
Appla wants to merge 1 commit into php:PHP-8.3 from Appla:fix_zend_max_execution_timer_v1

Conversation

Copy link
Contributor

@Appla Appla commented Sep 10, 2025

When zend-max-execution-timers is enabled, this test case consistently fails.
This patch aligns its behavior with other types of timeout implementations.

I'm unsure whether related code paths—such as main.c#L2523 and php_cli_server.c#L2278—should also be updated.

Copy link
Member

iluuu1994 commented Sep 10, 2025
edited
Loading

From what I understand, this happens because zend_timeout_handler() installs the EG(hard_timeout) handler, but zend_interrupt_helper() immediately calls zend_timeout(), which calls zend_set_timeout_ex(0, 1);. This clears the installed hard timeout and makes the shutdown procedure loop forever.

I wonder whether we should call zend_set_timeout_ex(0, 1); in zend_timeout() at all? Maybe you know, @arnaud-lb? Removing it also resolves the issue, though your patch likely also makes sense to unify the different timers.

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable as-is, awaiting Arnaud's answer for my question. 🙂

Copy link
Member

@iluuu1994 I'm not sure, but I think that calling zend_set_timeout_ex(0, 1) is necessary because the signal handler is set with SA_RESETHAND in some cases, so it needs to be reinstalled after it fires.

The proposed change looks right to me, and is consistent with other timeout implementations.

iluuu1994 reacted with thumbs up emoji

Copy link
Member

Thank you @Appla!

iluuu1994 added a commit that referenced this pull request Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@iluuu1994 iluuu1994 iluuu1994 approved these changes

@dstogov dstogov Awaiting requested review from dstogov dstogov is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /