Skip to content

[PHP] fix: improve PHP procfs and utility coverage#744

Merged
brandonpayton merged 2 commits into
integration/kd-6nz-php-phpt-batch-1-kernel-fixesfrom
gascity/kd-6nz/split-pr717-procfs-utility-coverage
Jul 10, 2026
Merged

[PHP] fix: improve PHP procfs and utility coverage#744
brandonpayton merged 2 commits into
integration/kd-6nz-php-phpt-batch-1-kernel-fixesfrom
gascity/kd-6nz/split-pr717-procfs-utility-coverage

Conversation

@brandonpayton

@brandonpayton brandonpayton commented Jun 20, 2026

Copy link
Copy Markdown
Member

Why

Linux-compatible process metadata must be observable where Unix userland looks for it. PHP exposed two platform gaps: /proc/<pid>/stat did not place scheduler priority and nice in their Linux fields, and procfs metadata paths could outlive the process-table state they claimed to represent. The bundled ps also lacked the selection/output surface needed to consume that state.

What

  • Emit /proc/<pid>/stat field 18 as scheduler priority (20 + nice) and field 19 as nice.
  • Validate PID-scoped procfs entries for metadata, access, directory-change, and readlink operations, while preserving global /proc/net and making PID 0 an ordinary PID rather than a sentinel.
  • Derive procfs PID visibility from authoritative process-table state: live processes and unreaped zombies remain visible; reaped Limbo entries do not.
  • Extend posix-utils-lite ps with strict -p <pid[,pid]> and -o <fields> handling for pid, nice, and comm; missing or malformed selected processes are no longer fabricated as successful rows.
  • Advance the posix-utils-lite build revision to 3 and make its build use the worktree-local SDK activation contract.
  • Document the procfs scheduling/liveness surface and add kernel coverage for PID 0, missing PIDs, per-PID/global networking paths, and zombie-to-reaped visibility.

Review fixes

The original commit b4133e351 established the proc-stat layout and ps option support. Review found compile failures from nonexistent WasmStat::default(), an unwired liveness helper, PID-0/global-net aliasing, reaped entries remaining visible, permissive ps failure behavior, and a missing package revision/build-contract update. Append-only commit dbcb63c77 fixes those issues without rewriting the original contribution.

Verification

Replayed cleanly on the current #866 tip (91d13955f) and verified through the repository dev shell:

  • kernel library: 970 passed, 0 failed
  • musl rebuild: passed
  • resolver-managed posix-utils-lite revision 3 source build: passed after the stale revision-2 archive was rejected by cache-key mismatch
  • kernel Wasm build: passed
  • Node runtime: ps -p 100 -o pid,nice reported the real process and exited 0; -p 999 emitted no fabricated row and exited 1
  • cross-process runtime check on the repaired branch reported a target process at nice 5
  • ABI snapshot/header/TypeScript consistency check: passed

The aggregate batch still receives the full ready-to-merge gate once, after all accepted constituents are present.

Provenance

Supersedes fork-headed PR #724. The original contribution remains commit b4133e351; the review repair is the appended commit dbcb63c77.

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.
@brandonpayton
brandonpayton changed the base branch from integration/kd-6nz-php-phpt-harness-only-base to integration/kd-6nz-php-phpt-batch-1-kernel-fixes July 10, 2026 18:30
@brandonpayton
brandonpayton merged commit 5e011b6 into integration/kd-6nz-php-phpt-batch-1-kernel-fixes Jul 10, 2026
1 check passed
@brandonpayton
brandonpayton deleted the gascity/kd-6nz/split-pr717-procfs-utility-coverage branch July 10, 2026 18:30
@github-actions

Copy link
Copy Markdown

Phase B-1 matrix build status — pr-744-staging

ABI v15. 67 built, 0 failed, 67 total.

Package Arch Status Sha
libcurl wasm32 built 35266304
libcxx wasm32 built a5091dda
libcxx wasm64 built e8edbf4b
libpng wasm32 built e38cc366
libxml2 wasm32 built e13e27ba
libxml2 wasm64 built 9264562d
openssl wasm32 built ff868af9
openssl wasm64 built 3c5d0c7f
sqlite wasm32 built 6fb919c4
sqlite wasm64 built e027cc42
zlib wasm32 built 1e6216c9
zlib wasm64 built ebc7e4a1
bc wasm32 built 3a78fb67
bzip2 wasm32 built 2ddc287d
coreutils wasm32 built 2a18f004
curl wasm32 built a1ab622d
dash wasm32 built a4ab83b1
diffutils wasm32 built 89790993
dinit wasm32 built b793ac0f
fbdoom wasm32 built d9296a33
file wasm32 built 6a1455c3
findutils wasm32 built 1237e4d0
gawk wasm32 built 57c5d5cf
git wasm32 built 7c88a387
grep wasm32 built 235ddcd5
gzip wasm32 built 481eb543
kandelo-sdk wasm32 built 18869e79
kernel wasm32 built 7f3002ad
less wasm32 built a4f09d75
lsof wasm32 built cbd163cd
m4 wasm32 built f0aff0d3
make wasm32 built 250d1d25
mariadb wasm32 built bccf7260
mariadb wasm64 built 3df390c0
modeset wasm32 built 703cfd80
msmtpd wasm32 built ec5df629
nano wasm32 built 1cea23a0
ncurses wasm32 built 8c54f1c2
netcat wasm32 built 361622f8
nginx wasm32 built d3f35370
php wasm32 built c81ee5be
posix-utils-lite wasm32 built 66f52933
sed wasm32 built 03befd20
spidermonkey wasm32 built 99f07b7c
tar wasm32 built bede734f
tcl wasm32 built 9070fddb
unzip wasm32 built 6591e7ef
userspace wasm32 built c3d7e154
vim wasm32 built 0d02b67d
wget wasm32 built 04bb22d8
xz wasm32 built f54f1e93
zip wasm32 built 19152752
zstd wasm32 built 45fa0e20
bash wasm32 built 74f8e39c
mariadb-test wasm32 built 76d2883a
mariadb-vfs wasm32 built 37cbbded
mariadb-vfs wasm64 built a37c83f6
nethack wasm32 built 51827b74
node wasm32 built 98ceb30e
spidermonkey-node wasm32 built 8feaed4d
vim-browser-bundle wasm32 built 63be56eb
nethack-browser-bundle wasm32 built 6f83697f
rootfs wasm32 built 54b2fa02
shell wasm32 built 23a687f4
lamp wasm32 built 4d78fa39
node-vfs wasm32 built a4993b66
wordpress wasm32 built 98403f20

Auto-generated; replaced on each push. Raw data in the publish-status workflow artifact.

brandonpayton added a commit that referenced this pull request Jul 13, 2026
Returning ENOENT for missing, PID-zero, and reaped procfs paths changes existing stat/access/path errno semantics. Advance ABI 20 to 21 and regenerate ABI evidence atomically.

Source-PR: #744

Folded PHP procfs and utility coverage: 604dd7cba.
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.

1 participant