-
-
Notifications
You must be signed in to change notification settings - Fork 321
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
Feature: Make executors and feedbacks easier to use outside of the fuzzing loop #2511
Feature: Make executors and feedbacks easier to use outside of the fuzzing loop #2511
Conversation
…utside of LibAFLs Fuzzer loop
@addisoncrump can you take a look? It might interfere with #2438 somewhat (?) |
ideally the normal run_target would already be reusable / have minimal generic bounds/ have sensible Nop Variants for easy use. |
Sorry for the delay -- lots of IRL stuff right now. I will look at this tomorrow. |
Sorry for the delay, I think we can merge this. |
wait, i'll check this when i refactor (or before) executor. |
Just checking in, what's the status of this? Is the idea still to merge this or replace it by other changes? |
testcase: &mut Testcase<S::Input>, | ||
) -> Result<(), Error> | ||
where | ||
S: State + UsesInput, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try to not use UsesInput here?
You can specify
S: HasCorpus and make the input to be <S::Corpus as Corpus>::Input
&mut self, | ||
state: &mut S, | ||
_manager: &mut EM, | ||
_input: &<S as UsesInput>::Input, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here avoid UsesInput too
testcase: &mut Testcase<S::Input>, | ||
) -> Result<(), Error> | ||
where | ||
S: UsesInput + HasCorpus<Input = NautilusInput> + HasMetadata, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too
Sorry for the late review. |
testcase: &mut Testcase<S::Input>, | ||
) where | ||
OT: ObserversTuple<S>, | ||
S: UsesInput, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too
|
||
impl<S, T> Feedback<S> for ListFeedback<T> | ||
where | ||
S: State + HasNamedMetadata, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you need S: State?
manager: &mut EM, | ||
input: &<S as UsesInput>::Input, | ||
_manager: &mut EM, | ||
_input: &<S as UsesInput>::Input, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too.
tell me if you want me to merge from main and resolve conflicts |
@tokatoka if you find the time let's just finish/merge this for 0.14, lukas has done his part I think :) |
Finishing this in #2637, thanks for your help @Lukas-Dresel ! :) |
…zzing loop (extends #2511) (#2637) * feat(libafl_core): make executors and feedbacks more cleanly usable outside of LibAFLs Fuzzer loop * cargo +nightly fmt * updated type constraints * reformatted and final type constraint fixes * made unicode extraction stage useful separately * fix libafl_cc error message * fix state type constraint to be constrained on the method * removed unnecessary observer constraint * renamed unused variables * fix unnecessary error wrapping in helper functions * converted unicode conversion stage into associated function and fixed nautilus changes * more update * Remove extra I * more fmt * bounds? * less bounds * more less bounds * different trait bounds again * more less generics * fix unicode * fix list * remove unneeded bound --------- Co-authored-by: Lukas Dresel <[email protected]> Co-authored-by: Toka <[email protected]>
It would be nice to be able to use LibAFL components more easily outside of LibAFL's fuzzer harnessing (by which I mean the plug-and-play fuzzing loop) to allow for more reuse.
For example, I found myself ripping my hair out over trying to just run the forkserver with an observer to simply collect, aggregate and plot coverage. To do so, I had to provide types for fuzzers, feedbacks, schedulers, etc. even though none of those things were relevant for my use-case.
I ended up making changes like the ones in this PR in my own fork and it made it quite a bit nicer to use, now you can reuse some of the components and are only required to satisfy the directly needed type constraints for these components.