GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Zend: user opcode DISPATCH runs on a stale frame in the TAILCALL VM. by devnexen · Pull Request #24109 · php/php-src

Conversation

@devnexen

@devnexen devnexen commented Oct 3, 2026

Copy link
Copy Markdown
Member

Fix #24081

ZEND_VM_DISPATCH() ran the CALL variant of the handler and returned its next opline to execute_ex(), whose execute_data still pointed at the entry frame. It now tail calls the TAILCALL variant of the handler.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@devnexen
Zend: user opcode DISPATCH runs on a stale frame in the TAILCALL VM.
9512c51
Fix php#24081

ZEND_VM_DISPATCH() ran the CALL variant of the handler and returned its
next opline to execute_ex(), whose execute_data still pointed at the
entry frame. It now tail calls the TAILCALL variant of the handler.
@github-actions github-actions Bot added Category: Engine ABI break labels Oct 3, 2026
@devnexen devnexen linked an issue Oct 3, 2026 that may be closed by this pull request
[Bug] User opcode handlers resume execution against a stale frame under ZEND_VM_KIND_TAILCALL #24081
Closed
@devnexen
add test
5952ca9
@github-actions github-actions Bot added the Extension: zend_test label Oct 3, 2026
@devnexen
fix test attempt
9481086
@devnexen
devnexen marked this pull request as ready for review October 4, 2026 06:21
@devnexen
devnexen requested a review from dstogov as a code owner October 4, 2026 06:21
@devnexen
devnexen requested a review from arnaud-lb October 4, 2026 06:21
This was referenced Oct 4, 2026
feat: PHP 8.6 support for user opcode hooks (tail-call VM bug diagnosed, fixed upstream) lisachenko/z-engine#281
Merged
User opcode handlers corrupt VM state under PHP 8.6's tail-call VM (macOS arm64) lisachenko/z-engine#280
Closed
arnaud-lb
arnaud-lb approved these changes Oct 9, 2026
View reviewed changes

@arnaud-lb arnaud-lb left a comment

Copy link
Copy Markdown
Member

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.

Looks good to me!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@arnaud-lb

arnaud-lb commented Oct 9, 2026

Copy link
Copy Markdown
Member

NB: This should target 8.5

devnexen reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@devnexen devnexen closed this in 2cf7ad0 Oct 9, 2026
@LamentXU123

LamentXU123 commented Oct 10, 2026

Copy link
Copy Markdown
Member

Hey! This is causing test failure in arm CI. https://app.circleci.com/pipelines/github/php/php-src/35749/workflows/4693c978-fcc7-4f13-afeb-64d14f914b5b/jobs/35387 Ideas ? @devnexen @arnaud-lb

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@devnexen

devnexen commented Oct 10, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

I think can be fixed with zend_test.observer.show_output=1 (just because I remember someone fixed case like this that way not so long ago). will push a PR soon-ish

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@devnexen
devnexen deleted the gh24081 branch October 10, 2026 08:12
lisachenko pushed a commit to lisachenko/z-engine that referenced this pull request Oct 10, 2026
@claude
feat(hook): retire the tail-call VM guard - php-src fixed the dispatch (
b005b3c
#280)

php/php-src#24109 (merged into PHP-8.6 as 2cf7ad0) makes the generated
ZEND_USER_OPCODE_SPEC_TAILCALL_HANDLER resume the DISPATCH result inside
the tail-call chain instead of returning it to execute_ex()'s stale
frame, so OpCode::setHandler() no longer needs to refuse on
VM_KIND_TAILCALL. Remove the guard, its exception factory, the issue-280
probe ladder and the dispatch-only diagnose workflow; keep Core::vmKind()
as plain engine introspection, and keep the every-leg hook coverage the
guard test introduced as OpCodeHookLifecycleTest (the gap that let #280
ship unnoticed was that all other hook tests are internal-group only).
Docs now record the bug as fixed upstream rather than as a live caveat.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01U4cKi87mVQ896uSrw592fG
lisachenko pushed a commit to lisachenko/zdebug that referenced this pull request Oct 10, 2026
@claude
ci: require the macOS arm64 + PHP 8.6 leg - upstream tail-call VM bug…
ec393d2
… fixed

php-src fixed the user-opcode dispatch under the tail-call VM
(lisachenko/z-engine#280, resolved by php/php-src#24109 merged into
PHP-8.6), and current 8.6 nightlies run engine hooks cleanly on Apple
Silicon, so the experimental escape hatch comes off: the arm64 + 8.6 leg
fails the workflow like every other leg again. Docs record the bug as
fixed instead of as a platform exception.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01U4cKi87mVQ896uSrw592fG
@lisachenko lisachenko mentioned this pull request Oct 10, 2026
ci: test ZDebug on the PHP 8.6 beta via z-engine 8.6.x-dev lisachenko/zdebug#24
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@arnaud-lb arnaud-lb arnaud-lb approved these changes
@dstogov dstogov Awaiting requested review from dstogov dstogov is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

ABI break Category: Engine Extension: zend_test

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Bug] User opcode handlers resume execution against a stale frame under ZEND_VM_KIND_TAILCALL

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@devnexen @arnaud-lb @LamentXU123
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.