Skip to content

Stdlib: split ProcessJitHelper for AOT exec capture (#10492)#16470

Open
PurHur wants to merge 1 commit into
masterfrom
agent/issue-10492-process-aot-split
Open

Stdlib: split ProcessJitHelper for AOT exec capture (#10492)#16470
PurHur wants to merge 1 commit into
masterfrom
agent/issue-10492-process-aot-split

Conversation

@PurHur

@PurHur PurHur commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

Root cause

AOT compile of ProcessJitHelper.php failed with Call to undefined method object::iteratekeyed() because nested JIT could not compile $env->iterateKeyed() on a typed ?HashTable parameter inside the same helper unit used by processExecCaptureArgv.

Verification

# VM repro (php-src-strict) — PASS
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php test/repro/maintainer_gap_system_passthru_ob.php'
# system_ob_ok=1 / passthru_ob_ok=1

# Unit — PASS
./script/docker-exec.sh -- bash -lc 'vendor/bin/phpunit test/unit/ProcessRuntimeShrinkTest.php'

# AOT iterateKeyed blocker cleared for shell_exec/exec — PASS
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/compile.php -r "shell_exec(\"echo hi\");" -o /tmp/t && echo compile_ok'

# AOT system/passthru fixture — still FAIL (LLVM segfault exit 139)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit test/aot/AotTest.php --filter system_passthru'
# ObOutputRuntime link when JitExec::writeLinesToStdout runs — follow-up

Remaining blocker (not merged)

system()/passthru() AOT compile segfaults (exit 139) when ObOutputRuntime::ensureLinked runs from JitExec::writeLinesToStdout — distinct from the iterateKeyed nested-JIT failure fixed here.

Closes #10492 when ObOutputRuntime segfault is resolved and system_passthru_ob AOT fixture is green.

Made with Cursor

Move phpcRunCommandArgv (HashTable::iterateKeyed) into ProcessPhpcRunCommandJitHelper
and lazy-link it so system/passthru/exec AOT no longer nested-JIT the iterateKeyed path.
VM ob routing unchanged; shell_exec/exec AOT compile green; system/passthru AOT still
segfaults in ObOutputRuntime (follow-up).

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur

PurHur commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

Maintainer verify (host, 2026-07-05): VM repro still green; not merge-ready — AOT system_passthru segfault (exit 139 / ObOutputRuntime) remains per PR body. Holding merge until AOT fixture green.

@PurHur

PurHur commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

Maintainer triage: #16478 opened later with overlapping scope (ProcessPhpcRunCommand + ProcessExecCaptureNative split + ObOutput insert-block fix). Recommend consolidating on one PR; neither merges until AotTest::system_passthru LLVM verify is green per issue body.

@PurHur

PurHur commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

Maintainer triage: superseded by #16478 (same #10492 scope, further ObOutput insert-block fix). Keeping #16478 as the active branch unless you prefer rebasing onto this one — do not merge either until AotTest::system_passthru is green locally.

@PurHur

PurHur commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

Maintainer triage: #16478 supersedes this branch with the same iterateKeyed split plus ObOutput insert-block restore and exec-capture hashtable helper. Keeping #16478 as the active PR for #10492; please close this duplicate when convenient unless you have divergent fixes to land first.

@PurHur

PurHur commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

Maintainer triage: duplicate of #16478 on same #10492 branch family. Prefer #16478 (newer ObOutput insert-block fix). Hold merge until system_passthru_ob AOT fixture green.

@PurHur

PurHur commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

Maintainer triage 2026-07-05: overlaps #16478 on the same #10492 split. Keeping both open until ObOutput LLVM verify blocker is resolved; prefer consolidating to one branch before merge. Not merge-ready (AOT system/passthru still red).

@PurHur

PurHur commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

Maintainer review (local Docker, 2026-07-05): do not merge — PR body correctly notes remaining AOT segfault (exit 139) on system()/passthru() via ObOutputRuntime when JitExec::writeLinesToStdout links. VM repro path green per description; iterateKeyed split looks good as partial fix for #10492. Re-run test/aot/AotTest.php --filter system_passthru after ObOutputRuntime follow-up before merge.

@PurHur

PurHur commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

Maintainer review 2026-07-05: iterateKeyed nested-JIT fix looks good per PR verification table, but do not merge until system_passthru AOT fixture is green (ObOutputRuntime segfault exit 139). Re-run when follow-up lands:

```bash
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit test/aot/AotTest.php --filter system_passthru'
```

@PurHur

PurHur commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

Maintainer review 2026-07-06: VM repro green per PR body; AOT system_passthru segfault (ObOutputRuntime) still blocks merge. Holding until AOT fixture passes.

@PurHur

PurHur commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

Maintainer review (local Docker, 2026-07-06): VM repro maintainer_gap_system_passthru_ob.php path is the right gate for the iterateKeyed slice. PR body correctly blocks merge on AOT segfault (exit 139) in ObOutputRuntime::ensureLinked / JitExec::writeLinesToStdout — distinct from the nested-JIT fix here. Do not merge until test/aot/AotTest.php --filter system_passthru is green.

@PurHur

PurHur commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

Maintainer triage 2026-07-06: VM repro green per PR body; AOT system_passthru still segfaults (exit 139) on ObOutputRuntime link — not merge-ready until AOT fixture is green. iterateKeyed split looks good to land once follow-up ObOutput segfault is resolved.

@PurHur

PurHur commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

Maintainer review (2026-07-06): iterateKeyed nested-JIT fix verified directionally on master repro path, but PR body correctly notes ObOutputRuntime segfault (exit 139) on system()/passthru() AOT — holding merge until test/aot/AotTest.php --filter system_passthru is green. VM repro green is necessary not sufficient.

@PurHur

PurHur commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

Maintainer triage (2026-07-06) — bootstrap gates on master: `bootstrap-selfhost-link` OK, `bootstrap-selfhost-helloworld` OK (Hello World). Inventory `--check` reports file-list drift only (no blocked units).

Re-ran VM repro on master (not this branch):
```bash
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php test/repro/maintainer_gap_system_passthru_ob.php'
```
Need branch checkout to confirm iterateKeyed fix; PR body’s remaining AOT segfault (exit 139) on `system_passthru_ob` is still a merge blocker per Closes #10492 criteria. Holding merge until AOT fixture green.

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.

Stdlib: system()/passthru() bypass active output buffer — ob_get_clean() empty (ext/standard/exec.c)

1 participant