[PHP] fix: restore boxed process construction helpers#747
Closed
brandonpayton wants to merge 1 commit into
Closed
Conversation
(cherry picked from commit 4c8d88f)
This was referenced Jul 10, 2026
Member
Author
|
Closing #747 after Batch-2 review as superseded/incomplete; it will not be replayed into #871. Review findings:
The original head does compile, and a throwaway mechanical adaptation to the current constructor also compiled and passed the structural ABI check; the rejection is therefore about correctness, scope, and evidence—not an unresolvable merge conflict. If kernel Wasm stack depth is reproduced as a current defect, it should get a fresh focused PR that covers every constructor including explicit stdio, retains boxed ownership through the process table and fork/exec/spawn paths, omits unrelated stat convenience APIs, and validates the actual failure on Node and Chromium. |
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.
Why
A
Processrecord is large, and constructing one as a value in a caller's stack frame places the whole struct on that frame. On wasm the call stack is small and non-growable, so building aProcessinline on deep paths (fork/exec/spawn) risks stack overflow. A heap-allocating constructor keeps large process records off the caller's frame. The PHPT harness and PHP subprocess tests drive exactly those deep process-creation paths, so this is a platform robustness fix, not PHP-specific code.A companion
Default for WasmStatgives the kernel an ergonomic, consistent way to build stat records (used by procfs and other synthetic-stat sites), so callers can spread-construct instead of duplicating every field.What
crates/kernel/src/process.rs: addProcess::new_boxed()(marked#[inline(never)], returnsBox<Self>from a privatenew_value) so call sites can heap-allocate the record;Process::new()now delegates to it.crates/shared/src/lib.rs: addimpl Default for WasmStat(all-zero fields) enabling..WasmStat::default()construction.Provenance
Supersedes fork-headed PR #727; identical head commit
504c802110c0c623152d95b22195e0873f48075d, re-pointed onto anAutomattic/kandelobranch. No code changed from #727.