Don't send unstable entries if there's nothing (#1552)
* shutup calibration * Update build_and_test.yml
This commit is contained in:
parent
aa7993de10
commit
dc7d561621
11
.github/workflows/build_and_test.yml
vendored
11
.github/workflows/build_and_test.yml
vendored
@ -219,11 +219,16 @@ jobs:
|
||||
if: runner.os == 'Linux'
|
||||
run: sudo apt purge llvm* clang*
|
||||
- uses: lyricwulf/abc@v1
|
||||
with:
|
||||
# todo: remove afl++-clang when nyx support samcov_pcguard
|
||||
linux: llvm-15 llvm-15-dev clang-15 nasm ninja-build gcc-arm-linux-gnueabi g++-arm-linux-gnueabi gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-mipsel-linux-gnu g++-mipsel-linux-gnu gcc-powerpc-linux-gnu g++-powerpc-linux-gnu libc6-dev-i386-cross libc6-dev libc6-dev-i386 lib32gcc-11-dev lib32stdc++-11-dev libgtk-3-dev afl++-clang pax-utils libz3-dev
|
||||
with:
|
||||
linux: llvm-15 llvm-15-dev clang-15 nasm ninja-build gcc-arm-linux-gnueabi g++-arm-linux-gnueabi gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-mipsel-linux-gnu g++-mipsel-linux-gnu gcc-powerpc-linux-gnu g++-powerpc-linux-gnu libc6-dev-i386-cross libc6-dev libc6-dev-i386 lib32gcc-11-dev lib32stdc++-11-dev libgtk-3-dev pax-utils libz3-dev
|
||||
# update bash for macos to support `declare -A` command`
|
||||
macos: llvm@15 libpng nasm coreutils z3 bash wget
|
||||
- name: Set clang version
|
||||
if: runner.os == 'Linux'
|
||||
run: sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 100
|
||||
- name: Set clang++ version
|
||||
if: runner.os == 'Linux'
|
||||
run: sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 100
|
||||
- name: pip install
|
||||
run: python3 -m pip install msgpack jinja2 find_libpython
|
||||
# Note that nproc needs to have coreutils installed on macOS, so the order of CI commands matters.
|
||||
|
@ -22,7 +22,9 @@ use crate::{
|
||||
observers::{MapObserver, ObserversTuple, UsesObserver},
|
||||
schedulers::powersched::SchedulerMetadata,
|
||||
stages::Stage,
|
||||
state::{HasClientPerfMonitor, HasCorpus, HasMetadata, HasNamedMetadata, UsesState},
|
||||
state::{
|
||||
HasClientPerfMonitor, HasCorpus, HasExecutions, HasMetadata, HasNamedMetadata, UsesState,
|
||||
},
|
||||
Error,
|
||||
};
|
||||
|
||||
@ -90,7 +92,7 @@ where
|
||||
O: MapObserver,
|
||||
for<'de> <O as MapObserver>::Entry: Serialize + Deserialize<'de> + 'static,
|
||||
OT: ObserversTuple<E::State>,
|
||||
E::State: HasCorpus + HasMetadata + HasClientPerfMonitor + HasNamedMetadata,
|
||||
E::State: HasCorpus + HasMetadata + HasClientPerfMonitor + HasNamedMetadata + HasExecutions,
|
||||
Z: Evaluator<E, EM, State = E::State>,
|
||||
{
|
||||
#[inline]
|
||||
@ -220,7 +222,8 @@ where
|
||||
i += 1;
|
||||
}
|
||||
|
||||
if !unstable_entries.is_empty() {
|
||||
let unstable_found = !unstable_entries.is_empty();
|
||||
if unstable_found {
|
||||
// If we see new stable entries executing this new corpus entries, then merge with the existing one
|
||||
if state.has_metadata::<UnstableEntriesMetadata>() {
|
||||
let existing = state
|
||||
@ -293,18 +296,25 @@ where
|
||||
data.set_handicap(handicap);
|
||||
}
|
||||
|
||||
*state.executions_mut() += i;
|
||||
|
||||
// Send the stability event to the broker
|
||||
if let Some(meta) = state.metadata_map().get::<UnstableEntriesMetadata>() {
|
||||
let unstable_entries = meta.unstable_entries().len();
|
||||
let map_len = meta.map_len();
|
||||
mgr.fire(
|
||||
state,
|
||||
Event::UpdateUserStats {
|
||||
name: "stability".to_string(),
|
||||
value: UserStats::Ratio((map_len - unstable_entries) as u64, map_len as u64),
|
||||
phantom: PhantomData,
|
||||
},
|
||||
)?;
|
||||
if unstable_found {
|
||||
if let Some(meta) = state.metadata_map().get::<UnstableEntriesMetadata>() {
|
||||
let unstable_entries = meta.unstable_entries().len();
|
||||
let map_len = meta.map_len();
|
||||
mgr.fire(
|
||||
state,
|
||||
Event::UpdateUserStats {
|
||||
name: "stability".to_string(),
|
||||
value: UserStats::Ratio(
|
||||
(map_len - unstable_entries) as u64,
|
||||
map_len as u64,
|
||||
),
|
||||
phantom: PhantomData,
|
||||
},
|
||||
)?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
@ -19,9 +19,9 @@ extern "C" {
|
||||
pub fn __libafl_targets_cmplog_instructions(k: u64, shape: u8, arg1: u64, arg2: u64);
|
||||
}
|
||||
|
||||
use frida_gum::ModuleMap;
|
||||
use std::rc::Rc;
|
||||
|
||||
use frida_gum::ModuleMap;
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
use frida_gum::{
|
||||
instruction_writer::{Aarch64Register, IndexMode, InstructionWriter},
|
||||
|
Loading…
x
Reference in New Issue
Block a user