File descriptor 0 might not get closed when used in file stream
未关闭
还没有人认领这个 Issue。
fs
- 主要语言
- JavaScript
- 星标
- 122k
- 派生
- 37.4k
- 平均合并
- 4 天 3 小时
- 30 天内合并 PR
- 272
描述
Just from reading the code it seems the file descriptor 0 is not closed for streams.
I have not run any tests to confirm that, but the check in code if (!stream.fd) looks rather clear and does not work for fd 0. The _close function actually sets null, so more null-like check should be there:
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先阅读 lib/internal/fs/streams.js 中链接的部分,尤其是第 117-134 行,并追踪 stream 的文件描述符是如何被检查和清除的。确认描述符 0 的行为,并为报告的案例添加覆盖。完成标准是:描述符 0 被关闭,同时不会导致其他 stream 清理出现回归。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- operating-systems
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 冷清
- 描述清晰度
- 描述清楚
- 新手友好度
- 55/100