-
-
Notifications
You must be signed in to change notification settings - Fork 334
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
Simplify Executor #2897
Comments
The problem is that these pointers has to be passed right before harness function is called. so i think removing them from run_target is not possible |
What I'm suggesting is splitting Plus it would mean that all interaction with objectives is done in one place (namely the evaluators). Filtering and replaying evaluators could then probably just be implemented as wrappers, similar to e.g. monitors. |
Sorry i still don't understand the design.
Doesn't this mean you still have to pass |
No, the other way around. I'd imagine extending the pub trait Executor<I, OT, S> {
fn run_target(&mut self, input: &I, observers: &mut OT) -> Result<ExitKind, Error>
fn reset_observers_and_run_target(&mut self, input &I, observers: &mut OT, state: &mut S) -> Result<ExitKind, Error> {
// default impl, may have more logic, this is just demonstration
*state.executions_mut() += 1;
observers.pre_exec_all(state, input)?;
let res = self.run_target(input, observers);
observers.post_exec_all(state, input)?;
res
}
} Implementations can own handles to the observers to add data to them (e.g. Then, you have an pub trait Evaluator<EM, I, OT, S> {
fn evaluate(
&mut self,
input: I,
manager: &mut EM,
state: &mut S,
) -> Result<Option<CorpusId>, Error>
} The Stages would receive the evaluator (besides the state, manager, etc.) This way, There would also be an This is still very much work in progress, we may find that we need other functionality. |
ok now i understand. |
The
Executor
trait currently gets 2 parameters that are only ever used in the crash handlers ofInProcessExecutor
and probably shouldn't actually be touched by any executor:objectives
andevent_mgr
. However, the crash handlers need access to them. We should restructure LibAFL in a way where these parameters do not need to be passed to the executor.Discussion started in #2892, and some approaches were discussed there already.
The text was updated successfully, but these errors were encountered: