[BUG] First control challenge can fail before the started mediator registers #8

Open
opened 2026-09-24 20:08:33 +02:00 by erikinkinen · 0 comments
Owner

Summary

Actual changed-image startup and running retirement remain pending; this report stays open.

Procd can submit its first control Challenge before the newly started Posixd has registered its receiver. The Kernel rejects this unaccepted submission with NOT_FOUND and owner zero. Procd treats that result as a permanent bootstrap failure, even though its exact child has just become runnable and can register on a later scheduling turn.

This is a source-confirmed startup ordering defect discovered while reviewing the next native path. It is separate from the empty CLAIM defects and is not assigned as the cause of a previously recorded guest failure.

Reproduction

At Procd d04311abff67e7355bd92bb2e48fb6161e0ec674, start an otherwise fully provisioned, exact RealmMediator generation. Let the original START_PROCESS call succeed but keep the child unscheduled through the immediately following Challenge submission. Return the Kernel's actual absent-registration result (IPC_RESULT_NOT_FOUND, 0), then permit the child to register its control receiver on a later turn.

This ordering exists in the native source: Procd's START control call uses timeout zero; it immediately advances the newly created Challenge caller in that same producer admission before its outer service-loop yield. A deterministic host control should model delayed registration and then successful submission without repeating native START.

Expected and actual behavior

Only the original Start/Challenge caller, before any accepted invocation owner, may wait for the exact newly started child's receiver. Zero-owner NOT_FOUND must be accompanied by a successful fresh query of the retained SEND-only control route. A missing route, failed query, surplus rights, other error, or nonzero error handle must preserve failure/ownership semantics. Existing exact-child terminal polling and bounded service-loop yielding must continue while registration is pending.

Currently the caller permits only zero-owner RETRY as pending. The first zero-owner NOT_FOUND sets a sticky failure; a later scheduler yield or receiver registration cannot recover the bootstrap. START must never be replayed, and an accepted SUBMIT must never be repeated. BUSY is not an absent-registration result and must not be generalized into readiness. ContextProbe's existing stricter contract stays intact because Launchd registers that receiver before Provision.

Environment and identity

  • Procd d04311abff67e7355bd92bb2e48fb6161e0ec674; Kernel 5e285aa91a1423523b2a094d4ce0449ada39b16c; Posixd 809647d60544c4c6121868c99133f30d054965c9. Reviewed selected Integration: fa857c0964774def6777142afeb7a3c16440abee.
  • Native x86-64 producer scheduling; the selected release QEMU/OVMF scenario uses development runtime configuration, one virtual CPU and Rust 1.97.1.
  • Existing exact managed child and already retained SEND-only guarded control route; no new capability, fallback route, wire operation or arbitrary timeout is required.
  • Last known working revision is unestablished. No native reproduction or successful corrected VM acceptance is claimed by this source review.

Evidence and prior checks

The new producer_start_waits_for_control_registration_without_replaying_start regression fails against the original producer with a retained Some(NOT_FOUND) failure after the first unaccepted Challenge. The corrected dedicated Start/Challenge caller waits only before any accepted owner and only after a fresh exact SEND-only endpoint query. Six focused controls pass: delayed registration then one accepted submission, route disappearance/query failure/surplus rights, unchanged BUSY/DENIED errors, retained nonzero failure owners, exact child loss and unchanged strict ContextProbe behavior. The existing original-child reservation, terminal polling and scheduler yielding remain in force. Native START and accepted SUBMIT are never replayed.

The combined frozen source passes 335 default or 341 all-feature main tests plus five existing probe tests in each development/release configuration. Formatting, all thirteen strict Clippy selections, all nine native build selections, warning-denied host/native private rustdoc, original dependency checks and canonical Markdown checks pass with zero warnings. New original CI runs are being observed separately; no CI success or native acceptance is inferred from local checks.

  1. Procd Start admission performs START_PROCESS and immediately advances the new Challenge caller. The control adapter uses timeout zero.
  2. Kernel start marks the child Running and stores a preferred-switch hint. It does not run the child. The syscall scheduling gate performs no blocking switch for timeout zero; the synchronous successful control call returns to Procd.
  3. Kernel SUBMIT admission requires an already live explicit receiver. Missing registration returns NOT_FOUND before allocating invocation storage, transferring bindings or publishing an owner; wire rejection returns zero auxiliary ownership.
  4. Posixd must first complete counted startup validation, then execute control registration. The initial producer submission can precede both.
  5. The retained caller accepts only RETRY/zero. Procd's later outer-loop yield occurs after the first refusal has already been retained.

An intervening timer or scheduling turn can mask the race; it is not a protocol guarantee of receiver registration. The original source review ran no compiler or VM and changed no runtime input. Baseline regression, strict validation and corrected actual native acceptance remain required.

Tracking

Procd lifecycle audit, Procd PR 2, Posixd realm lifecycle, Launchd empty CLAIM, Posixd empty CLAIM, Procd retirement event ownership, Integration validation, and Phase 6 completion.

  • Reproduce the first absent-registration submission against the original producer, then model delayed receiver registration.
  • Add only the scoped Start/Challenge pre-acceptance wait with fresh retained-route verification and no native START replay.
  • Verify exact child loss while waiting, route loss or surplus rights, unchanged ContextProbe behavior, nonzero error-handle retention and no accepted SUBMIT replay.
  • Complete formatting, strict Clippy, relevant unit tests and warning-denied host/native build and documentation checks.
  • Pass actual Posixd startup, readiness and independent retirement in the coherent changed-source native image before closing runtime acceptance.
## Summary Actual changed-image startup and running retirement remain pending; this report stays open. Procd can submit its first control Challenge before the newly started Posixd has registered its receiver. The Kernel rejects this unaccepted submission with `NOT_FOUND` and owner zero. Procd treats that result as a permanent bootstrap failure, even though its exact child has just become runnable and can register on a later scheduling turn. This is a source-confirmed startup ordering defect discovered while reviewing the next native path. It is separate from the empty CLAIM defects and is not assigned as the cause of a previously recorded guest failure. ## Reproduction At Procd `d04311abff67e7355bd92bb2e48fb6161e0ec674`, start an otherwise fully provisioned, exact RealmMediator generation. Let the original START_PROCESS call succeed but keep the child unscheduled through the immediately following Challenge submission. Return the Kernel's actual absent-registration result `(IPC_RESULT_NOT_FOUND, 0)`, then permit the child to register its control receiver on a later turn. This ordering exists in the native source: Procd's START control call uses timeout zero; it immediately advances the newly created Challenge caller in that same producer admission before its outer service-loop yield. A deterministic host control should model delayed registration and then successful submission without repeating native START. ## Expected and actual behavior Only the original Start/Challenge caller, before any accepted invocation owner, may wait for the exact newly started child's receiver. Zero-owner `NOT_FOUND` must be accompanied by a successful fresh query of the retained SEND-only control route. A missing route, failed query, surplus rights, other error, or nonzero error handle must preserve failure/ownership semantics. Existing exact-child terminal polling and bounded service-loop yielding must continue while registration is pending. Currently the caller permits only zero-owner `RETRY` as pending. The first zero-owner `NOT_FOUND` sets a sticky failure; a later scheduler yield or receiver registration cannot recover the bootstrap. START must never be replayed, and an accepted SUBMIT must never be repeated. `BUSY` is not an absent-registration result and must not be generalized into readiness. ContextProbe's existing stricter contract stays intact because Launchd registers that receiver before Provision. ## Environment and identity - Procd `d04311abff67e7355bd92bb2e48fb6161e0ec674`; Kernel `5e285aa91a1423523b2a094d4ce0449ada39b16c`; Posixd `809647d60544c4c6121868c99133f30d054965c9`. Reviewed selected Integration: `fa857c0964774def6777142afeb7a3c16440abee`. - Native x86-64 producer scheduling; the selected release QEMU/OVMF scenario uses development runtime configuration, one virtual CPU and Rust 1.97.1. - Existing exact managed child and already retained SEND-only guarded control route; no new capability, fallback route, wire operation or arbitrary timeout is required. - Last known working revision is unestablished. No native reproduction or successful corrected VM acceptance is claimed by this source review. ## Evidence and prior checks The new `producer_start_waits_for_control_registration_without_replaying_start` regression fails against the original producer with a retained `Some(NOT_FOUND)` failure after the first unaccepted Challenge. The corrected [dedicated Start/Challenge caller](https://git.erikinkinen.fi/erix/procd/src/commit/4f3b01bf21932e86ac542f07e6ade05138cc0473/src/runtime_realm_producer_caller.rs) waits only before any accepted owner and only after a fresh exact SEND-only endpoint query. Six focused controls pass: delayed registration then one accepted submission, route disappearance/query failure/surplus rights, unchanged BUSY/DENIED errors, retained nonzero failure owners, exact child loss and unchanged strict ContextProbe behavior. The existing original-child reservation, terminal polling and scheduler yielding remain in force. Native START and accepted SUBMIT are never replayed. The combined frozen source passes 335 default or 341 all-feature main tests plus five existing probe tests in each development/release configuration. Formatting, all thirteen strict Clippy selections, all nine native build selections, warning-denied host/native private rustdoc, original dependency checks and canonical Markdown checks pass with zero warnings. New original CI runs are being observed separately; no CI success or native acceptance is inferred from local checks. 1. [Procd Start admission](https://git.erikinkinen.fi/erix/procd/src/commit/d04311abff67e7355bd92bb2e48fb6161e0ec674/src/runtime_realm_producer.rs#L218) performs START_PROCESS and immediately advances the new Challenge caller. [The control adapter](https://git.erikinkinen.fi/erix/procd/src/commit/d04311abff67e7355bd92bb2e48fb6161e0ec674/src/kernel_control_transport.rs#L38) uses timeout zero. 2. [Kernel start](https://git.erikinkinen.fi/erix/kernel/src/commit/5e285aa91a1423523b2a094d4ce0449ada39b16c/src/kobj/tcb/state.rs#L614) marks the child Running and stores a preferred-switch hint. It does not run the child. [The syscall scheduling gate](https://git.erikinkinen.fi/erix/kernel/src/commit/5e285aa91a1423523b2a094d4ce0449ada39b16c/src/arch/x86_64/syscall/dispatch.rs#L620) performs no blocking switch for timeout zero; the synchronous successful control call returns to Procd. 3. [Kernel SUBMIT admission](https://git.erikinkinen.fi/erix/kernel/src/commit/5e285aa91a1423523b2a094d4ce0449ada39b16c/src/kobj/endpoint/invocation/admission.rs#L26) requires an already live explicit receiver. Missing registration returns `NOT_FOUND` before allocating invocation storage, transferring bindings or publishing an owner; wire rejection returns zero auxiliary ownership. 4. Posixd must first complete [counted startup validation](https://git.erikinkinen.fi/erix/posixd/src/commit/809647d60544c4c6121868c99133f30d054965c9/src/startup.rs#L43), then execute [control registration](https://git.erikinkinen.fi/erix/posixd/src/commit/809647d60544c4c6121868c99133f30d054965c9/src/readiness.rs#L17). The initial producer submission can precede both. 5. [The retained caller](https://git.erikinkinen.fi/erix/procd/src/commit/d04311abff67e7355bd92bb2e48fb6161e0ec674/src/runtime_realm_producer_caller.rs#L92) accepts only `RETRY`/zero. Procd's later outer-loop yield occurs after the first refusal has already been retained. An intervening timer or scheduling turn can mask the race; it is not a protocol guarantee of receiver registration. The original source review ran no compiler or VM and changed no runtime input. Baseline regression, strict validation and corrected actual native acceptance remain required. ## Tracking [Procd lifecycle audit](https://git.erikinkinen.fi/erix/procd/issues/1), [Procd PR 2](https://git.erikinkinen.fi/erix/procd/pulls/2), [Posixd realm lifecycle](https://git.erikinkinen.fi/erix/posixd/issues/1), [Launchd empty CLAIM](https://git.erikinkinen.fi/erix/launchd/issues/5), [Posixd empty CLAIM](https://git.erikinkinen.fi/erix/posixd/issues/7), [Procd retirement event ownership](https://git.erikinkinen.fi/erix/procd/issues/7), [Integration validation](https://git.erikinkinen.fi/erix/integration/issues/3), and [Phase 6 completion](https://git.erikinkinen.fi/erix/integration/issues/65). - [x] Reproduce the first absent-registration submission against the original producer, then model delayed receiver registration. - [x] Add only the scoped Start/Challenge pre-acceptance wait with fresh retained-route verification and no native START replay. - [x] Verify exact child loss while waiting, route loss or surplus rights, unchanged ContextProbe behavior, nonzero error-handle retention and no accepted SUBMIT replay. - [x] Complete formatting, strict Clippy, relevant unit tests and warning-denied host/native build and documentation checks. - [ ] Pass actual Posixd startup, readiness and independent retirement in the coherent changed-source native image before closing runtime acceptance.
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:35:10 +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/procd#8
No description provided.