seed rng from SEED_RANDOM

This commit is contained in:
Alwin Berger 2023-03-13 14:45:21 +01:00
parent f09034b7fe
commit a05ff97d0c
2 changed files with 6 additions and 2 deletions

View File

@ -97,7 +97,7 @@ rule run_bench:
export FUZZ_INPUT={fuzz_input}
export FUZZ_INPUT_LEN={fuzz_len}
export BREAKPOINT={bkp}
export SEED_RANDOM=1
export SEED_RANDOM={num}
export TIME_DUMP=$(pwd)/{output[0]}
export CASE_DUMP=$(pwd)/{output[2]}
export FUZZ_ITERS=10800

View File

@ -41,7 +41,7 @@ use crate::{
qemustate::QemuStateRestoreHelper,
systemstate::{helpers::QemuSystemStateHelper, observers::QemuSystemStateObserver, feedbacks::{DumpSystraceFeedback, NovelSystemStateFeedback}, graph::{SysMapFeedback, SysGraphFeedbackState, GraphMaximizerCorpusScheduler}}, worst::{TimeMaximizerCorpusScheduler, ExecTimeIncFeedback, TimeStateMaximizerCorpusScheduler},
};
pub const RNG_SEED: u64 = 1;
pub static mut RNG_SEED: u64 = 1;
pub const MAX_NUM_INTERRUPT: usize = 32;
pub const DO_NUM_INTERRUPT: usize = 32;
@ -161,6 +161,10 @@ pub fn fuzz() {
}
unsafe {dbg!(MAX_INPUT_SIZE);}
if let Ok(seed) = env::var("SEED_RANDOM") {
unsafe {RNG_SEED = str::parse::<u64>(&seed).expect("SEED_RANDOM must be an integer.");}
}
let mut run_client = |state: Option<_>, mut mgr, _core_id| {
// Initialize QEMU
let args: Vec<String> = env::args().collect();