[PHP] Batch 1: independent PHPT kernel fixes#866
Open
brandonpayton wants to merge 7 commits into
Open
Conversation
This was referenced Jul 10, 2026
Phase B-1 matrix build status —
|
| Package | Arch | Status | Sha |
|---|---|---|---|
| posix-utils-lite | wasm32 | built | daf49994 |
| rootfs | wasm32 | built | 6212200b |
| shell | wasm32 | built | 8550f1b4 |
| lamp | wasm32 | built | ea962e1a |
| node-vfs | wasm32 | built | fd3c6127 |
| wordpress | wasm32 | built | 50c49b65 |
Auto-generated; replaced on each push. Raw data in the publish-status workflow artifact.
(cherry picked from commit aede00b)
The SIGPIPE-on-EPIPE change added a test for external send with MSG_NOSIGNAL (signal suppressed) but not for external send with default flags, which is the main new branch in sys_send. Add that case, and record the observable behavior in docs/posix-status.md: a send to a broken stream peer returns EPIPE and raises SIGPIPE across host-bridged external and loopback TCP, with MSG_NOSIGNAL suppressing the signal. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 7e54390)
Preserve PID scope for procfs net entries, distinguish PID 0 from global entries, and hide reaped limbo identities while retaining zombies. Validate process existence across metadata and readlink operations. Make ps skip vanished processes instead of fabricating nice values, rebuild the package at revision 3, and remove stale WasmStat defaults.
5e011b6 to
372387b
Compare
13 tasks
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.
Batch 1 — independent PHP-PHPT kernel fixes
Aggregation PR for independent kernel fixes split from the PHP PHPT port (old PR #717 / convoy
kd-6nz). Constituent PRs are reviewed against the live batch tip and rebase-merged here so their commits remain distinct and revertable. This batch PR is the only vehicle tomain; it stays open until Brandon approves the batch merge.Per-constituent ready-to-merge CI is intentionally skipped. Focused review checks may run while each PR is incorporated; the full ready-to-merge gate runs on this exact aggregate tree before the batch merges to
main.Constituent review ledger
#749 — raise SIGPIPE for bridged TCP EPIPE — incorporated
write()/send()raise SIGPIPE onEPIPE, while preservingMSG_NOSIGNALsuppression and existing loopback behavior.send()/recv()behavior indocs/posix-status.md; closed Honor MSG_NOSIGNAL on AF_INET loopback stream send #858 as a superseded strict subset.a4126dfdb,f64447410.#750 — reject unsupported mremap flags — incorporated
mremapflag exceptMREMAP_MAYMOVEwithEINVAL, includingMREMAP_FIXEDandMREMAP_DONTUNMAP, rather than silently performing a different remap.MREMAP_FIXED, and it does not implementMREMAP_DONTUNMAPaliasing. Truthful failure is the correct contract. The test also proves rejection leaves the original mapping intact.cargo test -p kandelo --target aarch64-apple-darwin --lib mremap -- --nocapture— 4 passed, 0 failed.01ec01912.#752 — align pathconf constants with libc — reviewed, deferred to batch 2
pathconfselector table and adds more_PC_*answers.SYS_PATHCONFalso lacks pathname marshalling, and several fixed answers are false across Node, MemoryFS, and OPFS. The real repair crosses libc, host ABI metadata, mount capabilities, errno semantics, documentation, and end-to-end tests, so it belongs with batch 2's ABI reconciliation.#753 — preserve Unix-socket path ownership in stat — incorporated
S_IFSOCK.0777 & ~umask; removed an unexplained zero-link-count rewrite; expanded initial-mode and chmod/chown coverage acrossstat,lstat, andfstatat; documented registry limitations.0600placeholder would have regressed the default visible mode from0755to0600.d9950c7a0,91d13955f.#741 — canonicalize cwd after chdir — reviewed, deferred to batch 2
chdir...collapse after symlink validation can store the wrong cwd, while unresolved components break mount routing, virtual/dev//procmatching, AF_UNIX keys, and Node/browser parity. A component-aware namespace resolver is cross-cutting VFS design work for batch 2.#751 — avoid per-mmap gap-sort allocation — reviewed, deferred to batch 2
munmaplength-rounding test without [PHP] fix: preserve process-shared state across fork and exec #756's implementation, producing a real 960-pass/1-fail cargo result and leaving a mapped tail. Its permanentperfframing and PHP-coverage text also make unmeasured claims; the required application benchmark prerequisites are absent locally. Rejoin it with [PHP] fix: preserve process-shared state across fork and exec #756 in batch 2, strengthen equivalence coverage, and satisfy the performance contract or explicitly rewrite/reframe the history before landing.#743 — marshal lchown path through syscall channel — reviewed, deferred to batch 2
lchownto symlink-followingchownbehavior.fchownat(AT_SYMLINK_NOFOLLOW)wrong. Its unrelated cstring validator runs after host pointer rewriting, accepts NULL, duplicates descriptor metadata, can accept stale scratch bytes, and has no tests. The truthful fix needs a distinct no-follow kernel/host/VFS operation, Node/browser parity, integration with [PHP] fix: preserve process environments and chown sentinel semantics #742's ownership-sentinel repair, runtime symlink tests, docs, and batch 2's ABI 17 regeneration.#744 — expose truthful procfs scheduling and process visibility — incorporated
/proc/<pid>/statpriority/nice fields, makes PID-scoped procfs metadata reflect authoritative process-table visibility, and extendsposix-utils-lite pswith strict-p/-osupport.WasmStat::default()calls; wired validation across metadata/access/chdir/readlink paths; separated global/proc/netfrom PID 0; hid reapedLimboentries while retaining zombies; madepsfail truthfully for invalid/missing selections; advanced the package revision to 3; activated the worktree-local SDK; added tests and documentation.1449aa8b9,5e011b6f4.#748 — enforce RLIMIT_FSIZE across write paths — reviewed, deferred to batch 2
SIGXFSZbehavior across scalar, vectored, positioned, sendfile, and copy-file write paths.E0502borrow conflict. More importantly, its remaining-limit cast wraps for limits above 4 GiB on wasm32, and it enforces the limit per internal chunk rather than at the operation boundary, which can spuriously signal or report failure after partialwritev/pwritev/sendfile/copy progress. Memfd writes bypass the check, tests do not cover these semantics, and changing existing write return/errno/signal behavior is ABI-semantic work. Repair it with the batch 2 ABI 17 reconciliation.Batch verification gate — exact aggregate tip
5e011b6f4All commands ran through the repository dev shell in a fresh detached worktree at the exact open-PR head.
cargo test -p kandelo --target aarch64-apple-darwin --lib— 970 passed, 0 failed.cd host && npx vitest run— 99 files passed; 781 tests passed, 2 expected failures, 111 skipped.scripts/run-libc-tests.sh— exit 0; 302 passed, 0 failed, 20 expected failures, 1 flake-pass, and 1 timeout (regression/raise-race).scripts/run-posix-tests.sh— 174 passed, 0 failed, 3 expected failures, 2 unsupported skips.scripts/run-sortix-tests.sh --all— 5,035 passed, 0 failed, 19 expected failures, 52 skipped, 0 timeouts.bash scripts/check-abi-version.sh— snapshot, C header, TypeScript bindings, andABI_VERSIONconsistency are current.Fresh-worktree preparation used the committed lockfiles, rebuilt the wasm32 and wasm64 sysroots, and ran
bash build.shplusscripts/build-programs.shso Vitest consumed exact-tree kernel and fixture artifacts. Earlier Vitest invocations exposed missing dependencies/sysroots/binaries and are not counted as passing evidence; the fully prepared rerun above is the gate result.This batch changes the shared kernel and package/runtime behavior but no browser adapter, UI, service worker, or browser-demo files. Manual
./run.sh browserverification was therefore not run; browser-facing work remains in batch 2.2026-07-12 live-main rebase
main2c083e143(ABI 18) and force-updated this still-open aggregate with an exact lease. The current tip is372387b15.git range-diffreports all seven patches unchanged; the rebase resolved no source conflicts and introduced no fixup commit.5e011b6f4. The stacked Batch 2 runtime tree has since passed the broader kernel/host/libc/ABI gate after incorporating this rebased branch, but that does not replace a final exact-head Batch 1 gate before any merge tomain.mainwithout Brandon's explicit approval.Deferred batches