`start_fuzzer_thread` populates `OnceCell` channels before fallible tokenization, poisoning `Tsffs` on startup error

Open Beginner friendly
#513 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
tooling

Research direction

Start in src/fuzzer/mod.rs: read start_fuzzer_thread at the two cited ranges (lines 114-130 and 168-186) and trace the ordering. The channels and their OnceCell fields (fuzzer_tx, fuzzer_rx, fuzzer_shutdown, fuzzer_messages) are set before tokenize_executable_file/tokenize_src_file and fuzz_thread run; move all fallible tokenization and map-pointer lookups ahead of channel creation. Done when a tokenization error leaves the OnceCells unset so a retry no longer fails with "Fuzzer sender already set"; build the crate to confirm.

Written by the indexing model from the issue text.

Description

Where

Problem
start_fuzzer_thread sets fuzzer_tx, fuzzer_rx, fuzzer_shutdown, and fuzzer_messages in their OnceCell fields before running fallible tokenize_executable_file / tokenize_src_file calls and before spawning fuzz_thread. If tokenization fails (for example, a bad path), the peer ends of all four channels are dropped while the four OnceCell fields remain set.

Impact
A single recoverable configuration error (e.g. a typo in token_executables or token_src_files) permanently poisons the Tsffs object so any retry fails with "Fuzzer sender already set".

Suggested fix
Perform all fallible setup (tokenization, map pointer lookups, etc.) before creating channels and populating the OnceCell fields.

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.