wasmtime icon indicating copy to clipboard operation
wasmtime copied to clipboard

how to run fuzz target

Open 0xfocu5 opened this issue 1 year ago • 1 comments

RUST_BACKTRACE=1 cargo fuzz run compile Compiling capstone-sys v0.13.0 Compiling zstd-safe v5.0.1+zstd.1.5.2 Compiling ittapi v0.4.0 Compiling ocaml-sys v0.22.3 error: failed to run custom build command for ocaml-sys v0.22.3 note: To improve backtraces for build dependencies, set the CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.

Caused by: process didn't exit successfully: /home/vuln/cache/wasmtime/target/release/build/ocaml-sys-4b66730913b15875/build-script-build (exit status: 101) --- stdout cargo:rerun-if-env-changed=OCAMLOPT cargo:rerun-if-env-changed=OCAML_VERSION cargo:rerun-if-env-changed=OCAML_WHERE_PATH

--- stderr thread 'main' panicked at /home/vuln/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ocaml-sys-0.22.3/build.rs:143:11: called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "No such file or directory" } stack backtrace: 0: rust_begin_unwind at /rustc/f688dd684faca5b31b156fac2c6e0ae81fc9bc90/library/std/src/panicking.rs:645:5 1: core::panicking::panic_fmt at /rustc/f688dd684faca5b31b156fac2c6e0ae81fc9bc90/library/core/src/panicking.rs:72:14 2: core::result::unwrap_failed at /rustc/f688dd684faca5b31b156fac2c6e0ae81fc9bc90/library/core/src/result.rs:1649:5 3: core::result::Result<T,E>::unwrap 4: build_script_build::main 5: core::ops::function::FnOnce::call_once note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace. warning: build failed, waiting for other jobs to finish... 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 -Clink-dead-code -Zsanitizer=address -Cllvm-args=-sanitizer-coverage-stack-depth -Cdebug-assertions -C codegen-units=1" "cargo" "build" "--manifest-path" "/home/vuln/cache/wasmtime/fuzz/Cargo.toml" "--target" "x86_64-unknown-linux-gnu" "--release" "--bin" "compile"

Stack backtrace: 0: anyhow::error::<impl anyhow::Error>::msg 1: cargo_fuzz::project::FuzzProject::exec_build 2: cargo_fuzz::project::FuzzProject::exec_fuzz 3: <cargo_fuzz::options::run::Run as cargo_fuzz::RunCommand>::run_command 4: cargo_fuzz::main 5: std::sys_common::backtrace::__rust_begin_short_backtrace 6: std::rt::lang_start::{{closure}} 7: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once at /rustc/f688dd684faca5b31b156fac2c6e0ae81fc9bc90/library/core/src/ops/function.rs:284:13 8: std::panicking::try::do_call at /rustc/f688dd684faca5b31b156fac2c6e0ae81fc9bc90/library/std/src/panicking.rs:552:40 9: std::panicking::try at /rustc/f688dd684faca5b31b156fac2c6e0ae81fc9bc90/library/std/src/panicking.rs:516:19 10: std::panic::catch_unwind at /rustc/f688dd684faca5b31b156fac2c6e0ae81fc9bc90/library/std/src/panic.rs:142:14 11: std::rt::lang_start_internal::{{closure}} at /rustc/f688dd684faca5b31b156fac2c6e0ae81fc9bc90/library/std/src/rt.rs:148:48 12: std::panicking::try::do_call at /rustc/f688dd684faca5b31b156fac2c6e0ae81fc9bc90/library/std/src/panicking.rs:552:40 13: std::panicking::try at /rustc/f688dd684faca5b31b156fac2c6e0ae81fc9bc90/library/std/src/panicking.rs:516:19 14: std::panic::catch_unwind at /rustc/f688dd684faca5b31b156fac2c6e0ae81fc9bc90/library/std/src/panic.rs:142:14 15: std::rt::lang_start_internal at /rustc/f688dd684faca5b31b156fac2c6e0ae81fc9bc90/library/std/src/rt.rs:148:20 16: main 17: __libc_start_call_main at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16 18: __libc_start_main_impl at ./csu/../csu/libc-start.c:392:3 19: _start

0xfocu5 avatar Jan 05 '24 09:01 0xfocu5

The error here as stated in the error message is building ocaml-sys which probably means you don't have ocaml on your system for running the spec interpreter. You can either set that up or you can fuzz with --no-default-features to disable the spec interpreter.

alexcrichton avatar Jan 05 '24 16:01 alexcrichton

I think this was answered so I'm going to close this, but feel free to comment more here if that's not the case.

alexcrichton avatar Mar 01 '24 19:03 alexcrichton