-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Tailcall VM interrupt crash #21922
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
morrisonlevi
wants to merge
9
commits into
php:PHP-8.5
from
morrisonlevi:vm-interrupt-tailcall-repro
Closed
Tailcall VM interrupt crash #21922
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7c26c21
Add VM interrupt tailcall helper reproducer
morrisonlevi 914efeb
Fix tailcall helper dispatch after VM interrupt
morrisonlevi 57d406a
call_interrupt_op
arnaud-lb 0c31be1
Fix zend_interrupt compilation for non-tailcall VM builds
morrisonlevi f9fd505
Fix TAILCALL delayed helper interrupt via call_interrupt_op sentinel
morrisonlevi 6af994d
Remove unused zend_interrupt CALL variant; simplify delayed helpers m…
morrisonlevi 36a1c61
Move blank line to after #endif per style nitpick
morrisonlevi 78d2dfe
Re-introduce zend_interrupt() to reduce code size
arnaud-lb c7f0fea
Fix JIT handling of interrupts
arnaud-lb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the alternative would be returning instead of tail-calling here. But that might be slower.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any thoughts @arnaud-lb ?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this would work. Possibly this may result in worse branch prediction as we revert to the main loop's central dispatch point.
Another alternative would be to make
ZEND_VM_INTERRUPT()return an opline whose handler iszend_interrupt_helper, like we do for halt_op in the HYBRID and TAILCALL VMs: https://github.com/php/php-src/compare/arnaud-lb:vm-interrupt-tailcall-repro-3. This probably requires special handling inzend_jit_trace_execute(), I haven't investigated.I've benchmarked the 3 approaches:
Results:
The Symfony results do not make sense to me, but these are stable.
Approach 3 seems better overall, speed-wise, assuming that we don't find issues with it.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh, that's a nice approach! Love it.
I don't see any issues, that approach will never have &call_interrupt_op show up in
EX(opline)or the VM IP register so that's perfect.I have no idea about the JIT code, so, I'll leave that to you :-D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pulled in your changes in the 3rd approach to let CI run while I review it in more dept (first glance looks good).