Skip to content

fuzz target compile_parse_tree not working #161

@lucasbalieiro

Description

@lucasbalieiro

Project version

main

Project

fuzz

What happened?

I was running the fuzz target on my computer just for fun, after a simplicity bootcamp in Sao Paulo, and when executing the target:
cargo +nightly fuzz run compile_parse_tree

I got the following error:

$ cargo +nightly fuzz run compile_parse_tree
   Compiling simplicityhl-fuzz v0.0.0 (/Users/lucasbalieiro/Projects/SimplicityHL/fuzz)
error[E0425]: cannot find function `to_commit_node` in module `named`
  --> fuzz_targets/compile_parse_tree.rs:27:37
   |
27 |     let _simplicity_commit = named::to_commit_node(&simplicity_named_construct)
   |                                     ^^^^^^^^^^^^^^ not found in `named`

For more information about this error, try `rustc --explain E0425`.
error: could not compile `simplicityhl-fuzz` (bin "compile_parse_tree") due to 1 previous error
Error: failed to build fuzz script: ASAN_OPTIONS="detect_odr_violation=0" RUSTFLAGS=" -Cpasses=sancov-module -Cllvm-args=-sanitizer-coverage-level=4 -Cllvm-args=-sanitizer-coverage-inline-8bit-counters -Cllvm-args=-sanitizer-coverage-pc-table -Cllvm-args=-sanitizer-coverage-trace-compares --cfg fuzzing -Cllvm-args=-simplifycfg-branch-fold-threshold=0 -Zsanitizer=address -Cdebug-assertions -Ccodegen-units=1" "cargo" "build" "--manifest-path" "/Users/lucasbalieiro/Projects/SimplicityHL/fuzz/Cargo.toml" "--target" "aarch64-apple-darwin" "--release" "--config" "profile.release.debug=\"line-tables-only\"" "--bin" "compile_parse_tree"

by looking at the commit history I can see that this commit replaced named::to_commit_node with named::forget_names

So, shouldn't this fuzz target with something like this (?):

diff --git a/fuzz/fuzz_targets/compile_parse_tree.rs b/fuzz/fuzz_targets/compile_parse_tree.rs
index 05014f1..f0efa19 100644
--- a/fuzz/fuzz_targets/compile_parse_tree.rs
+++ b/fuzz/fuzz_targets/compile_parse_tree.rs
@@ -24,6 +24,5 @@ fuzz_target!(|data: &[u8]| {
         .compile(arguments, false)
         .with_file("")
         .expect("AST should compile with given arguments");
-    let _simplicity_commit = named::to_commit_node(&simplicity_named_construct)
-        .expect("Conversion to commit node should never fail");
+    let _simplicity_commit = named::forget_names(&simplicity_named_construct);
 });

Minimal reproduction steps

checked at the main branch, in the root of the repo run:
cargo +nightly fuzz run compile_parse_tree

My machine details:

$ system_profiler SPSoftwareDataType

Software:

    System Software Overview:

      System Version: macOS 26.0.1 (25A362)
      Kernel Version: Darwin 25.0.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: Lucas’s MacBook Pro
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 23 hours, 43 minutes

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions