🐇 Fuzzing Rust code with American Fuzzy Lop

Related tags

rust fuzzing fuzz-testing afl
Overview

afl.rs logo
afl.rs

Fuzzing Rust code with AFLplusplus

What is it?

Fuzz testing is a software testing technique used to find security and stability issues by providing pseudo-random data as input to the software. AFLplusplus is a popular, effective, and modern fuzz testing tool based on AFL. This library, afl.rs, allows one to run AFLplusplus on code written in the Rust programming language.

Documentation

Documentation can be found in the Rust Fuzz Book.

What does it look like?

Screen recording of afl

Screen recording of AFL running on Rust code.

lazy_static variables

lazy_static variables present problems for AFL's persistent mode, which afl.rs uses. Such variables can cause AFL to give incorrectly low stability reports, or fail to report timeouts, for example.

To address such problems, rust-fuzz provides a "resettable" version of lazy_static. To use it, make the following two changes to your target's Cargo.toml file.

  1. Add a [patch.crates-io] section and overide the lazy_static dependency with the rust-fuzz version:
    [patch.crates-io]
    lazy_static = { git = "https://github.com/rust-fuzz/resettable-lazy-static.rs" }
    
  2. Enable the reset_lazy_static feature on afl.rs:
    [dependencies]
    afl = { version = "*", features = ["reset_lazy_static"] }
Issues
  • Compile failure

    Compile failure

    When I try to compile the 'regex-afl' crate in https://github.com/SeanRBurton/regex/tree/afl, I get the following error:

    /home/usr/documents/regex/src/lib.rs:453:42: 453:52 error: /home/usr/documents/regex/regex-afl/target/debug/deps/libafl_plugin-86c859d7ecd403fc.so: undefined symbol: _ZNK4llvm10ModulePass17createPrinterPassERNS_11raw_ostreamERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE /home/sean/usr/documents/regex/src/lib.rs:453 #![cfg_attr(feature = "afl-fuzz", plugin(afl_plugin))]

    Can you please help me debug this?

    opened by SeanRBurton 34
  • SIGILL while compiling a project with afl.rs

    SIGILL while compiling a project with afl.rs

    Hi,

    I do not know if this bug comes from my setup or from afl.rs, so I'll post it here. I am trying to setup fuzzing for a tar parser built with nom, but I get a SIGILL while building the project. Here is the GDB output for the incriminated rustc call:

    (gdb) r src/main.rs --crate-name tar_example --crate-type bin -g --out-dir /home/geal/fuzzing/tar-parser.rs/fuzzed/target/debug --emit=dep-info,link -L dependency=/home/geal/fuzzing/tar-parser.rs/fuzzed/target/debug -L dependency=/home/geal/fuzzing/tar-parser.rs/fuzzed/target/debug/deps --extern afl_coverage=/home/geal/fuzzing/tar-parser.rs/fuzzed/target/debug/deps/libafl_coverage-b12fdfb78ced2df1.rlib --extern tar=/home/geal/fuzzing/tar-parser.rs/fuzzed/target/debug/deps/libtar-8c75079877dd814c.rlib --extern afl_coverage_plugin=/home/geal/fuzzing/tar-parser.rs/fuzzed/target/debug/deps/libafl_coverage_plugin-38726c8cba86ad1b.so --extern nom=/home/geal/fuzzing/tar-parser.rs/fuzzed/target/debug/deps/libnom-8d822f881e715e50.rlib -L native=/home/geal/fuzzing/tar-parser.rs/fuzzed/target/debug/build/afl-coverage-b12fdfb78ced2df1/out -L native=/home/geal/fuzzing/tar-parser.rs/fuzzed/target/debug/build/afl-coverage-b12fdfb78ced2df1/out
    Starting program: /usr/local/bin/rustc src/main.rs --crate-name tar_example --crate-type bin -g --out-dir /home/geal/fuzzing/tar-parser.rs/fuzzed/target/debug --emit=dep-info,link -L dependency=/home/geal/fuzzing/tar-parser.rs/fuzzed/target/debug -L dependency=/home/geal/fuzzing/tar-parser.rs/fuzzed/target/debug/deps --extern afl_coverage=/home/geal/fuzzing/tar-parser.rs/fuzzed/target/debug/deps/libafl_coverage-b12fdfb78ced2df1.rlib --extern tar=/home/geal/fuzzing/tar-parser.rs/fuzzed/target/debug/deps/libtar-8c75079877dd814c.rlib --extern afl_coverage_plugin=/home/geal/fuzzing/tar-parser.rs/fuzzed/target/debug/deps/libafl_coverage_plugin-38726c8cba86ad1b.so --extern nom=/home/geal/fuzzing/tar-parser.rs/fuzzed/target/debug/deps/libnom-8d822f881e715e50.rlib -L native=/home/geal/fuzzing/tar-parser.rs/fuzzed/target/debug/build/afl-coverage-b12fdfb78ced2df1/out -L native=/home/geal/fuzzing/tar-parser.rs/fuzzed/target/debug/build/afl-coverage-b12fdfb78ced2df1/out
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    Traceback (most recent call last):
      File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
        from libstdcxx.v6.printers import register_libstdcxx_printers
    ImportError: No module named 'libstdcxx'
    [New Thread 0x7fffefbff700 (LWP 13085)]
    warning: Missing auto-load scripts referenced in section .debug_gdb_scripts
    of file /home/geal/fuzzing/tar-parser.rs/fuzzed/target/debug/deps/libafl_coverage_plugin-38726c8cba86ad1b.so
    Use `info auto-load python-scripts [REGEXP]' to list them.
    afl-llvm-pass 1.77b by <[email protected]>
    
    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 0x7fffefbff700 (LWP 13085)]
    0x00007ffff3a57388 in llvm::PointerType::get(llvm::Type*, unsigned int) () from /usr/local/lib/librustc_llvm-d8ace771.so
    (gdb) bt
    #0  0x00007ffff3a57388 in llvm::PointerType::get(llvm::Type*, unsigned int) () from /usr/local/lib/librustc_llvm-d8ace771.so
    #1  0x00007ffff04514a6 in (anonymous namespace)::AFLCoverage::runOnModule(llvm::Module&) () from /home/geal/fuzzing/tar-parser.rs/fuzzed/target/debug/deps/libafl_coverage_plugin-38726c8cba86ad1b.so
    #2  0x00007ffff3a3e76f in llvm::FPPassManager::runOnFunction(llvm::Function&) () from /usr/local/lib/librustc_llvm-d8ace771.so
    #3  0x00007ffff3a3e84e in llvm::legacy::FunctionPassManagerImpl::run(llvm::Function&) () from /usr/local/lib/librustc_llvm-d8ace771.so
    #4  0x00007ffff3a3e944 in llvm::legacy::FunctionPassManager::run(llvm::Function&) () from /usr/local/lib/librustc_llvm-d8ace771.so
    #5  0x00007ffff2addc40 in LLVMRustRunFunctionPassManager (PM=0x7fffe8116270, M=0x7fffe8004e00) at /home/geal/dev/rust/rust/src/rustllvm/PassWrapper.cpp:205
    #6  0x00007ffff62ea584 in back::write::execute_work_item::h57fe4379208c73afFjd () from /usr/local/lib/librustc_trans-d8ace771.so
    #7  0x00007ffff62e3417 in back::write::run_passes::h0b7edf1f79d9711erZc () from /usr/local/lib/librustc_trans-d8ace771.so
    #8  0x00007ffff7ac74b4 in driver::phase_5_run_llvm_passes::h401bc1bb79e26ccfJPa () from /usr/local/lib/librustc_driver-d8ace771.so
    #9  0x00007ffff7a9a018 in driver::compile_input::h5f7ce1a1b74fe3e9Tba () from /usr/local/lib/librustc_driver-d8ace771.so
    #10 0x00007ffff7b769f4 in run_compiler::h99fee4b1ff194bd3x7b () from /usr/local/lib/librustc_driver-d8ace771.so
    #11 0x00007ffff7b743cf in boxed::F.FnBox$LT$A$GT$::call_box::h15186281694418648608 () from /usr/local/lib/librustc_driver-d8ace771.so
    #12 0x00007ffff7b73c1a in rt::unwind::try::try_fn::h4127295356855569320 () from /usr/local/lib/librustc_driver-d8ace771.so
    #13 0x00007ffff75db1d9 in rust_try_inner () from /usr/local/lib/libstd-d8ace771.so
    #14 0x00007ffff75db1c6 in rust_try () from /usr/local/lib/libstd-d8ace771.so
    #15 0x00007ffff754eb68 in rt::unwind::try::inner_try::hc82de977351d5e1crJw () from /usr/local/lib/libstd-d8ace771.so
    #16 0x00007ffff7b73e2c in boxed::F.FnBox$LT$A$GT$::call_box::h16559282529075441406 () from /usr/local/lib/librustc_driver-d8ace771.so
    #17 0x00007ffff7562412 in sys::thread::Thread::new::thread_start::h63af462716e59b66oTv () from /usr/local/lib/libstd-d8ace771.so
    #18 0x00007ffff1e75182 in start_thread (arg=0x7fffefbff700) at pthread_create.c:312
    #19 0x00007ffff71ab47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
    (gdb)
    

    I suspect that my version of rustc may be too new (I built it this morning):

    $ rustc -V
    rustc 1.2.0-dev (e749f724b 2015-06-23)
    

    This is on a Linux machine, but I made it work previously on a Macbook, although with an older rustc:

    $ rustc -V
    rustc 1.2.0-dev (717e8831b 2015-06-08)
    

    I have to add that this project is a great help, fuzzing the nom projects is fun :)

    opened by Geal 12
  • "linked panic runtime not compiled with ..." error

    I get this error when I try running an example in my repo with afl.rs.

    $ cargo afl build --example chat
    ...
    error: the linked panic runtime `panic_unwind` is not compiled with this crate's panic strategy `abort`
    error: aborting due to previous error
    error: Could not compile `serde_derive`.
    
    opened by osa1 7
  • Upgrade to using AFLplusplus

    Upgrade to using AFLplusplus

    Here I'm using a submodule, but happy to switch to fully vendoring AFL++ if that's preferred.

    opened by binarybana 5
  • Does not work with the latest Rust nightlies

    Does not work with the latest Rust nightlies

    Stopped working after https://github.com/rust-lang/rust/commit/3fd5fdd8d3e64e957a7eafe3d6d0b10ef4170d59

    Output I get when I try to compile a Rust version after the change above: https://gist.githubusercontent.com/frewsxcv/ca3ef34cab9fd96edd44fc5de585044d/raw/837b8b6ccbfa682a34977233f535c186e4375c93/gistfile1.txt

    A lot of errors like:

    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-0.4.2/src/par_iter/weight.rs:48: undefined reference to `__afl_prev_loc'
    
    opened by frewsxcv 5
  • SIGSEGV compiling afl-coverage for `examples/hello.rs`

    SIGSEGV compiling afl-coverage for `examples/hello.rs`

    @bb80fc56f5ba096406c61f1790886d8edce878c9, $(which rustc) == /Users/tschottdorf/rust/rust/x86_64-apple-darwin/stage2/bin/rustc @ 1.0.0-beta-6833-g079f384:

    $ cargo build --example hello --verbose
           Fresh gcc v0.3.19
           Fresh byteorder v0.3.13
       Compiling afl-coverage v0.0.1 (file:///Users/tschottdorf/rust/afl.rs)
         Running `/Users/tschottdorf/rust/afl.rs/target/debug/build/afl-coverage-f64ebee15259fa44/build-script-build`
           Fresh afl-coverage-plugin v0.0.1 (file:///Users/tschottdorf/rust/afl.rs)
         Running `rustc src/lib.rs --crate-name afl_coverage --crate-type lib -g --out-dir /Users/tschottdorf/rust/afl.rs/target/debug --emit=dep-info,link -L dependency=/Users/tschottdorf/rust/afl.rs/target/debug -L dependency=/Users/tschottdorf/rust/afl.rs/target/debug/deps -L native=/Users/tschottdorf/rust/afl.rs/target/debug/build/afl-coverage-f64ebee15259fa44/out -L native=/Users/tschottdorf/rust/afl.rs/target/debug/build/afl-coverage-f64ebee15259fa44/out -l static=afl-llvm-rt`
         Running `rustc examples/hello.rs --crate-name hello --crate-type bin -g --out-dir /Users/tschottdorf/rust/afl.rs/target/debug/examples --emit=dep-info,link -L dependency=/Users/tschottdorf/rust/afl.rs/target/debug -L dependency=/Users/tschottdorf/rust/afl.rs/target/debug/deps --extern byteorder=/Users/tschottdorf/rust/afl.rs/target/debug/deps/libbyteorder-3e27c88aa235985f.rlib --extern afl_coverage_plugin=/Users/tschottdorf/rust/afl.rs/target/debug/deps/libafl_coverage_plugin-a9b7f43301ffb1fc.dylib --extern afl_coverage=/Users/tschottdorf/rust/afl.rs/target/debug/libafl_coverage.rlib -L native=/Users/tschottdorf/rust/afl.rs/target/debug/build/afl-coverage-f64ebee15259fa44/out -L native=/Users/tschottdorf/rust/afl.rs/target/debug/build/afl-coverage-f64ebee15259fa44/out`
    afl-llvm-pass 1.77b by <[email protected]>
    Could not compile `afl-coverage`.
    
    Caused by:
      Process didn't exit successfully: `rustc examples/hello.rs --crate-name hello --crate-type bin -g --out-dir /Users/tschottdorf/rust/afl.rs/target/debug/examples --emit=dep-info,link -L dependency=/Users/tschottdorf/rust/afl.rs/target/debug -L dependency=/Users/tschottdorf/rust/afl.rs/target/debug/deps --extern byteorder=/Users/tschottdorf/rust/afl.rs/target/debug/deps/libbyteorder-3e27c88aa235985f.rlib --extern afl_coverage_plugin=/Users/tschottdorf/rust/afl.rs/target/debug/deps/libafl_coverage_plugin-a9b7f43301ffb1fc.dylib --extern afl_coverage=/Users/tschottdorf/rust/afl.rs/target/debug/libafl_coverage.rlib -L native=/Users/tschottdorf/rust/afl.rs/target/debug/build/afl-coverage-f64ebee15259fa44/out -L native=/Users/tschottdorf/rust/afl.rs/target/debug/build/afl-coverage-f64ebee15259fa44/out` (signal: 11)
    

    I've tried lldb to get more info about the segfault as in #11 but I can't just re-run the failing command (it needs the right env, I think) and wasn't versed enough to get lldb to attach to the forked child in cargo build. Pointers appreciated.

    opened by tbg 5
  • Add option to kill afl-fuzz after a time limit

    Add option to kill afl-fuzz after a time limit

    This PR adds a new option to cargo afl fuzz, --max_total_time, to limit how long afl-fuzz runs for. The new option will enable implementing rust-fuzz/targets#107. When this option is specified, cargo-afl will wait that many seconds and kill afl-fuzz, if it's still running. I had to refactor how command line arguments were passed around, as well, so that this new option didn't get passed to afl.

    opened by divergentdave 5
  • Remove rt::unwind

    Remove rt::unwind

    rt::unwind has been removed from Rust. For this reason this crate stopped compiling on current nightly.

    To crash on panic the compiler option -Z no-landing-pads can be set.

    opened by pyfisch 5
  • [question] Is this compilation failure due to the docker image's older rustc? Any way to update it?

    [question] Is this compilation failure due to the docker image's older rustc? Any way to update it?

    First off, thanks in advance for your time, and thanks for making afl.rs :)

    When I try to use afl.rs with my C++ symbol demangling crate, which depends on error-chain, I get the following errors. I assume these are becauses error-chain depends on a newer rustc than the one bundled; is there a way to use a newer rustc with afl.rs?

    My normal rustc version (with which I can compile error-chain and my crate):

    $ rustc --version
    rustc 1.16.0-nightly (47c8d9fdc 2017-01-08)
    

    The rustc in the docker image:

    # rustc --version
    rustc 1.11.0-nightly (01411937f 2016-07-01)
    

    The logs when attempting to compile my crate and error-chain inside the docker image:

    # cargo build --features fuzz
        Updating registry `https://github.com/rust-lang/crates.io-index`
     Downloading afl v0.1.5
     Downloading afl-plugin v0.1.5
     Downloading error-chain v0.7.1
     Downloading afl-sys v0.1.5
     Downloading libc v0.2.18
     Downloading gcc v0.3.39
     Downloading quale v1.0.0
     Downloading backtrace v0.3.0
     Downloading winapi v0.2.8
     Downloading dbghelp-sys v0.2.0
     Downloading backtrace-sys v0.1.5
     Downloading kernel32-sys v0.2.2
     Downloading cfg-if v0.1.0
     Downloading rustc-demangle v0.1.3
     Downloading winapi-build v0.1.1
       Compiling winapi v0.2.8
       Compiling cfg-if v0.1.0
       Compiling gcc v0.3.39
       Compiling winapi-build v0.1.1
       Compiling backtrace v0.3.0
       Compiling kernel32-sys v0.2.2
       Compiling libc v0.2.18
       Compiling rustc-demangle v0.1.3
       Compiling dbghelp-sys v0.2.0
       Compiling afl v0.1.5
       Compiling afl-sys v0.1.5
       Compiling quale v1.0.0
       Compiling backtrace-sys v0.1.5
       Compiling afl-plugin v0.1.5
       Compiling error-chain v0.7.1
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/lib.rs:419:9: 419:38 error: attributes on non-item statements and expressions are experimental. (see issue #15701)
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/lib.rs:419         #[cfg(feature = "backtrace")]
                                                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/lib.rs:419:9: 419:38 help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/lib.rs:424:9: 424:43 error: attributes on non-item statements and expressions are experimental. (see issue #15701)
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/lib.rs:424         #[cfg(not(feature = "backtrace"))]
                                                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/lib.rs:424:9: 424:43 help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/lib.rs:435:9: 435:38 error: attributes on non-item statements and expressions are experimental. (see issue #15701)
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/lib.rs:435         #[cfg(feature = "backtrace")]
                                                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/lib.rs:435:9: 435:38 help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/lib.rs:444:9: 444:43 error: attributes on non-item statements and expressions are experimental. (see issue #15701)
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/lib.rs:444         #[cfg(not(feature = "backtrace"))]
                                                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/lib.rs:444:9: 444:43 help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/lib.rs:454:9: 454:38 error: attributes on non-item statements and expressions are experimental. (see issue #15701)
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/lib.rs:454         #[cfg(feature = "backtrace")]
                                                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/lib.rs:454:9: 454:38 help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/lib.rs:456:9: 456:43 error: attributes on non-item statements and expressions are experimental. (see issue #15701)
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/lib.rs:456         #[cfg(not(feature = "backtrace"))]
                                                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/lib.rs:456:9: 456:43 help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/error_chain.rs:364:20: 364:34 error: attributes on non-item statements and expressions are experimental. (see issue #15701)
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/error_chain.rs:364                 $( #[$meta_links] )*
                                                                                                                      ^~~~~~~~~~~~~~
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/error_chain.rs:81:13: 83:81 note: in this expansion of impl_extract_backtrace! (defined in /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/error_chain.rs)
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/error_chain.rs:24:9: 30:10 note: in this expansion of error_chain_processed! (defined in /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/error_chain.rs)
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/error_chain.rs:9:9: 14:10 note: in this expansion of error_chain_processed! (defined in /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/error_chain.rs)
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/error_chain.rs:325:9: 330:10 note: in this expansion of error_chain_processed! (defined in /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/error_chain.rs)
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/error_chain.rs:319:9: 322:10 note: in this expansion of error_chain_processing! (defined in /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/error_chain.rs)
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/error_chain.rs:309:9: 312:10 note: in this expansion of error_chain_processing! (defined in /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/error_chain.rs)
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/error_chain.rs:299:9: 302:10 note: in this expansion of error_chain_processing! (defined in /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/error_chain.rs)
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/error_chain.rs:339:9: 342:10 note: in this expansion of error_chain_processing! (defined in /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/error_chain.rs)
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/example_generated.rs:27:1: 38:2 note: in this expansion of error_chain! (defined in /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/error_chain.rs)
    /root/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.7.1/src/error_chain.rs:364:20: 364:34 help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable
    error: aborting due to 7 previous errors
    Build failed, waiting for other jobs to finish...
    error: Could not compile `error-chain`.
    
    To learn more, run the command again with --verbose.
    # 
    
    opened by fitzgen 5
  • Build fails while installing afl 0.4.0 using cargo install

    Build fails while installing afl 0.4.0 using cargo install

    Tried updating from version 0.3.2 to 0.4.0.

    Log

    ~ cargo install --force afl
        Updating registry `https://github.com/rust-lang/crates.io-index`
      Installing afl v0.4.0                                                         
       Compiling semver-parser v0.7.0
       Compiling xdg v2.1.0
       Compiling unicode-width v0.1.5
       Compiling libc v0.2.42
       Compiling bitflags v1.0.3
       Compiling strsim v0.7.0
       Compiling ansi_term v0.11.0
       Compiling vec_map v0.8.1
       Compiling cc v1.0.18
       Compiling semver v0.9.0
       Compiling textwrap v0.10.0
       Compiling atty v0.2.10
       Compiling rustc_version v0.2.2
       Compiling clap v2.32.0
       Compiling afl v0.4.0
    error: failed to run custom build command for `afl v0.4.0`
    process didn't exit successfully: `/tmp/cargo-installhMIfsD/release/build/afl-510925da3c09f455/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/shadlock0133/.cargo/registry/src/github.com-1ecc6299db9ec823/afl-0.4.0/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/shadlock0133/.cargo/registry/src/github.com-1ecc6299db9ec823/afl-0.4.0/afl-2.52b/llvm_mode'
    make -C libdislocator clean
    make[1]: Entering directory '/home/shadlock0133/.cargo/registry/src/github.com-1ecc6299db9ec823/afl-0.4.0/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/shadlock0133/.cargo/registry/src/github.com-1ecc6299db9ec823/afl-0.4.0/afl-2.52b/libdislocator'
    make -C libtokencap clean
    make[1]: Entering directory '/home/shadlock0133/.cargo/registry/src/github.com-1ecc6299db9ec823/afl-0.4.0/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/shadlock0133/.cargo/registry/src/github.com-1ecc6299db9ec823/afl-0.4.0/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()', build.rs:29:5 note: Run with RUST_BACKTRACE=1 for a backtrace.

    warning: build failed, waiting for other jobs to finish... error: failed to compile afl v0.4.0, intermediate artifacts can be found at /tmp/cargo-installhMIfsD

    Caused by: build failed

    opened by Shadlock0133 4
  • Expand `CARGO` environment variable at runtime

    Expand `CARGO` environment variable at runtime

    Fixes #183, I think.

    opened by smoelius 0
  • Cargo afl takes Cargo path during installation and if cargo path changes, the returned error is not obvious

    Cargo afl takes Cargo path during installation and if cargo path changes, the returned error is not obvious

    I may be wrong, but it seems to me that:

    1. cargo install afl takes/saves full cargo path during its installation
    2. When we execute cargo afl ... it uses a saved cargo path (from an envvar in https://github.com/rust-fuzz/afl.rs/blob/aad1eec53d7b72c99fd2a3dbb7bd66c6955c28d4/src/bin/cargo-afl.rs#L294 ?)
    3. If the cargo path changed between 1) and our actual fuzzing attempt, things go wrong and we panic on unwrap here: https://github.com/rust-fuzz/afl.rs/blob/aad1eec53d7b72c99fd2a3dbb7bd66c6955c28d4/src/bin/cargo-afl.rs#L349-L357

    With an error like:

    thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /Users/dc/.cargo/registry/src/github.com-1ecc6299db9ec823/afl-0.10.0/src/bin/cargo-afl.rs:357:10
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    

    This occured for me when I used afl via test-fuzz and I don't have all the steps necessary to reproduce this. However, my cargo installation comes from nix package manager and I think I maybe updated cargo via nix? (or maybe it is related to rust toolchain changes?)

    All this was fixed after I reinstalled afl via cargo install afl --force.

    So it would be nice to either fix this, or, show an error that cargo install afl --force may fix it.

    opened by disconnect3d 0
  • "error: linking with `cc` failed: exit code: 1" when "cargo build"

    Sorry if there's already existing issue on this. I got this error while trying to compile:

    error: linking with `cc` failed: exit code: 1
      |
      = note: "cc" "-m64" "-arch" "x86_64" "-L" "/Users/foo/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz.1qgdhmtsn5lnkv8j.rcgu.o" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz.2b5bdv1nfvan5wo1.rcgu.o" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz.2e6k6gzldepotkkr.rcgu.o" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz.2ehepex52twnu29.rcgu.o" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz.2feok7tp98zmgnqx.rcgu.o" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz.2xychraeh90cfvyi.rcgu.o" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz.35lh099spuo5afzi.rcgu.o" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz.39x11e5urcm3fll7.rcgu.o" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz.3cwyegk8qfy8j9jr.rcgu.o" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz.3hqbpq0vwailyg85.rcgu.o" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz.3llgle4mcv2gsa8b.rcgu.o" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz.3p3yr63cr3hnokmk.rcgu.o" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz.3yd6zwrr772y1jzg.rcgu.o" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz.4dx3ey5bw6285rcm.rcgu.o" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz.4tni8ozdhyumrdhl.rcgu.o" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz.4vjfltybq1x8h34a.rcgu.o" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz.5ar2ow9e817hmgli.rcgu.o" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz.cmoranf19ulut71.rcgu.o" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz.nb1d4f5id06cart.rcgu.o" "-o" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz" "/Users/foo/git/arrow/rust/target/debug/deps/parquet_fuzz.4t3yyk0lw5pr4p91.rcgu.o" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/foo/git/arrow/rust/target/debug/deps" "-L" "/Users/foo/git/arrow/rust/target/debug/build/lz4-sys-75d1bf02c2659833/out" "-L" "/Users/foo/git/arrow/rust/target/debug/build/zstd-sys-54febe6eaf3ed3ea/out" "-L" "/Users/foo/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/foo/git/arrow/rust/target/debug/deps/libparquet-dc1bc7c62a38f07b.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libzstd-bb1c774ed3e9942a.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libzstd_safe-b3e0044f7a0b5401.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libzstd_sys-69b9b529b1294ea6.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/liblz4-f501a4c7a334df1f.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/liblz4_sys-9a84dee256a4b44a.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libbrotli-1b30fa1df8665d36.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libbrotli_decompressor-4a7720cd6922da57.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/liballoc_stdlib-cfc5257f59cf3a1e.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/liballoc_no_stdlib-f9b3124ebb1dbce0.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libbase64-6311ec00b7b3977f.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libflate2-c20ff256eb27ff2b.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libminiz_oxide-ed164e4d0059b7e7.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libadler-8a38c70c610d06bc.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libcrc32fast-14eca9e7134413d4.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libsnap-68ed89cd7a5a711f.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libparquet_format-3a03737573551aba.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libthrift-fcc8521cf5af0bef.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/liblog-a6baae9ff904adf7.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libthreadpool-4673b2b86b28a1ea.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libnum_cpus-bd5321ee38bd1d4d.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libinteger_encoding-99848279688d9dc1.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libordered_float-c5b63c753198dec8.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libarrow-c417cd30044805b5.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/liblexical_core-777fb7f94d521d2e.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libarrayvec-1a2eb6ba941e8301.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libstatic_assertions-f673896ca1b11add.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libcfg_if-50ed2fa15d067a29.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/librand-cd4a016769cf4943.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/librand_chacha-30b3e8dca27e5717.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libppv_lite86-e7bf5096a91c4751.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/librand_core-335ed890ef5bd0b6.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libgetrandom-bcbfc405de14b233.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libcfg_if-5440abaea1237bb7.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libflatbuffers-ec15b358a3b4cfd7.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libbitflags-41b8f8950e56a876.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libthiserror-c027f5b2cdd1f0bf.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libsmallvec-b2502309bd852f94.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libcsv-5fd93316bdda9d8c.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libcsv_core-69a12f11a329f151.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libbstr-a772769fb47f1424.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libregex_automata-d5a4ca174ae8ca28.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libbyteorder-8236ddd56c636592.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libregex-d1bd746e9d1e441a.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libthread_local-6fa356fc31fa5bcd.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/liblazy_static-9ef0ede18009bf0a.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libregex_syntax-ab13614efcfda18b.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libaho_corasick-fe82c42f86435c80.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libmemchr-12e438b079a3d1cb.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libserde_json-0656961d3dd5315a.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libryu-4636ec5641c33604.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libitoa-ebc28a1bf7410a52.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libindexmap-b7e44a71ecc17e2e.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libhashbrown-db7623be31193963.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libserde-d0bcddd6f89be62e.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libhex-8cdd8a8bec38bbe7.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libchrono-d909d761917eb7d4.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libtime-6fd8ab3934559031.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/liblibc-c4eb520d4d45515d.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libnum-7a6182b3b6760294.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libnum_iter-dc81085593559119.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libnum_rational-6c493fdd57fe6e0d.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libnum_complex-af1a67dad41e6d69.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libnum_bigint-907febf61642fa6f.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libnum_integer-d5413210bc4b167e.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libnum_traits-b6dd246bb4489433.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libafl-fae3892c7875ba66.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/librustc_version-c7df901fbdf57663.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libsemver-a70ef56560fee6a4.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libsemver_parser-a18caa8df7bbf9cf.rlib" "/Users/foo/git/arrow/rust/target/debug/deps/libxdg-e224ec04d8010fc4.rlib" "/Users/foo/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-518979da66993550.rlib" "/Users/foo/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-f52081aedccc205f.rlib" "/Users/foo/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libobject-bad1c02788187328.rlib" "/Users/foo/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-6375d8dbf53aee9d.rlib" "/Users/foo/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgimli-0ea8539778b0c0ab.rlib" "/Users/foo/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-64f30c6d69babb18.rlib" "/Users/foo/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-e27428d997fd2532.rlib" "/Users/foo/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-f02467a76e5a8054.rlib" "/Users/foo/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-9536efad7116d828.rlib" "/Users/foo/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-5ca171f6ec11d7a5.rlib" "/Users/foo/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-14b621861b38e51f.rlib" "/Users/foo/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-38f4a0c206512fa5.rlib" "/Users/foo/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-99bca6ace58141c5.rlib" "/Users/foo/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-72a66f4c97a4c0c8.rlib" "/Users/foo/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-e7cd9f0beed2fc0f.rlib" "-lSystem" "-lresolv" "-lc" "-lm"
      = note: Undefined symbols for architecture x86_64:
                "___afl_manual_init", referenced from:
                    afl::fuzz::hb9502a6cad08967e in parquet_fuzz.4dx3ey5bw6285rcm.rcgu.o
                "___afl_persistent_loop", referenced from:
                    afl::fuzz::hb9502a6cad08967e in parquet_fuzz.4dx3ey5bw6285rcm.rcgu.o
              ld: symbol(s) not found for architecture x86_64
              clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
    
    error: aborting due to previous error
    
    error: could not compile `parquet_fuzz`
    

    I'm on Mac OS and Clang info below:

    Apple clang version 11.0.3 (clang-1103.0.32.62)
    Target: x86_64-apple-darwin19.6.0
    Thread model: posix
    InstalledDir: /Library/Developer/CommandLineTools/usr/bin
    

    also rustc version:

    rustc 1.49.0 (e1884a8e3 2020-12-29)
    

    Anyone knows a workaround? thanks!

    opened by sunchao 0
  • Is there any proper way to combine address sanitizer(ASAN) with afl.rs?

    Is there any proper way to combine address sanitizer(ASAN) with afl.rs?

    I want to use afl.rs to test some unsafe rust code, however, combining ASAN with afl.rs seems to have some problem. For example, I have fuzz target as follows, which contains stack buffer overflow bug that can be detected by ASAN

    fn main() {
        fuzz!(|data: &[u8]| {
            let new_data = [1,2,3];
            let _y = unsafe { *new_data.as_ptr().offset(4) };
        });
    }
    

    I build the project by

    RUSTFLAGS=-Zsanitizer=address cargo afl build -Zbuild-std --target x86_64-unknown-linux-gnu
    

    and I run the target by

    RUSTFLAGS=-Zsanitizer=address cargo afl fuzz -i in -o out -m none target/x86_64-unknown-linux-gnu/debug/afl_with_sanitizer
    

    The build target seems to contain ASAN code, for I use recidivm to estimates the target program's peak virtual memory and is about 20TB.

    recidivm -u M target/x86_64-unknown-linux-gnu/debug/afl_with_sanitizer
    

    But when I fuzz it, it seems the error can not be detected, and the stability is very low(about 25%). I wonder if there is any proper way to combine afl.rs with ASAN. Thanks a lot.

    opened by StevenJiang1110 0
  • Building afl.rs instructions

    Building afl.rs instructions

    I was testing out this tool, but missed some build instructions. Here are some example build instructions that worked for me:

    ## Install
    
    Requirements:
    - LLVM
    - clang
    Debian/Ubuntu based:
    ```bash
    sudo apt-get install clang llvm
    ```
    
    Install afl.rs
    ```bash
    cargo +nightly install afl
    ```
    

    Maybe add something like this to the README.md so other people can get started quicker. Or add them to the book, because there was not much there. And I had gcc installed just did not build for some reason. (maybe because llvm was not installed, installed clang first because of the error I got)

    opened by ralpha 1
  • build failed with apple clang 12 on macOS

    build failed with apple clang 12 on macOS

    run cargo check --all inside tikv project, and error occurred.

    tikv git:(update_dependency) ✗ RUST_BACKTRACE=1 cargo check --all
       Compiling afl v0.6.0
       Compiling librocksdb_sys v0.1.0 (https://github.com/tikv/rust-rocksdb.git#0876316d)
    error: failed to run custom build command for `afl v0.6.0`
    
    Caused by:
      process didn't exit successfully: `/Users/gentcys/Codes/personal/tikv/target/debug/build/afl-ec701a85aa8db2c6/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
    /Library/Developer/CommandLineTools/usr/bin/make -C llvm_mode clean
    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++
    /Library/Developer/CommandLineTools/usr/bin/make -C libdislocator clean
    rm -f *.o *.so *~ a.out core core.[1-9][0-9]*
    rm -f libdislocator.so
    /Library/Developer/CommandLineTools/usr/bin/make -C libtokencap clean
    rm -f *.o *.so *~ a.out core core.[1-9][0-9]*
    rm -f libtokencap.so
    [*] 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
    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
    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
    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
    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
    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
    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
    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-clang -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
    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.
    
    
    --- stderr
    make: *** [test_build] Error 1
    thread 'main' panicked at 'assertion failed: status.success()', /Users/gentcys/.cargo/registry/src/github.com-1ecc6299db9ec823/afl-0.6.0/build.rs:33:5
    stack backtrace:
       0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
       1: core::fmt::write
       2: std::io::Write::write_fmt
       3: std::panicking::default_hook::{{closure}}
       4: std::panicking::default_hook
       5: std::panicking::rust_panic_with_hook
       6: std::panicking::begin_panic
       7: build_script_build::build_afl
       8: build_script_build::main
       9: std::rt::lang_start::{{closure}}
      10: std::rt::lang_start_internal
      11: std::rt::lang_start
      12: main
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    
    help wanted 
    opened by gentcys 3
  • How to build without clang

    How to build without clang

    Due to some reason, there is no clang in our CI, but we still want to upgrade afl.rs to 0.8.0 https://github.com/tikv/tikv/pull/7683

    How we achieve that?

    opened by XiaochenCui 0
  • Error mapping in `fuzz`

    Error mapping in `fuzz`

    Hello!

    I'm trying to setup fuzzing using the fuzz!(|param: Type| { ... }); template (where Type implements Arbitrary), however I keep getting an error from within the macro.

    The failure points to the following snippet:

    RingBuffer::new($buf, $buf.len())
               .and_then(|mut b| Arbitrary::arbitrary(&mut b).map_err(|_| ""))
    

    Because the closure inside the and_then is supposed to return the same type as RingBuffer::new, the map_err makes my compiler grumpy since it returns &str instead of BufferError.

    expected enum arbitrary::BufferError, found &str help: try using a variant of the expected enum: Ok(Arbitrary :: arbitrary (& mut b) . map_err (| _ | ""))

    My use case is pretty simple:

    fuzz!(|key_name: String| { 
            let mut test_client = TestClient::new();
            if let Err(ResponseStatus::ConnectionError) = test_client.create_rsa_sign_key(key_name.clone()) {
                panic!("Died for input: {}", key_name);
            }
    });
    

    Not sure if this is because of me misunderstanding how the afl crate works or if this is a legit bug.

    PS: I'm importing and using arbitrary: "0.2.0"

    opened by ionut-arm 1
  • error: linking with `cc` failed: exit code: 1

    error: linking with `cc` failed: exit code: 1

    My environment is as below; rustc --version rustc 1.37.0-nightly (de7c4e423 2019-06-23) cargo --version cargo 1.37.0-nightly (807429e1b 2019-06-11) WSL : Ubuntu 18.04.2 LTS

    When I run cargo afl build, received following error with command RUST_BACKTRACE=full cargo afl build ;

    error: linking with cc failed: exit code: 1 | = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.0.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.1.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.10.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.11.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.12.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.13.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.14.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.15.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.2.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.3.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.4.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.5.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.6.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.7.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.8.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.9.rcgu.o" "-o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.4d27jvcxjvs12e1j.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/mnt/c/Users/Ali/myProject-rust/target/debug/deps" "-L" "/home/saarshah/.local/share/afl.rs/rustc-1.37.0-nightly-de7c4e4/afl.rs-0.4.3/afl-llvm-rt" "-L" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-lafl-llvm-rt" "-Wl,--start-group" "-Wl,-Bstatic" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-d02520163eb5c3fb.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-f9d005790cbe2e04.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace-9a7649708f619f95.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-a9c5860e818703cf.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-9b5d69266c8348e9.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-8ac95f18462656f4.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-f3c90959ca0f050f.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-2ddd77abb50e1ad9.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-a1d86b7ded82f430.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-276eb929203479ae.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-9476d949197c9007.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-b1cee10341f7c85c.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-763222dcec00e4cd.rlib" "-Wl,--end-group" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-b62da616a55f3150.rlib" "-Wl,-Bdynamic" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil" = note: /usr/bin/ld: __sancov_guards has both ordered [__sancov_guards' in /mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.1.rcgu.o] and unordered [__sancov_guards' in /mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.1.rcgu.o] sections /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status

    error: aborting due to previous error

    error: Could not compile bindgen. warning: build failed, waiting for other jobs to finish... error: linking with cc failed: exit code: 1 | = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.0.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.1.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.10.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.11.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.12.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.13.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.14.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.15.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.2.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.3.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.4.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.5.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.6.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.7.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.8.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.9.rcgu.o" "-o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.4i4psbdhq70cwtbw.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/mnt/c/Users/Ali/myProject-rust/target/debug/deps" "-L" "/home/saarshah/.local/share/afl.rs/rustc-1.37.0-nightly-de7c4e4/afl.rs-0.4.3/afl-llvm-rt" "-L" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-lafl-llvm-rt" "-Wl,--start-group" "-Wl,-Bstatic" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-d02520163eb5c3fb.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-f9d005790cbe2e04.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace-9a7649708f619f95.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-a9c5860e818703cf.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-9b5d69266c8348e9.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-8ac95f18462656f4.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-f3c90959ca0f050f.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-2ddd77abb50e1ad9.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-a1d86b7ded82f430.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-276eb929203479ae.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-9476d949197c9007.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-b1cee10341f7c85c.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-763222dcec00e4cd.rlib" "-Wl,--end-group" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-b62da616a55f3150.rlib" "-Wl,-Bdynamic" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil" = note: /usr/bin/ld: __sancov_guards has both ordered [__sancov_guards' in /mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.0.rcgu.o] and unordered [__sancov_guards' in /mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.0.rcgu.o] sections /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status

    error: aborting due to previous error

    error: Could not compile typenum. warning: build failed, waiting for other jobs to finish... error: build failed

    opened by saarshah 4
  • Stability is not 100% even with an empty fuzzing target

    Stability is not 100% even with an empty fuzzing target

    When fuzzing rawloader I'm getting these warnings on startup:

    [!] WARNING: Instrumentation output varies across runs.
    

    and when running the fuzzer stability is around 68% which is extremely low. Even an empty fuzzing target like this:

    #[macro_use]
    extern crate afl;
    
    fn main() {
      fuzz!(|data: &[u8]| {
      });
    }
    

    Only shows 93 or 94% stability. Am I doing something wrong or is there a bug somewhere?

    opened by pedrocr 3
Owner
Rust Fuzzing Authority
Tools and resources for fuzzing with the Rust programming language
Rust Fuzzing Authority
Travis CI and AppVeyor template to test your Rust crate on 5 architectures and publish binary releases of it for Linux, macOS and Windows

trust Travis CI and AppVeyor template to test your Rust crate on 5 architectures and publish binary releases of it for Linux, macOS and Windows Featur

Jorge Aparicio 1.1k Jun 12, 2021
Testing Framework for Rust

Polish Polish is Test-Driven Development done right Getting Started Installing the Package The crates.io package is kept up-to-date with all the major

Fadi Hanna Al-Kass 41 Jan 9, 2021
Competitive Programming Stress Test Tools

Competitive Programming Stress Test Tools 競技プログラミング用 ストレステストツール このプログラムの役割 のプログラムに対して,それより実行時間がかかるが確実に できる愚直プログラムと比較することで, となるテストケースを探し出す 最大コーナーケースに対し

Ryusei Ishikawa 6 May 14, 2021
HTTP mocking library for Rust.

httpmock HTTP mocking library for Rust. Documentation · Crate · Report Bug · Request Feature · Changelog Features Simple, expressive, fluent API. Many

Alexander Liesenfeld 85 Jun 11, 2021
A library for generating fake data in Rust.

Fake A Rust library for generating fake data. Installation Default (rand is required): [dependencies] fake = "2.4" rand = "0.8" If you want to use #[d

cksac 279 Jun 11, 2021
Playwright is a rust library to automate Chromium, Firefox and WebKit built on top of Node.js library.

?? Playwright for Rust Playwright is a rust library to automate Chromium, Firefox and WebKit built on top of Node.js library. Installation [dependenci

octaltree 16 Jun 13, 2021
Benchmarks for rust serialization frameworks

Rust serialization benchmark The goal of these benchmarks is to provide thorough and complete benchmarks for various rust serialization frameworks. Th

David Koloski 39 Jun 6, 2021