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 摘要。