Repository navigation
Fix Zend gen-0 selfhost link abort after AOT emit (#21925) - #21936
Merged
Merged
Conversation
Host php bin/compile.php linked compiler_minimal then aborted in LLVM FFI teardown (`free(): invalid pointer`). Fast-exit after successful selfhost emit, make Builder::dispose idempotent, and retry the flaky smoke binary run. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jul 21, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
compiler_minimalAOT was dying after a successful link with hostfree(): invalid pointer(exit 134), somake bootstrap-selfhost-linkstayed red once Gen-1+ #1492: bootstrap-selfhost-link Zend gen-0 — SuperglobalRefreshJitHelper::buildGetTable returns int not HashTable #21888 unblocked the earlier TypeError.-oemit,bin/compile.php_exit(0)s to skip LLVM FFI destructor order that aborts despite a good binary on disk.Builder::dispose(php-llvm patch) and a small smoke-run retry inbootstrap-selfhost-link.shfor residual ~15–25% AOT-binary teardown flake.php-src / implementation
bin/compile.php,script/bootstrap-selfhost-link.sh; vendor patch only for Builder dispose.Verification
Residual: fresh Zend
build/selfhostcan still intermittentlyfree(): invalid pointeron process teardown after printing OK (~15–25%); gate retries up toBOOTSTRAP_SELFHOST_RUN_TRIES(default 5). Root codegen/heap corruption still worth a follow-up.Test plan
SelfhostAotFastExitTestBOOTSTRAP_GEN0_ZEND_ONLY=1 make bootstrap-selfhost-link→ OKMade with Cursor