`keep_all_corpus` fails with ENOENT in repro mode when `corpus_directory` does not exist

Open Beginner friendly
#514 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
70/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
security

Research direction

Open src/fuzzer/mod.rs at the cited lines 592-606 and read Tsffs::get_testcase, following how start_fuzzer_thread and CachedOnDiskCorpus normally create corpus_directory. Then check the keep_all_corpus write path to confirm it can run in repro mode without that directory existing. Done means a repro run with keep_all_corpus = true either skips the copies or creates the directory first, demonstrated by a test or a manual repro since the reporter could not reproduce under SIMICS.

Written by the indexing model from the issue text.

Description

Where

Problem
In Tsffs::get_testcase, when self.repro_testcase.is_some(), start_fuzzer_thread() (which creates corpus_directory via CachedOnDiskCorpus) is never called. Yet if self.keep_all_corpus unconditionally writes <hash>.testcase into self.corpus_directory without ensuring the directory exists.

Impact
Reproducing a testcase with keep_all_corpus = true fails with No such file or directory if corpus_directory has not already been created.

Suggested fix
Skip writing keep_all_corpus copies in repro mode, or call create_dir_all(&self.corpus_directory)? before writing.

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

Dominant language
Rust
Stars
337
Forks
26
Avg merge
5h 33m
Merged PRs (30d)
30

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from intel/tsffs

All issues in intel/tsffs

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.