MingxiYe / Midas

MIT License
4 stars 0 forks source link

error: could not compile `metatype` (lib) due to 16 previous errors #1

Closed BABA3344 closed 1 month ago

BABA3344 commented 1 month ago

rustc --version rustc 1.83.0-nightly (28e8f01c2 2024-09-17) cargo build --release

 Compiling wait-timeout v0.2.0
error[E0658]: `*const T` cannot be used as the type of `self` without the `arbitrary_self_types_pointers` feature
  --> \.cargo\registry\src\index.crates.io-6f17d22bba15001f\metatype-0.2.1\src\lib.rs:34:1
    |
116 |     default fn meta(self: *const Self) -> Self::Meta {
    |                           ^^^^^^^^^^^
    |
    = note: see issue #44874 <https://github.com/rust-lang/rust/issues/44874> for more information
    = help: add `#![feature(arbitrary_self_types_pointers)]` to the crate attributes to enable
    = note: this compiler was built on 2024-09-17; consider upgrading it if it is out of date
    = help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)

error[E0658]: `*const T` cannot be used as the type of `self` without the `arbitrary_self_types_pointers` feature
   --> \.cargo\registry\src\index.crates.io-6f17d22bba15001f\metatype-0.2.1\src\lib.rs:123:24
    |
123 |     default fn data(self: *const Self) -> *const () {
    |                           ^^^^^^^^^^^
    |
    = note: see issue #44874 <https://github.com/rust-lang/rust/issues/44874> for more information
    = help: add `#![feature(arbitrary_self_types_pointers)]` to the crate attributes to enable
    = note: this compiler was built on 2024-09-17; consider upgrading it if it is out of date
    = help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)

Could you let me know which Rust version or Nightly build you're currently using to development?

MingxiYe commented 1 month ago

Hi @BABA3344, sorry for the late reply. I use 1.76.0-nightly

BABA3344 commented 1 month ago

The previous issues disappeared after using the 1.76.0-nightly version of Rust, but new issues have emerged.

Could you please upload the Cargo.lock file to the repository?

Because there are several version conflicts.

MingxiYe commented 1 month ago

Could you please show the error logs?

BABA3344 commented 1 month ago

After using Rust version 1.76.0-nightly, the previous errors disappeared, but these new errors have emerged.

error[E0432]: unresolved import `libafl::prelude::HasClientPerfMonitor`
  --> \Midas\src\evm\concolic\concolic_stage.rs:15:15
   |
15 |     CorpusId, HasClientPerfMonitor, HasMetadata, ObserversTuple, Stage, UsesInput,
   |               ^^^^^^^^^^^^^^^^^^^^
   |               |
   |               no `HasClientPerfMonitor` in `prelude`
   |               help: a similar name exists in the module: `ClientPerfMonitor`

error[E0432]: unresolved import `libafl::prelude::HasClientPerfMonitor`
  --> \Midas\src\evm\cov_stage.rs:21:33
   |
21 | use libafl::prelude::{CorpusId, HasClientPerfMonitor, HasMetadata, ObserversTuple, Stage};
   |                                 ^^^^^^^^^^^^^^^^^^^^
   |                                 |
   |                                 no `HasClientPerfMonitor` in `prelude`
   |                                 help: a similar name exists in the module: `ClientPerfMonitor`

error[E0432]: unresolved import `libafl::state::HasClientPerfMonitor`
   --> \Midas\src\evm\feedbacks.rs:14:5
    |
14  | use libafl::state::HasClientPerfMonitor;8
    |     ^^^^^^^^^^^^^^^--------------------
    |     |              |
    |     |              help: a similar name exists in the module: `MaybeHasClientPerfMonitor`
    |     no `HasClientPerfMonitor` in `state`

In an attempt to fix the error, I added the [introspection] feature to libafl: libafl = { version = "0.11.1", features = ["introspection"] } After that, the previous errors disappeared, but new errors emerged

error[E0277]: the trait bound `S: libafl::state::State` is not satisfied
   --> \Midas\src\evm\concolic\concolic_stage.rs:204:15
    |
204 | impl<I, S, F> Feedback<S> for ConcolicFeedbackWrapper<F>
    |               ^^^^^^^^^^^ the trait `libafl::state::State` is not implemented for `S`
    |
note: required by a bound in `Feedback`
   --> .cargo\registry\src\index.crates.io-6f17d22bba15001f\libafl-0.11.1\src\feedbacks\mod.rs:51:8
    |
49  | pub trait Feedback<S>: Named
    |           -------- required by a bound in this trait
50  | where
51  |     S: State,
    |        ^^^^^ required by this bound in `Feedback`
help: consider further restricting this bound
    |
208 |     S: HasClientPerfMonitor + HasMetadata + HasCorpus + UsesInput<Input = I> + libafl::state::State,
    |                                                                              ++++++++++++++++++++++

error[E0277]: the trait bound `S: libafl::state::State` is not satisfied
   --> \Midas\src\evm\concolic\concolic_stage.rs:207:8
    |
207 |     F: Feedback<S> + Named + Debug,
    |        ^^^^^^^^^^^ the trait `libafl::state::State` is not implemented for `S`
    |
note: required by a bound in `Feedback`
   --> .cargo\registry\src\index.crates.io-6f17d22bba15001f\libafl-0.11.1\src\feedbacks\mod.rs:51:8
    |
49  | pub trait Feedback<S>: Named
    |           -------- required by a bound in this trait
50  | where
51  |     S: State,
    |        ^^^^^ required by this bound in `Feedback`
help: consider further restricting this bound
    |
208 |     S: HasClientPerfMonitor + HasMetadata + HasCorpus + UsesInput<Input = I> + libafl::state::State,
    |                                                                              ++++++++++++++++++++++

error[E0277]: the trait bound `S: libafl::state::State` is not satisfied
  --> \Midas\src\fuzzer.rs:75:8
   |
75 |     F: Feedback<S>,
   |        ^^^^^^^^^^^ the trait `libafl::state::State` is not implemented for `S`
   |
note: required by a bound in `Feedback`
  --> .cargo\registry\src\index.crates.io-6f17d22bba15001f\libafl-0.11.1\src\feedbacks\mod.rs:51:8
   |
49 | pub trait Feedback<S>: Named
   |           -------- required by a bound in this trait
50 | where
51 |     S: State,
   |        ^^^^^ required by this bound in `Feedback`
help: consider further restricting this bound
   |
80 |     S: HasClientPerfMonitor + HasCorpus + HasRand + HasMetadata + UsesInput<Input = I> + libafl::state::State,

I believe the issue might be related to different versions. Maybe attaching the Cargo.lock file could help resolve these errors .

MingxiYe commented 1 month ago

Please check: Cargo.lock.zip

BABA3344 commented 1 month ago

Unfortunately, the errors did not disappear even after using the Cargo.lock file.

   Compiling serde_traitobject v0.2.8
   Compiling revm v3.3.0 (https://github.com/fuzzland/revm?rev=91f3a4cc2762d0b45ab88f48faa6a7c39fa84f84#91f3a4cc)
   Compiling heimdall-core v0.6.1 (https://github.com/fuzzland/heimdall-rs.git#3d95f041)
error[E0432]: unresolved import `core::simd::SimdOrd`
 --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libafl-0.11.1/src/feedbacks/map.rs:8:5
  |
8 | use core::simd::SimdOrd;
  |     ^^^^^^^^^^^^^^^^^^^ no `SimdOrd` in `simd`
  |
help: consider importing one of these items instead
  |
8 | use core::simd::prelude::SimdOrd;
  |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 | use crate::prelude::std::simd::prelude::SimdOrd;
  |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 | use std::simd::prelude::SimdOrd;
  |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~

   Compiling clap v4.5.17
   Compiling handlebars v4.5.0
   Compiling nix v0.24.3
   Compiling permutator v0.4.3
   Compiling itertools v0.10.5
   Compiling retry v2.0.0
error[E0599]: no associated item named `LANES` found for struct `Simd` in the current scope
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libafl-0.11.1/src/feedbacks/map.rs:550:40
    |
550 |         let steps = size / VectorType::LANES;
    |                                        ^^^^^ associated item not found in `Simd<u8, 16>`

error[E0599]: no associated item named `LANES` found for struct `Simd` in the current scope
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libafl-0.11.1/src/feedbacks/map.rs:551:39
    |
551 |         let left = size % VectorType::LANES;
    |                                       ^^^^^ associated item not found in `Simd<u8, 16>`

error[E0599]: no associated item named `LANES` found for struct `Simd` in the current scope
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libafl-0.11.1/src/feedbacks/map.rs:556:44
    |
556 |                 let i = step * VectorType::LANES;
    |                                            ^^^^^ associated item not found in `Simd<u8, 16>`

error[E0599]: no method named `simd_max` found for struct `Simd` in the current scope
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libafl-0.11.1/src/feedbacks/map.rs:560:26
    |
560 |                 if items.simd_max(history) != history {
    |                          ^^^^^^^^ method not found in `Simd<u8, 16>`
   --> /rustc/06e02d5b259c1e88cbf0c74366d9e0a4c7cfd6d9/library/core/src/../../portable-simd/crates/core_simd/src/simd/cmp/ord.rs:31:8
    |
    = note: the method is available for `Simd<u8, 16>` here
    |
    = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |
3   + use core::simd::cmp::SimdOrd;
    |

error[E0599]: no associated item named `LANES` found for struct `Simd` in the current scope
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libafl-0.11.1/src/feedbacks/map.rs:563:54
    |
563 |                         for j in i..(i + VectorType::LANES) {
    |                                                      ^^^^^ associated item not found in `Simd<u8, 16>`

error[E0599]: no associated item named `LANES` found for struct `Simd` in the current scope
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libafl-0.11.1/src/feedbacks/map.rs:584:44
    |
584 |                 let i = step * VectorType::LANES;
    |                                            ^^^^^ associated item not found in `Simd<u8, 16>`

error[E0599]: no method named `simd_max` found for struct `Simd` in the current scope
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libafl-0.11.1/src/feedbacks/map.rs:588:26
    |
588 |                 if items.simd_max(history) != history {
    |                          ^^^^^^^^ method not found in `Simd<u8, 16>`
   --> /rustc/06e02d5b259c1e88cbf0c74366d9e0a4c7cfd6d9/library/core/src/../../portable-simd/crates/core_simd/src/simd/cmp/ord.rs:31:8
    |
    = note: the method is available for `Simd<u8, 16>` here
    |
    = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |
3   + use core::simd::cmp::SimdOrd;
    |

Some errors have detailed explanations: E0432, E0599.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `libafl` (lib) due to 8 previous errors
vilotgit commented 1 month ago

I am experiencing the same errors as @BABA3344 I also tried the most recent version of cargo and following the guides from the rust compiler. However, I could not compile this project. In addition, the cargo version specified in the repository is 1.74.0-nightly, which is not the version specified in this thread (1.76.0-nightly). @MingxiYe Could you check that the current repository compiles?

MingxiYe commented 1 month ago

Hi @BABA3344 @vilotgit, thank you for bringing forward the issues. Please check the latest commit and see if it works.

vilotgit commented 1 month ago

I was able to compile and run with the latest commit (by the way, the output binary is ./metafuzz not ./Midas). Thank you for the fast response! 😄

MingxiYe commented 1 month ago

Thank you. Apologize for the typo, as it is a preliminary version. We are planning to bring forward a production tool soon, please follow up.