[BUG] Explicit realm retirement leaves its acknowledged terminal event queued #7

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

Summary

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

Procd acknowledges complete explicit realm retirement while leaving the same exact child's visible terminal event queued for Launchd. The acknowledgment allows Launchd to release that realm record; the later queued event then has no retained owner and can fail ordinary process-event dispatch. The producer must complete this event handoff at its existing exact retirement boundary.

This source-level gap was found during a native acceptance review. The current actual startup run fails earlier at START and does not establish a guest failure caused by this retirement path. Launchd's downstream report preserves the independently identified consumer symptom.

Reproduction

At Procd d04311abff67e7355bd92bb2e48fb6161e0ec674 and Launchd eb2a1eedabe66e01ab0eb8c630d2f06ecb67b68d:

  1. Retain the original authenticated supervisor and a started RealmMediator child with its exact process/generation.
  2. Admit explicit private RETIRE, terminate that child, and process its native terminal observation through final custody destruction.
  3. Return the successful correlated Retired response, allowing Launchd to complete public ABORT and release its original realm record.
  4. Poll Launchd's authenticated WAIT route. The same RealmMediator event is still queued, although explicit retirement already acknowledged its terminal disposition.

A deterministic producer regression can arrange this retained row and event queue without executing a VM. Never-started staged abort and unsolicited child termination must be tested separately because their event obligations differ.

Expected and actual behavior

Before completing successful explicit RETIRE, Procd should consume only the exact visible terminal event whose child disposition and capability cleanup were already proved for that original retained request. This follows the existing ordinary Launchd STOP acknowledgment model. It must preserve all other process/generation events and spontaneous terminal events that still require ordinary WAIT delivery.

Currently running retirement waits for terminal state and empty custody, but does not consume its queued visible event. Launchd blocks ordinary WAIT while the native request is pending and releases the record after the successful public retirement reply. A later valid RealmMediator event can pass the repaired role decoder and then miss both realm and ordinary-job lookup.

Launchd cannot safely wait unconditionally for a second terminal event: a refused or lost startup may still have been an unstarted staged child, whose abort produces no running terminal event. The correction must preserve that distinction and require exact producer-owned disposition. It must not swallow unmatched consumer events, invent an owner from scalar IDs, or weaken lost-reply and native cleanup rules.

Environment and identity

  • Procd d04311abff67e7355bd92bb2e48fb6161e0ec674; Launchd eb2a1eedabe66e01ab0eb8c630d2f06ecb67b68d; selected Integration fa857c0964774def6777142afeb7a3c16440abee.
  • Source-level native lifecycle ordering. The selected release x86-64 QEMU/OVMF scenario uses development runtime configuration, one virtual CPU and Rust 1.97.1.
  • Existing authenticated private Launchd route, retained exact child identity and original native disposal evidence; no new capability, client grant or global route is needed.
  • Last known working revision is unestablished. No runtime reproduction or successful corrected native acceptance is claimed.

Evidence and prior checks

The new producer_retire_consumes_exact_terminal_event_before_reply regression fails against the original producer with three queued events where only the two unrelated events should remain. The corrected private RETIRE branch consumes only the exact original process/generation's visible event after terminal state and empty capability custody are proved, before successful retained reply completion. The focused controls pass, including unrelated generation/process preservation, failed reply completion and an already-observed spontaneous event. Never-started abort still requires no fabricated terminal event; spontaneous WAIT delivery remains intact.

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.

Final CPU-counter disposition is an independent remaining obligation tracked in Procd 5. Consuming this event does not clear its scalar-accounting flag or establish repeated managed-record reuse. A successful explicit retirement scenario also does not by itself establish guest coverage of Launchd's spontaneous WAIT decoder.

The retained RETIRE branch permits completion only after the original child has terminal state and empty custody. RealmMediator native terminal handling invokes terminal commit, which unconditionally queues the visible event. The subsequent private completion does not take it. Ordinary Launchd STOP already consumes its exact generation's event before acknowledging stop.

Launchd's native-progress gate postpones ordinary WAIT. ABORT reply completion then releases the child-owning record; later event dispatch can no longer correlate the orphaned event.

The unchanged two-child startup/retirement scenario has no explicit event-consumption acknowledgment. Public Retired success alone therefore cannot establish native coverage of the independent WAIT decoder repair. The current changed-image run stops at typed START NOT_FOUND, before running retirement; its original limits and failure remain retained. No retry, new runtime execution or timeout relaxation was used for this review.

Tracking

Owning correction: Procd lifecycle audit and Procd PR 2. Related: Launchd downstream lifetime report, Launchd WAIT decoder, Launchd PR 2, Procd terminal accounting, Posixd realm lifecycle, Integration validation, and Phase 6 completion.

  • Reproduce the exact visible event remaining after successful explicit running retirement against the failing producer.
  • Consume only that exact event after proved native child/capability disposition and before successful retained RETIRE completion.
  • Preserve other-generation events, unrelated children, spontaneous WAIT delivery, never-started staged abort and uncertain/lost-reply cleanup.
  • Complete formatting, strict Clippy, relevant unit tests and warning-denied host/native build and documentation checks.
  • Demonstrate actual independent running retirement and continued service in a coherent native image; validate spontaneous event delivery separately where required.
## Summary Actual changed-image startup and running retirement remain pending; this report stays open. Procd acknowledges complete explicit realm retirement while leaving the same exact child's visible terminal event queued for Launchd. The acknowledgment allows Launchd to release that realm record; the later queued event then has no retained owner and can fail ordinary process-event dispatch. The producer must complete this event handoff at its existing exact retirement boundary. This source-level gap was found during a native acceptance review. The current actual startup run fails earlier at START and does not establish a guest failure caused by this retirement path. [Launchd's downstream report](https://git.erikinkinen.fi/erix/launchd/issues/6) preserves the independently identified consumer symptom. ## Reproduction At Procd `d04311abff67e7355bd92bb2e48fb6161e0ec674` and Launchd `eb2a1eedabe66e01ab0eb8c630d2f06ecb67b68d`: 1. Retain the original authenticated supervisor and a started RealmMediator child with its exact process/generation. 2. Admit explicit private RETIRE, terminate that child, and process its native terminal observation through final custody destruction. 3. Return the successful correlated Retired response, allowing Launchd to complete public ABORT and release its original realm record. 4. Poll Launchd's authenticated WAIT route. The same RealmMediator event is still queued, although explicit retirement already acknowledged its terminal disposition. A deterministic producer regression can arrange this retained row and event queue without executing a VM. Never-started staged abort and unsolicited child termination must be tested separately because their event obligations differ. ## Expected and actual behavior Before completing successful explicit RETIRE, Procd should consume only the exact visible terminal event whose child disposition and capability cleanup were already proved for that original retained request. This follows the existing ordinary Launchd STOP acknowledgment model. It must preserve all other process/generation events and spontaneous terminal events that still require ordinary WAIT delivery. Currently running retirement waits for terminal state and empty custody, but does not consume its queued visible event. Launchd blocks ordinary WAIT while the native request is pending and releases the record after the successful public retirement reply. A later valid RealmMediator event can pass the repaired role decoder and then miss both realm and ordinary-job lookup. Launchd cannot safely wait unconditionally for a second terminal event: a refused or lost startup may still have been an unstarted staged child, whose abort produces no running terminal event. The correction must preserve that distinction and require exact producer-owned disposition. It must not swallow unmatched consumer events, invent an owner from scalar IDs, or weaken lost-reply and native cleanup rules. ## Environment and identity - Procd `d04311abff67e7355bd92bb2e48fb6161e0ec674`; Launchd `eb2a1eedabe66e01ab0eb8c630d2f06ecb67b68d`; selected Integration `fa857c0964774def6777142afeb7a3c16440abee`. - Source-level native lifecycle ordering. The selected release x86-64 QEMU/OVMF scenario uses development runtime configuration, one virtual CPU and Rust 1.97.1. - Existing authenticated private Launchd route, retained exact child identity and original native disposal evidence; no new capability, client grant or global route is needed. - Last known working revision is unestablished. No runtime reproduction or successful corrected native acceptance is claimed. ## Evidence and prior checks The new `producer_retire_consumes_exact_terminal_event_before_reply` regression fails against the original producer with three queued events where only the two unrelated events should remain. The corrected [private RETIRE branch](https://git.erikinkinen.fi/erix/procd/src/commit/4f3b01bf21932e86ac542f07e6ade05138cc0473/src/runtime_realm_producer.rs) consumes only the exact original process/generation's visible event after terminal state and empty capability custody are proved, before successful retained reply completion. The focused controls pass, including unrelated generation/process preservation, failed reply completion and an already-observed spontaneous event. Never-started abort still requires no fabricated terminal event; spontaneous WAIT delivery remains intact. 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. Final CPU-counter disposition is an independent remaining obligation tracked in [Procd 5](https://git.erikinkinen.fi/erix/procd/issues/5). Consuming this event does not clear its scalar-accounting flag or establish repeated managed-record reuse. A successful explicit retirement scenario also does not by itself establish guest coverage of [Launchd's spontaneous WAIT decoder](https://git.erikinkinen.fi/erix/launchd/issues/3). [The retained RETIRE branch](https://git.erikinkinen.fi/erix/procd/src/commit/d04311abff67e7355bd92bb2e48fb6161e0ec674/src/runtime_realm_producer.rs#L329) permits completion only after the original child has terminal state and empty custody. [RealmMediator native terminal handling](https://git.erikinkinen.fi/erix/procd/src/commit/d04311abff67e7355bd92bb2e48fb6161e0ec674/src/processes_lifecycle.rs#L413) invokes [terminal commit](https://git.erikinkinen.fi/erix/procd/src/commit/d04311abff67e7355bd92bb2e48fb6161e0ec674/src/process_terminal_commit.rs#L98), which unconditionally queues the visible event. The subsequent private completion does not take it. [Ordinary Launchd STOP](https://git.erikinkinen.fi/erix/procd/src/commit/d04311abff67e7355bd92bb2e48fb6161e0ec674/src/runtime_policy.rs#L277) already consumes its exact generation's event before acknowledging stop. [Launchd's native-progress gate](https://git.erikinkinen.fi/erix/launchd/src/commit/eb2a1eedabe66e01ab0eb8c630d2f06ecb67b68d/src/runtime/dispatcher.rs#L69) postpones ordinary WAIT. [ABORT reply completion](https://git.erikinkinen.fi/erix/launchd/src/commit/eb2a1eedabe66e01ab0eb8c630d2f06ecb67b68d/src/runtime/realm_reply.rs#L209) then releases the child-owning record; [later event dispatch](https://git.erikinkinen.fi/erix/launchd/src/commit/eb2a1eedabe66e01ab0eb8c630d2f06ecb67b68d/src/runtime/dispatcher_process_event.rs#L25) can no longer correlate the orphaned event. The unchanged two-child startup/retirement scenario has no explicit event-consumption acknowledgment. Public Retired success alone therefore cannot establish native coverage of the independent WAIT decoder repair. The current changed-image run stops at typed START `NOT_FOUND`, before running retirement; its original limits and failure remain retained. No retry, new runtime execution or timeout relaxation was used for this review. ## Tracking Owning correction: [Procd lifecycle audit](https://git.erikinkinen.fi/erix/procd/issues/1) and [Procd PR 2](https://git.erikinkinen.fi/erix/procd/pulls/2). Related: [Launchd downstream lifetime report](https://git.erikinkinen.fi/erix/launchd/issues/6), [Launchd WAIT decoder](https://git.erikinkinen.fi/erix/launchd/issues/3), [Launchd PR 2](https://git.erikinkinen.fi/erix/launchd/pulls/2), [Procd terminal accounting](https://git.erikinkinen.fi/erix/procd/issues/5), [Posixd realm lifecycle](https://git.erikinkinen.fi/erix/posixd/issues/1), [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 exact visible event remaining after successful explicit running retirement against the failing producer. - [x] Consume only that exact event after proved native child/capability disposition and before successful retained RETIRE completion. - [x] Preserve other-generation events, unrelated children, spontaneous WAIT delivery, never-started staged abort and uncertain/lost-reply cleanup. - [x] Complete formatting, strict Clippy, relevant unit tests and warning-denied host/native build and documentation checks. - [ ] Demonstrate actual independent running retirement and continued service in a coherent native image; validate spontaneous event delivery separately where required.
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#7
No description provided.