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

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

Closed
fitzgen opened this issue Jan 11, 2017 · 5 comments

Comments

@fitzgen
Copy link
Member

fitzgen commented Jan 11, 2017

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.
# 
@frewsxcv
Copy link
Member

Yeah, this is because the afl.rs Docker image is using a pinned version of rustc because of this issue. I haven't tried with a recent nightly, so maybe this problem no longer exists. I'm a bit busy for the next few days, so I won't have too much time to try a new rustc, but I'll try to get to it sometime.

@fitzgen
Copy link
Member Author

fitzgen commented Jan 12, 2017

Thanks for the reply!

I'll try dropping my dependency on error-chain and see if I can get everything working after that :)

@fitzgen
Copy link
Member Author

fitzgen commented Feb 2, 2017

Dropping the dependency on error_chain did the trick! Thanks!

screen shot 2017-02-01 at 10 59 18 pm

@fitzgen fitzgen closed this as completed Feb 2, 2017
@fitzgen
Copy link
Member Author

fitzgen commented Feb 2, 2017

And found 5 panicking test cases in as many minutes -- impressive!

@fitzgen
Copy link
Member Author

fitzgen commented Feb 2, 2017

Oh, another thing that might be good to document in the README or the book somewhere: how to get Travis CI to test the exact rust nightly that afl.rs uses, so people maintaining libraries which they want to fuzz can retain the ability to compile under afl.rs's docker image.

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

2 participants