[BUG] Runtime storage controls retain an undersized fixed arena #17

Closed
opened 2026-10-02 15:20:15 +02:00 by erikinkinen · 0 comments
Owner

Summary

Launchd runtime storage controls allocate a fixed 32-page (128 KiB) aligned stack array even though their configured 32 stream endpoint rows each retain a full 32 KiB owned IPC packet plus metadata. The packet storage alone exceeds 1 MiB. Slicing the old fixture to the computed native arena extent cannot fit, so these controls cannot reach the intended initialization assertions.

Reproduction

Source-confirmed at launchd b9b676df57. Inspect src/runtime/storage.rs: its test configuration selects stream_endpoint_capacity=32 and its AlignedArena fixtures contain 324096 bytes. src/stream_invocation.rs retains IPC_TRANSPORT_MAX_BYTES_V1 plus the native receive header per endpoint; the canonical transport maximum is 321024 bytes.

The relevant test command is cargo test --bin launchd runtime::storage::tests. It has not been executed under the current testing waiver. Runtime frequency and clean-checkout execution are unmeasured.

Expected and actual behavior

Expected: allocate aligned fixture storage from the actual compiler-derived extent, then exercise accepted, short, long, misaligned and overflowing arena admission without a fixture-only size ceiling.

Actual source behavior: computed extent exceeds the fixed array before initialization can be invoked. A bounds failure is implied by the source geometry; no executed exit status, test log or CI result is claimed.

Environment and identity

  • Component: launchd b9b676df57 on feature/posix-compat; Integration catalog b643e286db8c33fdc18c89250ff3c07476b86bf7.
  • Profile/configuration: hosted runtime-storage unit fixture; no image was built.
  • Architecture/toolchain: source inspection only; no compiler or VM was invoked.
  • Authority: test-owned memory only; production admission and native capability grants are unchanged.
  • Last known working revision: not established by execution.

Evidence and prior checks

The contradiction follows directly from the explicit fixture size, configured row count and per-row packet type. Repair should use heap-owned bytes with an explicitly aligned sub-slice sized from actual layout, retain the existing negative cases, and author a control exceeding the retired fixture ceiling. Tests, builds and CI observation remain deferred.

Tracking

Original readiness, Launchd review, and phase completion. No executed reproduction is asserted.

Resolution

The signed repair 1d5ed598 replaces the fixed stack array with heap-owned bytes and an exact page-aligned view sized from native geometry. Existing short/long/misaligned/overflow controls are retained, a new control covers the retired fixture ceiling, and storage tests are split into a focused module. The image catalog selects the corrected source.

Closed on completed source implementation under the testing/CI waiver. Rustfmt was applied; no test, build, CI observation or executed reproduction was performed. This closure does not close the full descriptor-readiness feature.

## Summary Launchd runtime storage controls allocate a fixed 32-page (128 KiB) aligned stack array even though their configured 32 stream endpoint rows each retain a full 32 KiB owned IPC packet plus metadata. The packet storage alone exceeds 1 MiB. Slicing the old fixture to the computed native arena extent cannot fit, so these controls cannot reach the intended initialization assertions. ## Reproduction Source-confirmed at launchd b9b676df575cb60b9e1df73b03b3813e14aa1678. Inspect src/runtime/storage.rs: its test configuration selects stream_endpoint_capacity=32 and its AlignedArena fixtures contain 32*4096 bytes. src/stream_invocation.rs retains IPC_TRANSPORT_MAX_BYTES_V1 plus the native receive header per endpoint; the canonical transport maximum is 32*1024 bytes. The relevant test command is `cargo test --bin launchd runtime::storage::tests`. It has not been executed under the current testing waiver. Runtime frequency and clean-checkout execution are unmeasured. ## Expected and actual behavior Expected: allocate aligned fixture storage from the actual compiler-derived extent, then exercise accepted, short, long, misaligned and overflowing arena admission without a fixture-only size ceiling. Actual source behavior: computed extent exceeds the fixed array before initialization can be invoked. A bounds failure is implied by the source geometry; no executed exit status, test log or CI result is claimed. ## Environment and identity - Component: launchd b9b676df575cb60b9e1df73b03b3813e14aa1678 on feature/posix-compat; Integration catalog b643e286db8c33fdc18c89250ff3c07476b86bf7. - Profile/configuration: hosted runtime-storage unit fixture; no image was built. - Architecture/toolchain: source inspection only; no compiler or VM was invoked. - Authority: test-owned memory only; production admission and native capability grants are unchanged. - Last known working revision: not established by execution. ## Evidence and prior checks The contradiction follows directly from the explicit fixture size, configured row count and per-row packet type. Repair should use heap-owned bytes with an explicitly aligned sub-slice sized from actual layout, retain the existing negative cases, and author a control exceeding the retired fixture ceiling. Tests, builds and CI observation remain deferred. ## Tracking [Original readiness](https://git.erikinkinen.fi/erix/posixd/issues/33), [Launchd review](https://git.erikinkinen.fi/erix/launchd/pulls/2), and [phase completion](https://git.erikinkinen.fi/erix/integration/issues/65). No executed reproduction is asserted. ## Resolution The signed repair [1d5ed598](https://git.erikinkinen.fi/erix/launchd/commit/1d5ed598905e998f4f154d41f5394e24fa7f76b5) replaces the fixed stack array with heap-owned bytes and an exact page-aligned view sized from native geometry. Existing short/long/misaligned/overflow controls are retained, a new control covers the retired fixture ceiling, and storage tests are split into a focused module. The [image catalog](https://git.erikinkinen.fi/erix/integration/commit/f5c599e90331993b681d86f39a2a2750856c1fad) selects the corrected source. Closed on completed source implementation under the testing/CI waiver. Rustfmt was applied; no test, build, CI observation or executed reproduction was performed. This closure does not close the full descriptor-readiness feature.
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:34:32 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erix/launchd#17
No description provided.