Preserve shared mappings across fork for PHP PHPTs#717
Closed
brandonpayton wants to merge 66 commits into
Closed
Conversation
Port the PHP-specific harness, browser VFS/page wiring, PHP 8.3.15 package recipe, libiconv dependency package, and support fixtures from source PR #2 as a scoped checkpoint. General platform fixes and current validation evidence follow in later commits.
(cherry picked from commit d746770)
(cherry picked from commit 274a2ca)
(cherry picked from commit 05d6970)
(cherry picked from commit 02deaca)
(cherry picked from commit 45ada26)
(cherry picked from commit 817e410)
(cherry picked from commit 5621cf5)
(cherry picked from commit f900443)
(cherry picked from commit d2011d8)
(cherry picked from commit 1e88b92)
(cherry picked from commit ea7c94c)
(cherry picked from commit 79600da)
(cherry picked from commit 6f9ccbc)
Port the PR #2 shared-memory/fork fixes onto current Automattic/kandelo. Centralized host workers now inherit and synchronize MAP_SHARED and SysV shared memory across fork, wait, detach, and exit boundaries so parent/child processes observe real shared state. Grow exec-state serialization instead of failing at a fixed 64 KiB buffer, keep Node/browser fork paths in parity, refresh the ABI snapshot for ABI 16, and update focused host/kernel fixtures and tests for the port.
This was referenced Jun 20, 2026
Member
Author
|
Closing this as superseded by the split PHP PHPT PR set. This PR was the original mixed integration branch for the PHP PHPT port, and its current title understates the branch contents. The harness-only work is now in #736, and the non-harness kernel/runtime/platform fixes have been split into dedicated non-draft [PHP] PRs: #721-#735 and #737-#739. I rechecked coverage before closing: every commit subject currently in #717 is represented across the split PRs. The specific fix named by this PR title, "Preserve shared mappings across fork for PHP PHPTs", is represented in #737. |
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
Port of source PR #2 from
brandonpayton/kandelo-agentic-devonto currentAutomattic/kandelo.MAP_SHAREDand SysV shared-memory state across fork, wait, detach, and exit boundaries.Root Cause
PHP PHPT fork/shared-memory cases exposed platform-level state bugs in the centralized host runtime. Child workers did not inherit enough shared mapping metadata before launch, and the host did not publish process-owned shared-memory writes before wait/exit boundaries, so parent and child processes could observe stale
MAP_SHAREDor SysV SHM contents.A separate exec boundary failed because
kernel_exec_setupserialized exec state into a fixed 64 KiB buffer. Large inherited dev-shell environments could makeexecle/vforkpaths returnENOMEMbefore the host replacedenvp.ABI
ABI bumped from 15 to 16. The snapshot records removal of the obsolete
kernel_mark_process_exitedexport and the splitkernel_preadv/kernel_pwritevoffset signatures into explicit lo/hii32args.Validation
bash scripts/dev-shell.sh cargo test -p kandelo --target aarch64-apple-darwin --lib: PASS, 996 passed.bash scripts/dev-shell.sh bash -lc 'cd host && npm run build': PASS, existing CJSimport.metawarnings only.PASS.examples/run-example.ts: PASS forfunctional/popen,functional/vfork, andregression/execle-env.bash scripts/dev-shell.sh scripts/build-musl.sh: PASS.bash scripts/dev-shell.sh scripts/run-libc-tests.sh: PASS, 302 pass, 0 fail, 20 xfail, 1 flaky, 1 timeout, total 324.bash scripts/dev-shell.sh scripts/run-posix-tests.sh: PASS, 174 pass, 0 fail, 3 xfail, 2 skip, total 179.bash scripts/dev-shell.sh bash scripts/check-abi-version.sh: PASS.rootfs.vfsand 2 tests missingprograms/wasm64/hello64.wasm.bash scripts/dev-shell.sh bash build.sh: attempted earlier; interrupted at the rootfs/coreutils source fallback with exit 130, so this is not a pass claim.Browser PHPT validation is intentionally left to follow-up bead
kd-dmmafter this PR exists.