`save_initial_snapshot` unconditionally hashes `debuginfo_source_directory`, and `save_symbolic_coverage` has an inverted `is_dir()` check

未关闭 适合新手
#511 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
tooling

调研方向

两个位置都在 src/lib.rs 中:save_initial_snapshot 内第 943-945 行左右的 SourceCache::new(&self.debuginfo_source_directory) 调用,以及 save_symbolic_coverage 内第 1188-1191 行左右的 is_dir() 检查。请先完整阅读这两个函数,然后确认 symbolic_coverage 和 symbolic_coverage_directory 在 self 上是在哪里设置的,以确保在启用覆盖率时新增的保护条件是正确的。完成的标准是:只有在启用符号覆盖率时才运行 SourceCache::new,且只有目录缺失时才创建该目录。由于报告人无法运行 SIMICS,请使用 cargo build/cargo test 进行验证,并在 PR 中说明未复现运行时行为。

由索引模型根据 Issue 内容生成。

描述

Where

Problem

  1. save_initial_snapshot calls SourceCache::new(&self.debuginfo_source_directory)? unconditionally on every run, even when self.symbolic_coverage is false. SourceCache::new walks the directory and hashes every file with MD5, SHA1, and SHA256, propagating any read error out of the stop HAP (which panics Simics).
  2. save_symbolic_coverage writes if self.symbolic_coverage_directory.is_dir() { create_dir_all(&self.symbolic_coverage_directory)?; } (missing !), making directory creation a no-op when the directory does not yet exist.

Impact
Non-symbolic fuzzing campaigns pay unnecessary startup I/O and abort Simics if debuginfo_source_directory contains an unreadable file. save_symbolic_coverage fails to create symbolic_coverage_directory itself when it does not exist.

Suggested fix
Gate SourceCache::new behind if self.symbolic_coverage, and negate line 1189 to if !self.symbolic_coverage_directory.is_dir().

Status
Found by reading the code at ed67e1c; not reproduced under SIMICS.

主要语言
Rust
星标
337
派生
26
平均合并
5 小时 33 分钟
30 天内合并 PR
30

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

intel/tsffs 的其他 Issue

查看 intel/tsffs 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。