Skip to content

Commit dd0bcba

Browse files
authored
Fix #3155 (#3156)
* robot * do ne * FIXER * fixer * plz * LOL * FIXER
1 parent 796ce20 commit dd0bcba

File tree

20 files changed

+542
-10
lines changed

20 files changed

+542
-10
lines changed

fuzzers/baby/tutorial/src/mutator.rs

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use std::borrow::Cow;
22

33
use lain::traits::Mutatable;
44
use libafl::{
5+
corpus::CorpusId,
56
mutators::{MutationResult, Mutator},
67
state::HasRand,
78
Error,
@@ -27,6 +28,11 @@ where
2728
input.mutate(&mut self.inner, None);
2829
Ok(MutationResult::Mutated)
2930
}
31+
32+
#[inline]
33+
fn post_exec(&mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>) -> Result<(), Error> {
34+
Ok(())
35+
}
3036
}
3137

3238
impl Named for LainMutator {

fuzzers/structure_aware/baby_fuzzer_custom_input/src/input.rs

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use core::num::NonZeroUsize;
22
use std::{borrow::Cow, hash::Hash};
33

44
use libafl::{
5+
corpus::CorpusId,
56
generators::{Generator, RandBytesGenerator},
67
inputs::{BytesInput, HasTargetBytes, Input},
78
mutators::{MutationResult, Mutator},
@@ -125,6 +126,10 @@ where
125126
};
126127
Ok(MutationResult::Mutated)
127128
}
129+
#[inline]
130+
fn post_exec(&mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>) -> Result<(), Error> {
131+
Ok(())
132+
}
128133
}
129134

130135
impl<G> Named for ToggleOptionalByteArrayMutator<G> {
@@ -141,6 +146,11 @@ impl<S> Mutator<CustomInput, S> for ToggleBooleanMutator {
141146
input.boolean = !input.boolean;
142147
Ok(MutationResult::Mutated)
143148
}
149+
150+
#[inline]
151+
fn post_exec(&mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>) -> Result<(), Error> {
152+
Ok(())
153+
}
144154
}
145155

146156
impl Named for ToggleBooleanMutator {

libafl/src/monitors/tui/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ pub struct TuiContext {
281281

282282
pub total_map_density: String,
283283
pub total_solutions: u64,
284-
pub total_cycles_done: u64,
285284
pub total_corpus_count: u64,
286285

287286
pub total_process_timing: ProcessTiming,
@@ -310,7 +309,6 @@ impl TuiContext {
310309

311310
total_map_density: "0%".to_string(),
312311
total_solutions: 0,
313-
total_cycles_done: 0,
314312
total_corpus_count: 0,
315313
total_item_geometry: ItemGeometry::new(),
316314
total_process_timing: ProcessTiming::new(),
@@ -374,7 +372,6 @@ impl Monitor for TuiMonitor {
374372
edges_total,
375373
}| format!("{}%", edges_hit * 100 / edges_total),
376374
);
377-
ctx.total_cycles_done = 0;
378375
ctx.total_item_geometry = client_stats_manager.item_geometry();
379376
}
380377

libafl/src/monitors/tui/ui.rs

-2
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,6 @@ impl TuiUi {
602602
Row::new(vec![
603603
Cell::from(Span::raw("solutions")),
604604
Cell::from(Span::raw(format_big_number(app.total_solutions))),
605-
Cell::from(Span::raw("cycle done")),
606-
Cell::from(Span::raw(format_big_number(app.total_cycles_done))),
607605
Cell::from(Span::raw("corpus count")),
608606
Cell::from(Span::raw(format_big_number(app.total_corpus_count))),
609607
]),

libafl/src/mutators/encoded_mutations.rs

+72
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ impl<S: HasRand> Mutator<EncodedInput, S> for EncodedRandMutator {
3636
Ok(MutationResult::Mutated)
3737
}
3838
}
39+
#[inline]
40+
fn post_exec(
41+
&mut self,
42+
_state: &mut S,
43+
_new_corpus_id: Option<crate::corpus::CorpusId>,
44+
) -> Result<(), Error> {
45+
Ok(())
46+
}
3947
}
4048

4149
impl Named for EncodedRandMutator {
@@ -67,6 +75,14 @@ impl<S: HasRand> Mutator<EncodedInput, S> for EncodedIncMutator {
6775
Ok(MutationResult::Mutated)
6876
}
6977
}
78+
#[inline]
79+
fn post_exec(
80+
&mut self,
81+
_state: &mut S,
82+
_new_corpus_id: Option<crate::corpus::CorpusId>,
83+
) -> Result<(), Error> {
84+
Ok(())
85+
}
7086
}
7187

7288
impl Named for EncodedIncMutator {
@@ -98,6 +114,14 @@ impl<S: HasRand> Mutator<EncodedInput, S> for EncodedDecMutator {
98114
Ok(MutationResult::Mutated)
99115
}
100116
}
117+
#[inline]
118+
fn post_exec(
119+
&mut self,
120+
_state: &mut S,
121+
_new_corpus_id: Option<crate::corpus::CorpusId>,
122+
) -> Result<(), Error> {
123+
Ok(())
124+
}
101125
}
102126

103127
impl Named for EncodedDecMutator {
@@ -133,6 +157,14 @@ impl<S: HasRand> Mutator<EncodedInput, S> for EncodedAddMutator {
133157
Ok(MutationResult::Mutated)
134158
}
135159
}
160+
#[inline]
161+
fn post_exec(
162+
&mut self,
163+
_state: &mut S,
164+
_new_corpus_id: Option<crate::corpus::CorpusId>,
165+
) -> Result<(), Error> {
166+
Ok(())
167+
}
136168
}
137169

138170
impl Named for EncodedAddMutator {
@@ -174,6 +206,14 @@ impl<S: HasRand> Mutator<EncodedInput, S> for EncodedDeleteMutator {
174206

175207
Ok(MutationResult::Mutated)
176208
}
209+
#[inline]
210+
fn post_exec(
211+
&mut self,
212+
_state: &mut S,
213+
_new_corpus_id: Option<crate::corpus::CorpusId>,
214+
) -> Result<(), Error> {
215+
Ok(())
216+
}
177217
}
178218

179219
impl Named for EncodedDeleteMutator {
@@ -241,6 +281,14 @@ where
241281

242282
Ok(MutationResult::Mutated)
243283
}
284+
#[inline]
285+
fn post_exec(
286+
&mut self,
287+
_state: &mut S,
288+
_new_corpus_id: Option<crate::corpus::CorpusId>,
289+
) -> Result<(), Error> {
290+
Ok(())
291+
}
244292
}
245293

246294
impl Named for EncodedInsertCopyMutator {
@@ -289,6 +337,14 @@ impl<S: HasRand> Mutator<EncodedInput, S> for EncodedCopyMutator {
289337

290338
Ok(MutationResult::Mutated)
291339
}
340+
#[inline]
341+
fn post_exec(
342+
&mut self,
343+
_state: &mut S,
344+
_new_corpus_id: Option<crate::corpus::CorpusId>,
345+
) -> Result<(), Error> {
346+
Ok(())
347+
}
292348
}
293349

294350
impl Named for EncodedCopyMutator {
@@ -372,6 +428,14 @@ where
372428

373429
Ok(MutationResult::Mutated)
374430
}
431+
#[inline]
432+
fn post_exec(
433+
&mut self,
434+
_state: &mut S,
435+
_new_corpus_id: Option<crate::corpus::CorpusId>,
436+
) -> Result<(), Error> {
437+
Ok(())
438+
}
375439
}
376440

377441
impl Named for EncodedCrossoverInsertMutator {
@@ -445,6 +509,14 @@ where
445509

446510
Ok(MutationResult::Mutated)
447511
}
512+
#[inline]
513+
fn post_exec(
514+
&mut self,
515+
_state: &mut S,
516+
_new_corpus_id: Option<crate::corpus::CorpusId>,
517+
) -> Result<(), Error> {
518+
Ok(())
519+
}
448520
}
449521

450522
impl Named for EncodedCrossoverReplaceMutator {

libafl/src/mutators/gramatron.rs

+24
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ where
5656
Ok(MutationResult::Skipped)
5757
}
5858
}
59+
#[inline]
60+
fn post_exec(
61+
&mut self,
62+
_state: &mut S,
63+
_new_corpus_id: Option<crate::corpus::CorpusId>,
64+
) -> Result<(), Error> {
65+
Ok(())
66+
}
5967
}
6068

6169
impl<S> Named for GramatronRandomMutator<'_, S>
@@ -158,6 +166,14 @@ where
158166
},
159167
)
160168
}
169+
#[inline]
170+
fn post_exec(
171+
&mut self,
172+
_state: &mut S,
173+
_new_corpus_id: Option<crate::corpus::CorpusId>,
174+
) -> Result<(), Error> {
175+
Ok(())
176+
}
161177
}
162178

163179
impl Named for GramatronSpliceMutator {
@@ -267,6 +283,14 @@ where
267283

268284
Ok(MutationResult::Mutated)
269285
}
286+
#[inline]
287+
fn post_exec(
288+
&mut self,
289+
_state: &mut S,
290+
_new_corpus_id: Option<crate::corpus::CorpusId>,
291+
) -> Result<(), Error> {
292+
Ok(())
293+
}
270294
}
271295

272296
impl Named for GramatronRecursionMutator {

libafl/src/mutators/grimoire.rs

+32
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ where
139139
&mut self.gap_indices,
140140
)
141141
}
142+
#[inline]
143+
fn post_exec(
144+
&mut self,
145+
_state: &mut S,
146+
_new_corpus_id: Option<crate::corpus::CorpusId>,
147+
) -> Result<(), Error> {
148+
Ok(())
149+
}
142150
}
143151

144152
impl<I> Named for GrimoireExtensionMutator<I> {
@@ -219,6 +227,14 @@ where
219227

220228
Ok(mutated)
221229
}
230+
#[inline]
231+
fn post_exec(
232+
&mut self,
233+
_state: &mut S,
234+
_new_corpus_id: Option<crate::corpus::CorpusId>,
235+
) -> Result<(), Error> {
236+
Ok(())
237+
}
222238
}
223239

224240
impl<I> Named for GrimoireRecursiveReplacementMutator<I> {
@@ -343,6 +359,14 @@ where
343359

344360
Ok(mutated)
345361
}
362+
#[inline]
363+
fn post_exec(
364+
&mut self,
365+
_state: &mut S,
366+
_new_corpus_id: Option<crate::corpus::CorpusId>,
367+
) -> Result<(), Error> {
368+
Ok(())
369+
}
346370
}
347371

348372
impl<I> Named for GrimoireStringReplacementMutator<I> {
@@ -410,6 +434,14 @@ where
410434

411435
Ok(result)
412436
}
437+
#[inline]
438+
fn post_exec(
439+
&mut self,
440+
_state: &mut S,
441+
_new_corpus_id: Option<crate::corpus::CorpusId>,
442+
) -> Result<(), Error> {
443+
Ok(())
444+
}
413445
}
414446

415447
impl<I> Named for GrimoireRandomDeleteMutator<I> {

libafl/src/mutators/hash.rs

+8
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ where
4040
Ok(MutationResult::Mutated)
4141
}
4242
}
43+
#[inline]
44+
fn post_exec(
45+
&mut self,
46+
state: &mut S,
47+
new_corpus_id: Option<crate::corpus::CorpusId>,
48+
) -> Result<(), Error> {
49+
self.inner.post_exec(state, new_corpus_id)
50+
}
4351
}
4452

4553
impl<M> Named for MutationChecker<M> {

0 commit comments

Comments
 (0)