Skip to content

Fix iOS autorelease pool lifetime across fiber yields - #94

Open
tryk016 wants to merge 1 commit into
Try:masterfrom
tryk016:codex/pr-tempest-ios-autorelease-lifetime
Open

Fix iOS autorelease pool lifetime across fiber yields#94
tryk016 wants to merge 1 commit into
Try:masterfrom
tryk016:codex/pr-tempest-ios-autorelease-lifetime

Conversation

@tryk016

@tryk016 tryk016 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

The iOS backend currently keeps a local autorelease pool alive while it dispatches an engine event. An event callback can call processEvents() again, yield to UIKit and let the surrounding run-loop pool drain before the engine fiber resumes. Popping the local pool after that can trigger an autorelease-pool badPop crash.

Remove only the pool that spans event dispatch. UIKit still provides the autorelease pool for each event-loop iteration, and the short pool used by the render callback is unchanged.

Validation:

  • reproduced the pool corruption with a focused Objective-C++ harness
  • 175/175 Tempest tests pass on macOS
  • Release builds pass for iPhoneOS arm64 and iPhone Simulator arm64 at iOS 15.0
  • an integrated probe on an iPhone 15 Pro Max completes nested processEvents() without a crash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant