Closed Ekleog closed 2 years ago
Oh wow I haven't seen that one yet. It might be because we're still passing a few coverage flags without a sanitizer specified.
You could try removing one or all of these to see if it fixes it? But it does look like a regression in either rustc or LLVM as this did compile on stable previously.
we're using cargo-fuzz with RUSTC_BOOTSTRAP currently, but it looks like cargo-bolero doesn't proxy this trick
I'm definitely open to support this. If you'd be willing to do a PR, we can get it in.
Thank you very much about this! (and sorry I didn't have any time to look into it before you did so, life has been quite hectic recently and I'm not sure when I'll find time for helping projects I like)
I can confirm that rustc no longer segfaults on 7187c3febbb7ac4dad71a5b6eca42a5039869fa6. That said I'm now getting the following linker errors about sanitizer coverage with the same code and running method. Do you know if it's expected (because this commit is not a release) or it's a bug, in which case I should open a new issue to track it?
= note: "cc" "-m64" "/home/ekleog/prog/test-bolero/target/fuzz/build_71e6fd6154e07acb/x86_64-unknown-linux-gnu/release/deps/test_bolero-03796c9c1fd7ff1a.test_bolero.a997a281-cgu.0.rcgu.o" "/home/ekleog/prog/test-bolero/target/fuzz/build_71e6fd6154e07acb/x86_64-unknown-linux-gnu/release/deps/test_bolero-03796c9c1fd7ff1a.rufpas6580vdgtv.rcgu.o" "-Wl,--as-needed" "-L" "/home/ekleog/prog/test-bolero/target/fuzz/build_71e6fd6154e07acb/x86_64-unknown-linux-gnu/release/deps" "-L" "/home/ekleog/prog/test-bolero/target/fuzz/build_71e6fd6154e07acb/release/deps" "-L" "/home/ekleog/prog/test-bolero/target/fuzz/build_71e6fd6154e07acb/x86_64-unknown-linux-gnu/release/build/bolero-libfuzzer-41b6a54ed54d4993/out" "-L" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libtest-efede371ca078f25.rlib" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgetopts-84fb18ba7592ffd9.rlib" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunicode_width-a1dc360b97cf3afc.rlib" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_std-4220d815fd1849e6.rlib" "-Wl,--start-group" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-05b39ac0cb4c5688.rlib" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-ccaa149b737d6503.rlib" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-a94a6388c153126b.rlib" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-1ecfa264246b85c6.rlib" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-ee710154a50440b8.rlib" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-f09986d873ea8592.rlib" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-f3521e20c99619ab.rlib" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-df6036c77d75ce21.rlib" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-24f91c1a1dfc7e13.rlib" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-bffcc61991adb202.rlib" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-cf22313353d8663e.rlib" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-c45fb100f99430e9.rlib" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-0cdc47a8a81950ea.rlib" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-f1e158606c4c82f6.rlib" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-0b608b5ef4df0ec4.rlib" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-b8438dc0bcbbcc08.rlib" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-70e2ae036775ff2f.rlib" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-815d281f7068a893.rlib" "-Wl,--end-group" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-377835cfab8dae0d.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/home/ekleog/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/ekleog/prog/test-bolero/target/fuzz/build_71e6fd6154e07acb/x86_64-unknown-linux-gnu/release/deps/test_bolero-03796c9c1fd7ff1a" "-pie" "-Wl,-zrelro,-znow" "-Wl,-O1" "-nodefaultlibs" "-fuse-ld=gold"
= note: /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:118: error: undefined reference to '__sancov_lowest_stack'
/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/ops/function.rs:227: error: undefined reference to '__sanitizer_cov_trace_pc_indir'
/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/rt.rs:139: error: undefined reference to '__sancov_lowest_stack'
/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/rt.rs:145: error: undefined reference to '__sancov_lowest_stack'
/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/fmt/mod.rs:2132: error: undefined reference to '__sancov_lowest_stack'
/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/cmp.rs:1396: error: undefined reference to '__sanitizer_cov_trace_cmp8'
/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/fmt/mod.rs:388: error: undefined reference to '__sanitizer_cov_trace_cmp8'
/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/fmt/mod.rs:388: error: undefined reference to '__sanitizer_cov_trace_cmp8'
/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/ops/function.rs:227: error: undefined reference to '__sanitizer_cov_trace_pc_indir'
/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/cmp.rs:1396: error: undefined reference to '__sanitizer_cov_trace_cmp8'
/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/cmp.rs:1396: error: undefined reference to '__sanitizer_cov_trace_const_cmp8'
/home/ekleog/prog/test-bolero/target/fuzz/build_71e6fd6154e07acb/x86_64-unknown-linux-gnu/release/deps/test_bolero-03796c9c1fd7ff1a.test_bolero.a997a281-cgu.0.rcgu.o:test_bolero.a997a281-cgu.0:function sancov.module_ctor_8bit_counters: error: undefined reference to '__sanitizer_cov_8bit_counters_init'
/home/ekleog/prog/test-bolero/target/fuzz/build_71e6fd6154e07acb/x86_64-unknown-linux-gnu/release/deps/test_bolero-03796c9c1fd7ff1a.test_bolero.a997a281-cgu.0.rcgu.o:test_bolero.a997a281-cgu.0:function sancov.module_ctor_8bit_counters: error: undefined reference to '__sanitizer_cov_pcs_init'
collect2: error: ld returned 1 exit status
Yeah let's open another issue to track this one.
Hello!
So first of all, I recently learned of cargo-bolero, and it looks like an awesome piece of software, much neater to use than cargo-fuzz!
That said, I'm having trouble running the fibonacci example on rustc stable.
Here is my code from following the tutorial until the first
cargo bolero test
command: https://github.com/Ekleog/test-bolero/tree/main/tests/somethingI have just added a
bolero = "0.6"
dependency to Cargo.toml that seemed required, in addition to following the tutorial.However, if I try running
cargo bolero test something --sanitizer NONE
, it's crashing rustc as a segfault inside LLVM:Is this something you've already seen happening, and/or reported upstream to rustc? Do you have any idea where I should be looking around to try and debug this? Also, interestingly running with nightly rust (so without --sanitizer NONE and with installing a nightly toolchain), it's no longer failing.
I'd love to switch our use of cargo-fuzz to using cargo-bolero instead, but if it requires a nightly toolchain to be installed it'd be much harder unfortunately (we're using cargo-fuzz with RUSTC_BOOTSTRAP currently, but it looks like cargo-bolero doesn't proxy this trick)