-
-
Notifications
You must be signed in to change notification settings - Fork 324
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
Allow dyn in StagesTuple, add Current Testcase API, Untraitify Progress #1915
Conversation
libafl/src/stages/calibrate.rs
Outdated
@@ -327,6 +327,16 @@ where | |||
|
|||
Ok(()) | |||
} | |||
|
|||
fn initialize_progress(&mut self, state: &mut Self::State) -> Result<(), Error> { |
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.
@addisoncrump technically we could just call this from the stage, not sure what's best
@@ -115,6 +113,18 @@ where | |||
|
|||
Ok(()) | |||
} | |||
|
|||
#[inline] | |||
fn restart_progress_should_run(&mut self, _state: &mut Self::State) -> Result<bool, Error> { |
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.
Don't 100% like the name but it's the best I found
@@ -356,178 +375,3 @@ where | |||
} | |||
} | |||
} | |||
|
|||
#[cfg(test)] |
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.
why this got deleted?
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.
It's complex and I don't understand what it was doing before my refactor
state.enter_inner_stage()?; | ||
Ok(()) | ||
Ok(true) |
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.
this is not always true? right?
i think it is depending the result of the inner stage
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.
The inner stage will do its own handling, so it's fine to return true here I think
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.
this should respect the result of the inner's restart_pregress_should_run right? @domenukk
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.
Don't think so
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.
hm okay i understand.
but i noticed another problem.
These conditional stage evaluate the closure given by the user. but you could get stuck when evaluating them right? (even before entering the inner stage)
so how about also adding max # of retry to this helper too? then return true if we can continue retry, return false if we reached the cap
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.
ClosureStage uses the RetryHelper. For all user-provided stages, they'll have to implement their own restart handling
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.
I don't think bailing after n
retries will always be the best solution (I would even say it's always the worst)
Replied to the comments |
No, I don't understand how to reply :D |
The 'dyn doesn't help us too much here because the stages need to be |
I think it's confusing that Stage implements functions named like, the inner one could be named as |
Implements proper restarters / progress for Mutational Stages
Also adds new
entry
API to AnyMap,Adds
.current_testcase
and.current_input_cloned
APIsAdds
or_insert_with
to AnyMap, a fast way to insert or getChanges execution counters from usize to
u64
(for 32 bit systems)and a lot more...
RFC: Rename
ProgressHelpers
toRestartHelper