[BUG] Launch resolution exhausts Vfsd's process stack #33

Open
opened 2026-10-14 18:44:16 +02:00 by erikinkinen · 4 comments
Owner

Summary

Launch-artifact resolution can exhaust Vfsd's 256 KiB process stack. The initial shell then fails to commit after the foundation services start. Large component return values and nested description buffers consume too much stack.

Reproduction

Run Integration's existing appliance-disk-image-exact-selector-race-negative.toml scenario with the source selections below. The original workflow faults during initial-shell resolution.

The component regression proposed in #3 resolves both an executable and its manifest sidecar, exports the complete physical report, and retires the original objects. Its fixture storage is allocated before entering a 256 KiB thread:

cargo test --offline --all-features complete_launch_resolution_fits_original_stack_and_retires_original_custody -- --nocapture

With only that regression added, the original production code overflows. The repair passes the identical test in debug and optimized PIC builds.

Expected and actual behavior

Launch resolution should preserve complete names and retire provider state within the existing stack allocation. The original guest instead faults in Vfsd and reports INITIAL_EXSH:REJECTED:COMMIT, RESULT_NOT_FOUND, and startup stage 0x155. The independent host reproduction aborts with a stack-overflow diagnostic.

Environment and identity

  • CI selects Vfsd 2df8f7b9d2fe189a9b1f304bd90e3ecab31419d8 through Integration b0cea358d53451a9991154e094b702b13afd5273.
  • Current Vfsd base ad936bf56c22590410f3fa8e2c0eb83fe61301c0 has identical Rust and Cargo source.
  • Guest build: x86_64-unknown-none, release vfsd-runtime, three mounts and 64 handle rows.
  • Original VM limits: one CPU, 120 seconds total and 45 seconds without output.
  • Host reproduction: rustc 1.90.0-nightly (430d6eddf), LLVM 20.1.8.
  • Exact CI compiler and faulting-instruction attribution remain unconfirmed.

Evidence and prior checks

The original Integration workflow retains the guest failure. The original and repaired host tests use the same stack size, full-name assertions and cleanup checks. All 516 component tests pass with the repair.

The existing provider-read frame gate covers a different call chain. Repaired guest confirmation and a separate launch-frame audit remain open.

Tracking

Implementation PR · Phase tracking

  • Publish the component-buffer and direct-row-copy repair with the stack regression.
  • Confirm the original guest scenario and full component/Integration workflows.
  • Complete the separate launch-frame audit.

Preserve the 256 KiB allocation, complete component/path capacity, arena admissions and provider retirement rules.

## Summary Launch-artifact resolution can exhaust Vfsd's 256 KiB process stack. The initial shell then fails to commit after the foundation services start. Large component return values and nested description buffers consume too much stack. ## Reproduction Run Integration's existing `appliance-disk-image-exact-selector-race-negative.toml` scenario with the source selections below. The original workflow faults during initial-shell resolution. The component regression proposed in #3 resolves both an executable and its manifest sidecar, exports the complete physical report, and retires the original objects. Its fixture storage is allocated before entering a 256 KiB thread: ```sh cargo test --offline --all-features complete_launch_resolution_fits_original_stack_and_retires_original_custody -- --nocapture ``` With only that regression added, the original production code overflows. The repair passes the identical test in debug and optimized PIC builds. ## Expected and actual behavior Launch resolution should preserve complete names and retire provider state within the existing stack allocation. The original guest instead faults in Vfsd and reports `INITIAL_EXSH:REJECTED:COMMIT`, `RESULT_NOT_FOUND`, and startup stage `0x155`. The independent host reproduction aborts with a stack-overflow diagnostic. ## Environment and identity - CI selects Vfsd `2df8f7b9d2fe189a9b1f304bd90e3ecab31419d8` through Integration `b0cea358d53451a9991154e094b702b13afd5273`. - Current Vfsd base `ad936bf56c22590410f3fa8e2c0eb83fe61301c0` has identical Rust and Cargo source. - Guest build: `x86_64-unknown-none`, release `vfsd-runtime`, three mounts and 64 handle rows. - Original VM limits: one CPU, 120 seconds total and 45 seconds without output. - Host reproduction: rustc `1.90.0-nightly (430d6eddf)`, LLVM `20.1.8`. - Exact CI compiler and faulting-instruction attribution remain unconfirmed. ## Evidence and prior checks The [original Integration workflow](https://git.erikinkinen.fi/erix/integration/actions/runs/2630) retains the guest failure. The original and repaired host tests use the same stack size, full-name assertions and cleanup checks. All 516 component tests pass with the repair. The existing provider-read frame gate covers a different call chain. Repaired guest confirmation and a separate launch-frame audit remain open. ## Tracking [Implementation PR](https://git.erikinkinen.fi/erix/vfsd/pulls/3) · [Phase tracking](https://git.erikinkinen.fi/erix/integration/issues/65) - [x] Publish the component-buffer and direct-row-copy repair with the stack regression. - [ ] Confirm the original guest scenario and full component/Integration workflows. - [ ] Complete the separate launch-frame audit. Preserve the 256 KiB allocation, complete component/path capacity, arena admissions and provider retirement rules.
Author
Owner

The repair is published and selected by Integration. It reuses one component buffer and copies description fragments directly into admitted rows, preserving complete names and the 256 KiB stack allocation.

The original host regression overflows; the same repaired debug and optimized PIC controls pass. All 518 component tests and the original component workflow pass. Repaired guest confirmation and the launch-frame audit remain open.

The [repair](https://git.erikinkinen.fi/erix/vfsd/commit/a2b5ef91d7997d2a6c1083b65c144e91d44e61c7) is published and selected by Integration. It reuses one component buffer and copies description fragments directly into admitted rows, preserving complete names and the 256 KiB stack allocation. The original host regression overflows; the same repaired debug and optimized PIC controls pass. All 518 component tests and the [original component workflow](https://git.erikinkinen.fi/erix/vfsd/actions/runs/369) pass. Repaired guest confirmation and the launch-frame audit remain open.
Author
Owner

The repaired Integration run still fails during initial shell materialization. The component regression covered launch resolution, but it did not execute the complete native file-read and reply path.

Source review found large inline read buffers returned through several calls, followed by another full response buffer. Work is underway to replace those copies with caller-owned output throughout the exact-object read path and add a regression that covers it. The existing wire bytes, provider custody and 256 KiB stack budget remain required. The issue stays open.

The [repaired Integration run](https://git.erikinkinen.fi/erix/integration/actions/runs/2639) still fails during initial shell materialization. The component regression covered launch resolution, but it did not execute the complete native file-read and reply path. Source review found large inline read buffers returned through several calls, followed by another full response buffer. Work is underway to replace those copies with caller-owned output throughout the exact-object read path and add a regression that covers it. The existing wire bytes, provider custody and 256 KiB stack budget remain required. The issue stays open.
Author
Owner

The second read-path repair is published in 367a1c1e. Reads now fill caller-owned output and return scalar progress; provider and clock requests share one exclusively held packet. The fixed-stack controls and 540 component cases pass. Guest confirmation and the launch-frame audit remain open. The new component workflow stops before Cargo on a separate dependency mismatch, which is being repaired from suppliers upward.

The second read-path repair is published in [367a1c1e](https://git.erikinkinen.fi/erix/vfsd/commit/367a1c1e8c077f12b12f7f7b78c50d7f86187bed). Reads now fill caller-owned output and return scalar progress; provider and clock requests share one exclusively held packet. The fixed-stack controls and 540 component cases pass. Guest confirmation and the launch-frame audit remain open. The new component workflow stops before Cargo on a separate [dependency mismatch](https://git.erikinkinen.fi/erix/vfsd/issues/34), which is being repaired from suppliers upward.
Author
Owner

Published fe7b078a: launch-path reports now copy the counted parent and basename directly into independent description rows, keeping both original keys live until composition finishes. Component parsing borrows its caller-owned buffer. With the same local Rust 1.97.1 runtime build, the nine-function stack bound falls from 271,168 to 238,528 bytes, chiefly from removing the flattened basename. This is a static bound; the failing CI guest still needs checking on the updated graph.

Published `fe7b078a`: launch-path reports now copy the counted parent and basename directly into independent description rows, keeping both original keys live until composition finishes. Component parsing borrows its caller-owned buffer. With the same local Rust 1.97.1 runtime build, the nine-function stack bound falls from 271,168 to 238,528 bytes, chiefly from removing the flattened basename. This is a static bound; the failing CI guest still needs checking on the updated graph.
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:35:20 +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/vfsd#33
No description provided.