-
Notifications
You must be signed in to change notification settings - Fork 140
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
refactor: upgrade rustc, libafl, and clap to the latest version #201
Conversation
lgtm, thanks! |
Found: 7
|
WOW! It's an amazing tool. I'll fix these errors. |
I'll be working on these issues together as well, feel free to contact me |
This comment has been minimized.
This comment has been minimized.
CI is down. I will manual trigger it when ready. |
Some of the errors reported by the bot are unrelated to this PR, so I have created a new issue: #211. The new changelog is as follows: 1 MaxMapFeedback
But the impl<I, S, VS, F, SC> Feedback<S> for Sha3WrappedFeedback<I, S, VS, F, SC> {
fn append_metadata<OT>(/* args */) -> Result<(), Error> {
self.inner_feedback.as_mut().append_metadata(state, observers, testcase)
}
} 2 InMemoryCorpus
Thus, the // src/evm/cov_stage.rs
// Before
fn perform(/* args */) -> Result<(), Error> {
// Start from `self.last_corpus_idx` because it has not been processed yet
for i in self.last_corpus_idx..total { /* ... */ }
// total is the next future idx that is not in the corpus
self.last_corpus_idx = total;
}
// After
fn perform(/* args */) -> Result<(), Error> {
let mut current = Some(CorpusId::from(self.last_corpus_idx));
// Start from `state.corpus().next(current_idx)`
// because the current_idx has been processed in the last round.
while let Some(i) = state.corpus().next(current_idx) {
/* logic */
idx = state.corpus().next(i);
}
// last_idx is the last idx in the corpus
self.last_corpus_idx = last_idx;
} Note that the meaning of
|
Found: 23
|
Fix #200
The CHANGELOG of migration from LibAFL
0.8.2
to0.11.1
is as follows:1 Implemented New Traits
UsesInput
for custom corpora/states:IndexedInMemoryCorpus
,FuzzState
,InfantStateState
HasTestcase
for custom corpora/states:IndexedInMemoryCorpus
,FuzzState
,InfantStateState
UsesState
for custom components:SortedDroppingScheduler
,MoveVMStateScheduler
,MoveTestcaseScheduler
FuzzExecutor
CoverageStage
,ConcolicStage
ItyFuzzer
UsesObservers
forFuzzExecutor
RemovableScheduler
forSortedDroppingScheduler
andMoveVMStateScheduler
HasLastReportTime
forFuzzState
2 The Scheduler
The type of
scheduler
andinfant_scheduler
are changed due to the constraints of newScheduler
trait. The types are changed as follows:dyn
Scheduler ->generic
Scheduler;Immutable reference
->Owned
orMutable reference
.For example:
2.1 Why cannot Schedulers be made into trait objects?
Because the
Scheduler
of new version is NOT object-safe. Let's look into the definition ofScheduler
:2.2 Why mutable?
As you can see in the above, all the methods of
Scheduler
take&mut self
as the receiver, so the schedulers have to be mutable.2.3 Why owned?
Because a mutable reference cannot be borrowed more than once at a time, and clone a scheduler is cheap and safe since it is an empty struct.
So, it's safe that structs own schedulers and pass them to functions as mutable references.
3 The Type of CorpusId
The type of corpus_id in traits has changed from
usize
toCorpusId
, but I didn't change the layout of existing structs, so there are some conversions betweenusize
andCorpusId
.4 HasMetadata and HasNamedMetadata
The method names have been changed:
metadata/metadata_mut
->metadata_map/metadata_map_mut
, andnamed_metadata/named_metadata_mut
->named_metadata_map/named_metadata_map_mut
.5 libalf::bolts -> libafl_bolts
The
libafl::bolts
module is separated fromlibafl
to libafl_bolts.6 Fine-Tuned Existing Implementations
Fine-Tuning Existing Implementations by removing reduntant generics and adding associated types and so on.