[BUG] Exact directory close acknowledges before provider cleanup completes #4

Closed
opened 2026-09-29 02:26:46 +02:00 by erikinkinen · 0 comments
Owner

Summary

An exact-directory close reply could report success before Vfsd closed the retained provider handle and independent navigation anchor. A caller therefore could not use that reply as a provider-cleanup completion barrier. Source inspection also found that an unrelated reply error skipped the normal one-shot cleanup attempts before fail-stop.

Reproduction

At Vfsd a57cad7e874cefe12f70d8436100a90fc4e8bb8d, inspect handle_exact_rpc in src/runtime.rs: after an accepted handle-zero CLOSE, it sends the successful reply before calling retire_consumed_exact_object. That helper subsequently closes the provider object. A reply error returns before that helper. This is a source-confirmed ordering defect; no runtime or clean-image reproduction was executed under the user's testing override.

Expected and actual behavior

Expected: a successful exact close reply follows confirmed provider-handle and navigation-anchor disposal. The native receiver remains alive for that reply attempt, then is retired before dispatch resumes. Failure of either provider close must prevent success acknowledgment and record reuse. Required local cleanup must still be attempted after a reply error.

Actual at the affected revision: the reply precedes provider disposal; caller-visible success cannot establish completion. No runtime exit code, timing or test pass is claimed.

Implemented in signed Vfsd 3d0cc24d on feature/posix-compat. The close path now enforces provider-before-reply ordering, preserves pending reply custody and fails stopped on uncertain cleanup. One-shot operations preserve result-before-disposal semantics and attempt both cleanup steps after a reply error. The change is published on the feature branch; the image catalog has not adopted it.

Environment and identity

  • Component: Vfsd a57cad7e874cefe12f70d8436100a90fc4e8bb8d; fixed revision linked above.
  • Integration graph and image identity: no image was built or run for this report; deployed behavior was not observed.
  • Architecture: native x86_64 service path inspected; firmware and toolchain execution are not involved in the source observation.
  • Relevant authority: caller already holds the exact job-lifetime directory SEND endpoint; the request carries no capability and uses handle zero.
  • Last known working revision: unknown; no regression-range claim.

Evidence and prior checks

Eight authored regressions cover explicit close ordering, terminal-caller loss, reply and receiver failures, one-shot cleanup, retained live objects, both actual directory pins and failure of either provider close. The real-handle fixtures preserve the parent directory and retain uncertain child records. Tests remain unrun. Formatting was applied; tests, builds, lint checks, VM runs, manual builds and CI observation are deferred by the user. No waived check is reported as passed.

Manual update describes the completion contract. The runtime was split into a focused exact-dispatch module; all changed code files remain below 1,000 lines.

Tracking

Implementation and documentation are complete for this defect; testing is waived for completion by the user. Broader realm source ownership and consumer adoption remain open in the binding design.

Vfsd review, Vfsd authority work, manual review, Phase 6 master.

## Summary An exact-directory close reply could report success before Vfsd closed the retained provider handle and independent navigation anchor. A caller therefore could not use that reply as a provider-cleanup completion barrier. Source inspection also found that an unrelated reply error skipped the normal one-shot cleanup attempts before fail-stop. ## Reproduction At Vfsd `a57cad7e874cefe12f70d8436100a90fc4e8bb8d`, inspect `handle_exact_rpc` in `src/runtime.rs`: after an accepted handle-zero `CLOSE`, it sends the successful reply before calling `retire_consumed_exact_object`. That helper subsequently closes the provider object. A reply error returns before that helper. This is a source-confirmed ordering defect; no runtime or clean-image reproduction was executed under the user's testing override. ## Expected and actual behavior Expected: a successful exact close reply follows confirmed provider-handle and navigation-anchor disposal. The native receiver remains alive for that reply attempt, then is retired before dispatch resumes. Failure of either provider close must prevent success acknowledgment and record reuse. Required local cleanup must still be attempted after a reply error. Actual at the affected revision: the reply precedes provider disposal; caller-visible success cannot establish completion. No runtime exit code, timing or test pass is claimed. Implemented in signed [Vfsd `3d0cc24d`](https://git.erikinkinen.fi/erix/vfsd/commit/3d0cc24da9bae21579e7c2af4836253e1008e111) on `feature/posix-compat`. The close path now enforces provider-before-reply ordering, preserves pending reply custody and fails stopped on uncertain cleanup. One-shot operations preserve result-before-disposal semantics and attempt both cleanup steps after a reply error. The change is published on the feature branch; the image catalog has not adopted it. ## Environment and identity - Component: Vfsd `a57cad7e874cefe12f70d8436100a90fc4e8bb8d`; fixed revision linked above. - Integration graph and image identity: no image was built or run for this report; deployed behavior was not observed. - Architecture: native x86_64 service path inspected; firmware and toolchain execution are not involved in the source observation. - Relevant authority: caller already holds the exact job-lifetime directory SEND endpoint; the request carries no capability and uses handle zero. - Last known working revision: unknown; no regression-range claim. ## Evidence and prior checks Eight authored regressions cover explicit close ordering, terminal-caller loss, reply and receiver failures, one-shot cleanup, retained live objects, both actual directory pins and failure of either provider close. The real-handle fixtures preserve the parent directory and retain uncertain child records. Tests remain unrun. Formatting was applied; tests, builds, lint checks, VM runs, manual builds and CI observation are deferred by the user. No waived check is reported as passed. [Manual update](https://git.erikinkinen.fi/erix/docs/commit/3de641efeec0390242319f92279e38db8aaa25b8) describes the completion contract. The runtime was split into a focused exact-dispatch module; all changed code files remain below 1,000 lines. ## Tracking Implementation and documentation are complete for this defect; testing is waived for completion by the user. Broader realm source ownership and consumer adoption remain open in [the binding design](https://git.erikinkinen.fi/erix/posixd/issues/1). [Vfsd review](https://git.erikinkinen.fi/erix/vfsd/pulls/3), [Vfsd authority work](https://git.erikinkinen.fi/erix/vfsd/issues/1), [manual review](https://git.erikinkinen.fi/erix/docs/pulls/4), [Phase 6 master](https://git.erikinkinen.fi/erix/integration/issues/65).
erikinkinen 2026-09-29 02:26:46 +02:00
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:35:16 +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#4
No description provided.