loiclec / fuzzcheck-rs

Modular, structure-aware, and feedback-driven fuzzing engine for Rust functions
MIT License
436 stars 13 forks source link

Linking failure #27

Closed teymour-aldridge closed 2 years ago

teymour-aldridge commented 2 years ago

Unfortunately, the linking failure of #16 seems to have reappeared.

When trying to fuzz the parser in https://github.com/bailion/compiler (cd logic and then cargo make fuzz_parser), I get the following error:

error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "-arch" "x86_64" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/logic-7ac7bc4893af41b9.logic.0e5fb5ab-cgu.0.rcgu.o" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/logic-7ac7bc4893af41b9.4yaop7vyo3oi4jwd.rcgu.o" "-L" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps" "-L" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/release/deps" "-L" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libtest-a4a9d6dfc3cb7d1f.rlib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgetopts-55c643af53b487f5.rlib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunicode_width-8c1befd68a350645.rlib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_std-dec7a406a59f4fba.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libcodespan_reporting-82c8e7395ad6fdf4.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libunicode_width-31ad6be4b3da7d47.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libtermcolor-227b2033f8af4be6.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libinsta-5b30e4f2c07d2ff2.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libserde_yaml-23eb7e8bf528de33.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libdtoa-f08731f63527036f.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libyaml_rust-1ec932a87c92770b.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/liblinked_hash_map-f64af7936bb0c6af.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libserde_json-7707b3a258d2c0b1.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libryu-084f98775f2bcd47.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libitoa-968cb5afac804c6e.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libconsole-b1d29735e93c7139.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libterminal_size-364f620309169771.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/liblibc-9ed5cae0a36ea3b0.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libonce_cell-8350a75654ff790b.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libsimilar-0ad18ca182410cf5.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/liblazy_static-d17e8e322d532086.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libserde-bdaafaf0e8ea3cc6.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libcranelift_native-1298c3d89661444d.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libcranelift_object-5b5a31ca4774c87b.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libobject-b923024a54506e05.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libcrc32fast-276a9bd7e70c6f77.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libcranelift_module-98c1a9163fdd9094.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libanyhow-11983f43fb507c02.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libcranelift_frontend-c8345ff42c355adf.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libcranelift_codegen-daff7c9a26795d87.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libcranelift_codegen_shared-d00b75645acd2a37.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libtarget_lexicon-a03bebfee3d29059.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libregalloc-b65994f28308d55e.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/librustc_hash-4fd02005b8127820.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libsmallvec-aeba58bbd836ea6f.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/liblog-ca81a8a9c5dfefe4.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libcfg_if-52dced1ddfaa61ad.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libgimli-43b2a080cee38cfc.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libindexmap-514a508969108009.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libhashbrown-26648b9b20b392d9.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libcranelift_bforest-2e7f1541a75ed107.rlib" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/libcranelift_entity-a339fc096e338d99.rlib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-e0d1108e51bfb0d5.rlib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-b302e9efd55d58df.rlib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libobject-8d60cc1207aa0389.rlib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libmemchr-e6496f81ac614178.rlib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-6fe0ca55ac7c684e.rlib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgimli-6251ec83c25e2fdb.rlib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_detect-3724da203e764788.rlib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-12f49b029d72fd67.rlib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-46cc73ae324c4251.rlib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-6365dfa364b30124.rlib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-5e590d4590629f98.rlib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-31e558d6f4ce9e06.rlib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-7ea8daf78864f633.rlib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-e206da7209af9420.rlib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-7454d006639b0b9c.rlib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-07b1a016408f5808.rlib" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-0f6214b7ec76071f.rlib" "-liconv" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv" "-L" "/Users/teymouraldridge/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/Users/teymouraldridge/Desktop/tmp/compiler/logic/target/fuzzcheck/x86_64-apple-darwin/release/deps/logic-7ac7bc4893af41b9" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: Undefined symbols for architecture x86_64:
            "___llvm_profile_runtime", referenced from:
                ___llvm_profile_runtime_user in logic-7ac7bc4893af41b9.logic.0e5fb5ab-cgu.0.rcgu.o
                ___llvm_profile_runtime_user in libcodespan_reporting-82c8e7395ad6fdf4.rlib(codespan_reporting-82c8e7395ad6fdf4.codespan_reporting.bc7a71ab-cgu.0.rcgu.o)
                ___llvm_profile_runtime_user in libtermcolor-227b2033f8af4be6.rlib(termcolor-227b2033f8af4be6.termcolor.82ddc2c6-cgu.0.rcgu.o)
                ___llvm_profile_runtime_user in libinsta-5b30e4f2c07d2ff2.rlib(insta-5b30e4f2c07d2ff2.insta.a67da457-cgu.0.rcgu.o)
                ___llvm_profile_runtime_user in libserde_yaml-23eb7e8bf528de33.rlib(serde_yaml-23eb7e8bf528de33.serde_yaml.3f5d8c86-cgu.0.rcgu.o)
                ___llvm_profile_runtime_user in libsimilar-0ad18ca182410cf5.rlib(similar-0ad18ca182410cf5.similar.489981ad-cgu.0.rcgu.o)
                ___llvm_profile_runtime_user in libserde_json-7707b3a258d2c0b1.rlib(serde_json-7707b3a258d2c0b1.serde_json.1500859e-cgu.0.rcgu.o)
                ...
               (maybe you meant: ___llvm_profile_runtime_user)
          ld: symbol(s) not found for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm on an Intel x86_64 processor, MacOS Catalina.

teymour-aldridge commented 2 years ago

Oops! Turns out that I was not activating all the features I needed to.

notably the one which activated fuzzcheck