Go to file

Trying to fuzz the tutorial fails with a linking error:

$ nix-shell --run 'cargo bolero test fibonaci_test --sanitizer NONE'
   Compiling my-fibonacci v0.1.0 (/home/jtojnar/Projects/cargo-bolero-nix)
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/bin:.:/nix/store/z8dx4c6z528qi2w1p38yzg17g8q5jnln-cargo-1.77.2/bin:/nix/store/4gfh6jmx3czc1n4l2dw8rc2nzbzqarlx-cargo-bolero-0.9.0/bin:/nix/store/j2zdy07sb5nbiskhp5g79c93rj9076n0-rustc-wrapper-1.77.2/bin:/nix/store/nbad47q0m0m9c5xid7zh05hiknwircbp-patchelf-0.15.0/bin:/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin:/nix/store/14c6s4xzhy14i2b05s00rjns2j93gzz4-gcc-13.2.0/bin:/nix/store/c2i631h8i5vcs1sqifwxfsazhwrg6wr5-glibc-2.39-52-bin/bin:/nix/store/php4qidg2bxzmm79vpri025bqi0fa889-coreutils-9.5/bin:/nix/store/kln7kinji3b7sz8r50h4gn9yy6k1js9a-binutils-wrapper-2.41/bin:/nix/store/bgcaxhhxswzvmxjbbgvvaximm5hwghz1-binutils-2.41/bin:/nix/store/php4qidg2bxzmm79vpri025bqi0fa889-coreutils-9.5/bin:/nix/store/jjcsr5gs4qanf7ln5c6wgcq4sn75a978-findutils-4.9.0/bin:/nix/store/i34mknsjgrfyy71k2h79gda0bvagzc2j-diffutils-3.10/bin:/nix/store/5zjms21vpxlkbc0qyl5pmj2sidfmzmd7-gnused-4.9/bin:/nix/store/28gpmx3z6ss3znd7fhmrzmvk3x5lnfbk-gnugrep-3.11/bin:/nix/store/8vvkbgmnin1x2jkp7wcb2zg1p0vc4ks9-gawk-5.2.2/bin:/nix/store/rik7p68cq7yzlj5pmfpf4yv6jnrpvlgf-gnutar-1.35/bin:/nix/store/j5chw7v1x3vlmf3wmdpdb5gwh9hl0b80-gzip-1.13/bin:/nix/store/mxcq77rlan82dzpv3cgj0fh6qvv8ncil-bzip2-1.0.8-bin/bin:/nix/store/cdzpn0rdq810aknww3w9fy3wmw9ixr66-gnumake-4.4.1/bin:/nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/bin:/nix/store/0lfxbmchigx9vs9qmrlbahcy6nxwfnj1-patch-2.7.6/bin:/nix/store/6i4xxaa812vsbli9jkq4mksdddrk27lw-xz-5.4.6-bin/bin:/nix/store/xx7x1dwybpssfhq8yikvzz38bh3yrq97-file-5.45/bin:/run/wrappers/bin:/home/jtojnar/.nix-profile/bin:/nix/profile/bin:/home/jtojnar/.local/state/nix/profile/bin:/etc/profiles/per-user/jtojnar/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin" VSLANG="1033" "cc" "-m64" "/run/user/1000/rustcspbAMX/symbols.o" "/home/jtojnar/Projects/cargo-bolero-nix/target/fuzz/build_3a9a5e244c958d24/x86_64-unknown-linux-gnu/fuzz/deps/my_fibonacci-f4291ade039c958b.my_fibonacci.93e96f14c6d6f6c6-cgu.0.rcgu.o" "/home/jtojnar/Projects/cargo-bolero-nix/target/fuzz/build_3a9a5e244c958d24/x86_64-unknown-linux-gnu/fuzz/deps/my_fibonacci-f4291ade039c958b.3qurakfd59ze1ieb.rcgu.o" "-Wl,--as-needed" "-L" "/home/jtojnar/Projects/cargo-bolero-nix/target/fuzz/build_3a9a5e244c958d24/x86_64-unknown-linux-gnu/fuzz/deps" "-L" "/home/jtojnar/Projects/cargo-bolero-nix/target/fuzz/build_3a9a5e244c958d24/fuzz/deps" "-L" "/home/jtojnar/Projects/cargo-bolero-nix/target/fuzz/build_3a9a5e244c958d24/x86_64-unknown-linux-gnu/fuzz/build/bolero-libfuzzer-ceac76818f48d694/out" "-L" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libtest-1c724dc64cc32d16.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgetopts-1dd63bda06d76fcc.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunicode_width-81d884422ba52c65.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_std-9fbdbcc598b62ba2.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-40bfb90c61fea8bb.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-95e6fcda3c282ef0.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-4c75151b6abbc292.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-35d5d497b8d90ce6.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-2f6618a016b45d26.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-3713889443fb7bea.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-677d6c5accc4e720.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-664f3e6bf23fe26d.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-fbedc56b0fc6fec3.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-80c24ebfb833516b.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-52b38c8b62b2f7a9.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-753fd57b99b33e72.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-ba50f8b8cf90eac5.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-f43c897f776e3ba4.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-1281b004ca04ec16.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-29711796eaedc6ea.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-f61490b3d499378b.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-48f913ee54104648.rlib" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-1a2195e5af3bb1e3.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/nix/store/0863sk26ypql2h09j8r93h7q0qw22y48-rustc-1.77.2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/jtojnar/Projects/cargo-bolero-nix/target/fuzz/build_3a9a5e244c958d24/x86_64-unknown-linux-gnu/fuzz/deps/my_fibonacci-f4291ade039c958b" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs" "-fuse-ld=gold"
  = note: /build/rustc-1.77.2-src/library/std/src/sys_common/backtrace.rs:151: error: undefined reference to '__sancov_lowest_stack'
          /build/rustc-1.77.2-src/library/core/src/ops/function.rs:250: error: undefined reference to '__sanitizer_cov_trace_pc_indir'
          /build/rustc-1.77.2-src/library/std/src/rt.rs:159: error: undefined reference to '__sancov_lowest_stack'
          /build/rustc-1.77.2-src/library/std/src/rt.rs:166: error: undefined reference to '__sancov_lowest_stack'
          /build/rustc-1.77.2-src/library/core/src/ops/function.rs:250: error: undefined reference to '__sancov_lowest_stack'
          /build/rustc-1.77.2-src/library/core/src/ops/function.rs:250: error: undefined reference to '__sanitizer_cov_trace_pc_indir'
          /build/rustc-1.77.2-src/library/core/src/cmp.rs:1573: error: undefined reference to '__sanitizer_cov_trace_const_cmp8'
          /home/jtojnar/Projects/cargo-bolero-nix/target/fuzz/build_3a9a5e244c958d24/x86_64-unknown-linux-gnu/fuzz/deps/my_fibonacci-f4291ade039c958b.my_fibonacci.93e96f14c6d6f6c6-cgu.0.rcgu.o:my_fibonacci.93e96f14c6d6f6c6-cgu.0:function sancov.module_ctor_8bit_counters:(.text.sancov.module_ctor_8bit_counters+0x10): error: undefined reference to '__sanitizer_cov_8bit_counters_init'
          /home/jtojnar/Projects/cargo-bolero-nix/target/fuzz/build_3a9a5e244c958d24/x86_64-unknown-linux-gnu/fuzz/deps/my_fibonacci-f4291ade039c958b.my_fibonacci.93e96f14c6d6f6c6-cgu.0.rcgu.o:my_fibonacci.93e96f14c6d6f6c6-cgu.0:function sancov.module_ctor_8bit_counters:(.text.sancov.module_ctor_8bit_counters+0x23): error: undefined reference to '__sanitizer_cov_pcs_init'
          collect2: error: ld returned 1 exit status
          
  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)

error: could not compile `my-fibonacci` (lib test) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: getting status result from command BOLERO_FUZZER="libfuzzer" RUSTDOCFLAGS="--cfg fuzzing -Cdebug-assertions -Ctarget-cpu=native -Cdebuginfo=2 -Coverflow_checks -Clink-dead-code -Cpasses=sancov-module --cfg fuzzing_libfuzzer -Cllvm-args=-sanitizer-coverage-inline-8bit-counters -Cllvm-args=-sanitizer-coverage-level=4 -Cllvm-args=-sanitizer-coverage-pc-table -Cllvm-args=-sanitizer-coverage-trace-compares -Cllvm-args=-sanitizer-coverage-stack-depth -Clink-arg=-fuse-ld=gold" RUSTFLAGS="--cfg fuzzing -Cdebug-assertions -Ctarget-cpu=native -Cdebuginfo=2 -Coverflow_checks -Clink-dead-code -Cpasses=sancov-module --cfg fuzzing_libfuzzer -Cllvm-args=-sanitizer-coverage-inline-8bit-counters -Cllvm-args=-sanitizer-coverage-level=4 -Cllvm-args=-sanitizer-coverage-pc-table -Cllvm-args=-sanitizer-coverage-trace-compares -Cllvm-args=-sanitizer-coverage-stack-depth -Clink-arg=-fuse-ld=gold" "cargo" "test" "--target" "x86_64-unknown-linux-gnu" "--profile" "fuzz" "--target-dir" "target/fuzz/build_3a9a5e244c958d24" "fibonaci_test" "--no-run" "--" "--exact": process exited with status 101
Description
No description provided
Readme 38 KiB
Languages
Rust 50.2%
Nix 49.8%