Bug in run_cmd_with_timeout means you always get an error about `ls -d` timing out
还没有人认领这个 Issue。
评估
调研方向
从 src/dvsim/cli/run.py 和 src/dvsim/utils/subprocess.py 中的 run_cmd_with_timeout 实现开始,跟踪 SCRATCH_ROOT 路径和引用的 poll 检查。使用 ls -d 命令验证行为,并确认成功退出不再被报告为超时。
由索引模型根据 Issue 内容生成。
描述
If the SCRATCH_ROOT env var is set you hit this code: https://github.com/lowRISC/dvsim/blob/0f1346640562da32bc399530b309487e9e1df832/src/dvsim/cli/run.py#L62-L72
That calls this function: https://github.com/lowRISC/dvsim/blob/0f1346640562da32bc399530b309487e9e1df832/src/dvsim/utils/subprocess.py#L28-L39
(With the wrong type for exit_on_failure btw, but who needs correct types?)
The problem is that function will basically always say that the command has timed out. The bug is due to the classic truthiness footgun that Python shares with Javascript. Unlike in Typescript where you can (with considerable effort) set up ESLint to ban truthiness bugs, I'm not aware of a way to do that in Python so you just have to be vigilant.
Here is the bug (and the other poll further down): https://github.com/lowRISC/dvsim/blob/0f1346640562da32bc399530b309487e9e1df832/src/dvsim/utils/subprocess.py#L53-L54
It needs to be if p.poll() is not None:.
poll() returns the exit code or None if the process has not exited. If the command succeeds then p.poll() returns 0, and if 0: will never succeed so it thinks the command times out.
- 主要语言
- Python
- 星标
- 16
- 派生
- 23
- 平均合并
- 1 天 19 小时
- 30 天内合并 PR
- 4
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
lowRISC/dvsim 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
Better log visibility on the license type usage profile可能重新可做 @AlexJones0 于 33 天前认领,目前没有进行中的 PR。 未关闭
-
enhancement
难度 3/5 1-2 天 新手友好度 75/100
相似的 Issue
-
URLValidator ignores an explicit empty scheme allowlist可能已有人在做 @IlyaKhalafi 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
tortoise/tortoise-orm#2393 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
frappe/frappe_docker#2046 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
-
complete_box_iou_loss / complete_box_iou: NaN gradients for zero-height boxes, NaN for point boxes未关闭
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
AXI SMU SPEC
难度 2/5 1-3 小时 新手友好度 62/100
tenstorrent/tt-oca-harness#3556 ·
维护者通常 1 天内回复