Skip to content

Fix Zend gen-0 selfhost link abort after AOT emit (#21925) - #21936

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-21925-m3emit-tu-segv
Jul 21, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-21925-m3emit-tu-segv

Conversation

@PurHur

@PurHur PurHur commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

php-src / implementation

  • Bootstrap/codegen (php-compiler-strict gate path); no php-src language change.
  • PHP: bin/compile.php, script/bootstrap-selfhost-link.sh; vendor patch only for Builder dispose.

Verification

$ ./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter SelfhostAotFastExitTest'
OK (3 tests, 8 assertions)

$ ./script/docker-exec.sh -- bash -lc 'BOOTSTRAP_GEN0_ZEND_ONLY=1 make bootstrap-selfhost-link; echo LINK_EXIT:$?'
bootstrap-compile-invoke: php …/bin/compile.php -o …/build/selfhost …/compiler_minimal/main.php (gen-0 Zend)
bootstrap-selfhost-link: OK /compiler/build/selfhost
LINK_EXIT:0

Residual: fresh Zend build/selfhost can still intermittently free(): invalid pointer on process teardown after printing OK (~15–25%); gate retries up to BOOTSTRAP_SELFHOST_RUN_TRIES (default 5). Root codegen/heap corruption still worth a follow-up.

Test plan

  • SelfhostAotFastExitTest
  • BOOTSTRAP_GEN0_ZEND_ONLY=1 make bootstrap-selfhost-link → OK

Made with Cursor

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>
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.

Gen-1+ #1492: Zend gen-0 compiler_minimal SIGSEGV after c:include M3EmitTuTrivialEchoAot.php (unblocked by #21888)

1 participant