Guest resource drops do not release host-side WASI handles

Offen
#560 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
35/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
rust, wasm

Rechercherichtung

Start by reading the component-binding tracking issue hyperlight-dev/hyperlight#810 and the sandbox reproduction in hyperlight-dev/hyperlight-sandbox#250. Trace how guest-owned WASI resources are represented in the generated host resource table and how drops are handled. Done means dropping a guest resource notifies the host and releases its table entry while live guest resources remain usable across executions.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

area/dependencies kind/bugfix lifecycle/blocked

Problem

When a Wasm guest drops a host-owned resource such as a WASI descriptor, stream, or directory-entry stream, hyperlight-wasm does not notify the host that the resource was released. The generated host resource table therefore retains the entry, and host-side implementations cannot safely distinguish closed resources from resources intentionally retained by a stateful guest.

This becomes visible in long-lived sandboxes that preserve state across executions. In hyperlight-dev/hyperlight-sandbox#250, a regression test opened and closed 600 unique output files in one run and another 600 in the next. Without run-boundary cleanup, the second run failed on file 424 when CapFs reached its 1,024 open-handle limit:

OSError: [Errno 29] I/O error: '/output/second-424.txt'

Clearing all host handles at each execution boundary avoids the leak, but it also means a guest file object retained in interpreter memory cannot remain usable across runs. Keeping all handles preserves live objects but leaks every resource the guest has already closed.

Expected behavior

Dropping a guest-owned host resource should notify the host and release or return the corresponding host resource-table entry. Host implementations could then clean up closed descriptors and streams while preserving genuinely live resources across executions.

References

  • Upstream component-binding tracking issue: hyperlight-dev/hyperlight#810
  • Sandbox behavior and concrete reproduction: hyperlight-dev/hyperlight-sandbox#250
Vorherrschende Sprache
Rust
Sterne
734
Forks
39
Ø Merge
3 T. 16 Std.
Gemergte PRs (30 T.)
12

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus hyperlight-dev/hyperlight-wasm

Alle Issues in hyperlight-dev/hyperlight-wasm

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.