Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuzzcheck can't run on NixOS #29

Open
PoignardAzur opened this issue Apr 21, 2022 · 2 comments
Open

Fuzzcheck can't run on NixOS #29

PoignardAzur opened this issue Apr 21, 2022 · 2 comments

Comments

@PoignardAzur
Copy link

PoignardAzur commented Apr 21, 2022

I tried to run FuzzCheck on NixOS to see if it had the same problems as I have on my Ubuntu desktop.

Predictably, the build instead failed due to completely unrelated errors.

Mostly it's looking for system libs and not finding them. I'm not sure how you could solve that with cargo install. Maybe I could try making a NixOS package directly.

My system:

  • OS version: NixOS, nix-env (Nix) 2.3.10
  • Rust version: 1.60
  • Fuzzcheck version: 0.12.0
@PoignardAzur
Copy link
Author

Error messages:

error: failed to run custom build command for `fuzzcheck v0.11.0 (https://github.com/loiclec/fuzzcheck-rs#8f7de6fa)`

Caused by:
  process didn't exit successfully: `/home/olivier-faure/Documents/venial/target/fuzzcheck/fuzzing/build/fuzzcheck-79c9b2bdd54171d2/build-script-build` (exit status: 1)
  --- stdout
  TARGET = Some("x86_64-unknown-linux-gnu")
  OPT_LEVEL = Some("3")
  HOST = Some("x86_64-unknown-linux-gnu")
  CC_x86_64-unknown-linux-gnu = None
  CC_x86_64_unknown_linux_gnu = None
  HOST_CC = None
  CC = None
  CFLAGS_x86_64-unknown-linux-gnu = None
  CFLAGS_x86_64_unknown_linux_gnu = None
  HOST_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,llvm14-builtins-abi,sse,sse2")
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-Wall" "-Wextra" "-o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/fuzzcheck-639136dc22a41961/out/src/code_coverage_sensor/instrumentation_pointers_linux.o" "-c" "src/code_coverage_sensor/instrumentation_pointers_linux.c"
  exit status: 0
  AR_x86_64-unknown-linux-gnu = None
  AR_x86_64_unknown_linux_gnu = None
  HOST_AR = None
  AR = None
  running: "ar" "cq" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/fuzzcheck-639136dc22a41961/out/libinstrumentation_pointers.a" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/fuzzcheck-639136dc22a41961/out/src/code_coverage_sensor/instrumentation_pointers_linux.o"

  --- stderr


  error occurred: Failed to find tool. Is `ar` installed?


warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `libz-sys v1.1.5`

Caused by:
  process didn't exit successfully: `/home/olivier-faure/Documents/venial/target/fuzzcheck/fuzzing/build/libz-sys-52c1be84bec78157/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=LIBZ_SYS_STATIC
  cargo:rerun-if-changed=build.rs
  cargo:rerun-if-env-changed=ZLIB_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=ZLIB_STATIC
  cargo:rerun-if-env-changed=ZLIB_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo-warning=`"pkg-config" "--libs" "--cflags" "zlib"` did not exit successfully: exit status: 1
  error: could not find system library 'zlib' required by the 'libz-sys' crate

  --- stderr
  Package zlib was not found in the pkg-config search path.
  Perhaps you should add the directory containing `zlib.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'zlib' found

  OPT_LEVEL = Some("3")
  TARGET = Some("x86_64-unknown-linux-gnu")
  HOST = Some("x86_64-unknown-linux-gnu")
  CC_x86_64-unknown-linux-gnu = None
  CC_x86_64_unknown_linux_gnu = None
  HOST_CC = None
  CC = None
  CFLAGS_x86_64-unknown-linux-gnu = None
  CFLAGS_x86_64_unknown_linux_gnu = None
  HOST_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,llvm14-builtins-abi,sse,sse2")
  running "cc" "src/smoke.c" "-o" "/dev/null" "-lz"
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DZ_SOLO" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/adler32.o" "-c" "src/zlib/adler32.c"
  exit status: 0
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DZ_SOLO" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/compress.o" "-c" "src/zlib/compress.c"
  exit status: 0
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DZ_SOLO" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/crc32.o" "-c" "src/zlib/crc32.c"
  exit status: 0
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DZ_SOLO" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/deflate.o" "-c" "src/zlib/deflate.c"
  exit status: 0
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DZ_SOLO" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/infback.o" "-c" "src/zlib/infback.c"
  exit status: 0
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DZ_SOLO" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/inffast.o" "-c" "src/zlib/inffast.c"
  exit status: 0
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DZ_SOLO" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/inflate.o" "-c" "src/zlib/inflate.c"
  exit status: 0
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DZ_SOLO" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/inftrees.o" "-c" "src/zlib/inftrees.c"
  exit status: 0
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DZ_SOLO" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/trees.o" "-c" "src/zlib/trees.c"
  exit status: 0
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DZ_SOLO" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/uncompr.o" "-c" "src/zlib/uncompr.c"
  exit status: 0
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DZ_SOLO" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/zutil.o" "-c" "src/zlib/zutil.c"
  exit status: 0
  AR_x86_64-unknown-linux-gnu = None
  AR_x86_64_unknown_linux_gnu = None
  HOST_AR = None
  AR = None
  running: "ar" "cq" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/libz.a" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/adler32.o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/compress.o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/crc32.o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/deflate.o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/infback.o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/inffast.o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/inflate.o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/inftrees.o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/trees.o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/uncompr.o" "/home/olivier-faure/Documents/venial/target/fuzzcheck/x86_64-unknown-linux-gnu/fuzzing/build/libz-sys-031fbc85e9593500/out/lib/src/zlib/zutil.o"

  --- stderr
  src/smoke.c:1:10: fatal error: 'zlib.h' file not found
  #include <zlib.h>
           ^~~~~~~~
  1 error generated.


  error occurred: Failed to find tool. Is `ar` installed?

@PoignardAzur
Copy link
Author

I managed to get it running with the following commands:

$ nix-shell -p rustup
$ cargo +nightly fuzzcheck fuzz::fuzz_parse --profile fuzzing

But now I have the same error as on my main PC:

running 1 test
test fuzz::fuzz_parse ... thread 'main' panicked at 'failed to properly link the different LLVM coverage sections: CannotFindFunctionRecordAssociatedWithPrfData("This can sometimes happen when the crate is incrementally compiled with more than one codegen-unit. Try adding codegen-units = 1 or incremental = false to the appropriate profile (release or fuzzing) in Cargo.toml")', /home/olivier-faure/.cargo/git/checkouts/fuzzcheck-rs-531eb3f95f61a5dd/8f7de6f/fuzzcheck/src/code_coverage_sensor/mod.rs:71:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
FAILED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant