Problem
Fuzzing and soak tests do not guarantee every allocation-failure path is tested.
zphp uses manual ownership, reference counting, pools, GC, and native resources, so an OOM at the wrong point can cause leaks or partially corrupted runtime state.
Changes
Use Zig's failing allocator testing to intentionally fail the Nth allocation and verify cleanup.
Prioritize:
PhpArray.append/set
- objects/properties
- strings
- references
- closures
- cycle collection
- exceptions
- native resources
- VM reset/deinit
zphp serve worker startup
Verify after each failure
- no leaked allocations/refcounts
- no double-free or use-after-free
- no partially modified arrays
- no stale GC/tracking entries
- no leaked sockets/file descriptors/native resources
Acceptance criteria
- Core ownership-sensitive operations have deterministic OOM tests.
- Failed allocations leave the runtime valid or cleanly terminated.
- The fault-injection suite runs in CI.
Problem
Fuzzing and soak tests do not guarantee every allocation-failure path is tested.
zphp uses manual ownership, reference counting, pools, GC, and native resources, so an OOM at the wrong point can cause leaks or partially corrupted runtime state.
Changes
Use Zig's failing allocator testing to intentionally fail the Nth allocation and verify cleanup.
Prioritize:
PhpArray.append/setzphp serveworker startupVerify after each failure
Acceptance criteria