Guest resource drops do not release host-side WASI handles

未關閉
#560 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
35/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
rust, wasm

研究方向

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.

由索引模型根據 Issue 內容生成。

描述

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
主要語言
Rust
星號
734
分支
39
平均合併
3 天 16 小時
30 天內合併 PR
12

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

hyperlight-dev/hyperlight-wasm 的其他 Issue

查看 hyperlight-dev/hyperlight-wasm 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。