bcnode
bcnode copied to clipboard
Problem building from source on Ubuntu 18.04 Bionic related to the AFL-gcc
Prerequisites
- [LATEST] Are you running the latest version?
- [BUILT FROM SOURCE] Are you running the docker image or did you built from source?
- [YES] Did you check the README.md for steps to run?
- [YES] Did you check logs? (either in console or in
_logs
directory)
For more information, see the CONTRIBUTING
guide.
Description
Problem building from source on Ubuntu 18.04 Bionic related the AFL, see the build error output in the "Logs" section (or see the attached file)
The issue seems to be related to broken AFL in Ubuntu 18.04 and only solved by gcc-7 7.3.0-18 (not available yet as of time of writing) Reference: http://www.danielstender.com/blog/afl-ubuntu1804/ https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895618
Steps to Reproduce
See the build error output after running "yarn run dist" in the "logs" section or see the attached file.
Expected behavior: [What you expected to happen] bcnode build correctly
Actual behavior: [What actually happened] build failed as shown above
Versions
latest commit on 12 June 2018 https://github.com/blockcollider/bcnode/commit/4bfee3224a670e9178b185b198a6fa97c865541b version 0.6.1
Application (required)
You can get this information: 0.6.1#4bfee32
Environment (optional but helpful)
- OS Version (Ubuntu 18.04 Bionic LTS)
- Nodejs (v8.11.2)
- Rust (rustc 1.28.0-nightly (2a0062974 2018-06-09))
Logs
error: failed to run custom build command for afl v0.3.2 (https://github.com/rust-fuzz/afl.rs#b82c8f4d)
process didn't exit successfully: /home/david/Dev/bcnode/native/target/release/build/afl-4f99eeda6c8e496a/build-script-build
(exit code: 101)
--- stdout
rm -f afl-gcc afl-fuzz afl-showmap afl-tmin afl-gotcpu afl-analyze afl-as as afl-g++ afl-clang afl-clang++ *.o ~ a.out core core.[1-9][0-9] *.stackdump test .test test-instr .test-instr0 .test-instr1 qemu_mode/qemu-2.10.0.tar.bz2 afl-qemu-trace
rm -rf out_dir qemu_mode/qemu-2.10.0
make -C llvm_mode clean
make[1]: Entering directory '/home/david/.cargo/git/checkouts/afl.rs-ca2798daa1063b6c/b82c8f4/afl-2.52b/llvm_mode'
rm -f *.o *.so ~ a.out core core.[1-9][0-9] test-instr .test-instr0 .test-instr1
rm -f ../afl-clang-fast ../afl-llvm-rt.o ../afl-llvm-rt-32.o ../afl-llvm-rt-64.o ../afl-clang-fast++
make[1]: Leaving directory '/home/david/.cargo/git/checkouts/afl.rs-ca2798daa1063b6c/b82c8f4/afl-2.52b/llvm_mode'
make -C libdislocator clean
make[1]: Entering directory '/home/david/.cargo/git/checkouts/afl.rs-ca2798daa1063b6c/b82c8f4/afl-2.52b/libdislocator'
rm -f *.o *.so ~ a.out core core.[1-9][0-9]
rm -f libdislocator.so
make[1]: Leaving directory '/home/david/.cargo/git/checkouts/afl.rs-ca2798daa1063b6c/b82c8f4/afl-2.52b/libdislocator'
make -C libtokencap clean
make[1]: Entering directory '/home/david/.cargo/git/checkouts/afl.rs-ca2798daa1063b6c/b82c8f4/afl-2.52b/libtokencap'
rm -f .o .so ~ a.out core core.[1-9][0-9]
rm -f libtokencap.so
make[1]: Leaving directory '/home/david/.cargo/git/checkouts/afl.rs-ca2798daa1063b6c/b82c8f4/afl-2.52b/libtokencap'
[] Checking for the ability to compile x86 code...
[+] Everything seems to be working, ready to compile.
cc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH="/lib/afl" -DDOC_PATH="/share/doc/afl" -DBIN_PATH="/bin" afl-gcc.c -o afl-gcc -ldl
set -e; for i in afl-g++ afl-clang afl-clang++; do ln -sf afl-gcc $i; done
cc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH="/lib/afl" -DDOC_PATH="/share/doc/afl" -DBIN_PATH="/bin" afl-fuzz.c -o afl-fuzz -ldl
cc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH="/lib/afl" -DDOC_PATH="/share/doc/afl" -DBIN_PATH="/bin" afl-showmap.c -o afl-showmap -ldl
cc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH="/lib/afl" -DDOC_PATH="/share/doc/afl" -DBIN_PATH="/bin" afl-tmin.c -o afl-tmin -ldl
cc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH="/lib/afl" -DDOC_PATH="/share/doc/afl" -DBIN_PATH="/bin" afl-gotcpu.c -o afl-gotcpu -ldl
cc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH="/lib/afl" -DDOC_PATH="/share/doc/afl" -DBIN_PATH="/bin" afl-analyze.c -o afl-analyze -ldl
cc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH="/lib/afl" -DDOC_PATH="/share/doc/afl" -DBIN_PATH="/bin" afl-as.c -o afl-as -ldl
ln -sf afl-as as
[] Testing the CC wrapper and instrumentation output...
unset AFL_USE_ASAN AFL_USE_MSAN; AFL_QUIET=1 AFL_INST_RATIO=100 AFL_PATH=. ./afl-gcc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH="/lib/afl" -DDOC_PATH="/share/doc/afl" -DBIN_PATH="/bin" test-instr.c -o test-instr -ldl
echo 0 | ./afl-showmap -m none -q -o .test-instr0 ./test-instr
echo 1 | ./afl-showmap -m none -q -o .test-instr1 ./test-instr
Oops, the instrumentation does not seem to be behaving correctly!
Please ping [email protected] to troubleshoot the issue.
Makefile:90: recipe for target 'test_build' failed
--- stderr make: *** [test_build] Error 1 thread 'main' panicked at 'assertion failed: status.success()', /home/david/.cargo/git/checkouts/afl.rs-ca2798daa1063b6c/b82c8f4/build.rs:29:5 stack backtrace: 0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49 1: std::sys_common::backtrace::print at libstd/sys_common/backtrace.rs:71 at libstd/sys_common/backtrace.rs:59 2: std::panicking::default_hook::{{closure}} at libstd/panicking.rs:211 3: std::panicking::default_hook at libstd/panicking.rs:227 4: std::panicking::rust_panic_with_hook at libstd/panicking.rs:511 5: std::panicking::begin_panic 6: build_script_build::main 7: std::rt::lang_start::{{closure}} 8: std::panicking::try::do_call at libstd/rt.rs:59 at libstd/panicking.rs:310 9: __rust_maybe_catch_panic at libpanic_unwind/lib.rs:105 10: std::rt::lang_start_internal at libstd/panicking.rs:289 at libstd/panic.rs:374 at libstd/rt.rs:58 11: main 12: __libc_start_main 13: _start
warning: build failed, waiting for other jobs to finish... error: build failed neon ERR! cargo build failed
Error: cargo build failed
at Target.