Opened 2 years ago

Last modified 2 years ago

#27229 new task

Create fuzzing harness to compare C/Rust Functionality

Reported by: chelseakomlo Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: rust, protover, fuzz,
Cc: chelseakomlo, teor, nickm Actual Points:
Parent ID: #24265 Points:
Reviewer: Sponsor:


In porting over functionality to Rust, it can be useful to compare functionality between C/Rust. While ideally unit tests should catch most behavior, having a fuzzer to catch edge cases can be handy.

We should write a test harness that fuzzes C/Rust similar functions and compares their output. Ideally, a test would look something like this:

  1. Setup C test case
  2. Set up Rust test case
  3. Provide both functions with the same generated arbitrary input
  4. Compare results

It is worth noting that in most cases we will want to improve behavior when porting to Rust, but this tool can be useful for small cases where we want bitwise identical functions.

Alex Crichton recommended looking at as one option- it is worth looking at what a simple test harness should be and how to have code be reusable between tests.

Child Tickets

Change History (1)

comment:1 Changed 2 years ago by chelseakomlo

Type: defecttask
Note: See TracTickets for help on using tickets.