Skip to content

Fix GH-25540: Collect suspended Fibers with bound callbacks - #25550

Open
akasakariko wants to merge 1 commit into
php:PHP-8.6from
akasakariko:fix-gh-25540-pinned-receiver
Open

akasakariko wants to merge 1 commit into
php:PHP-8.6from
akasakariko:fix-gh-25540-pinned-receiver

Conversation

@akasakariko

@akasakariko akasakariko commented Nov 18, 2026 •

Copy link
Copy Markdown

Fixes #25540

The Fiber already owns and reports its callback receiver to GC, but a second reference on the C stack keeps the cycle alive while suspended

Reuse the Fiber's reference when it matches the receiver and leave pinning unchanged for other callers

Regression test: fails on unmodified PHP-8.6 and passes with the fix

  • macOS ZTS debug: 609 passed, 6 skipped
  • Linux ZTS: 331 passed, 6 skipped

The Fiber already holds a reference to fci.object and reports it to GC. Reuse that reference for the initial callback when it is the receiver instead of taking a second, unreported reference on the C stack.
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