pub async fn start_fuzzer_monitor(
        &self,
        worker_id: usize,
        stats_sender: Option<&StatsSender>,
    ) -> Result<()> {
        let local_input_dir = self.create_local_temp_dir().await?;
        loop {
            let instant = Instant::now();
            self.run_fuzzer(&local_input_dir.path(), worker_id, stats_sender)
                .await?;

            let mut entries = tokio::fs::read_dir(local_input_dir.path()).await?;
            while let Ok(Some(entry)) = entries.next_entry().await {
                let destination_path = self
                    .config
                    .inputs
                    .local_path
                    .clone()
                    .join(entry.file_name());
                tokio::fs::rename(&entry.path(), &destination_path)
                    .await
                    .with_context(|| {
                        format!(
                            "unable to move crashing input into results directory: {} - {}",
                            entry.path().display(),
                            destination_path.display()
                        )
                    })?;
            }

            // if libFuzzer is exiting rapidly, give some breathing room to allow the
            // handles to be reaped.
            let runtime = instant.elapsed();
            if runtime < COOLOFF_PERIOD {
                sleep(COOLOFF_PERIOD - runtime).await;
            }
        }
    }
// The fuzzer monitor coordinates a _series_ of fuzzer runs.
//
// A run is one session of continuous fuzzing, terminated by a fuzzing error
// or discovered fault. The monitor restarts the libFuzzer when it exits.
The fuzzer monitor coordinates a _series_ of fuzzer runs.
A run is one session of continuous fuzzing, terminated by a fuzzing error
or discovered fault. The monitor restarts the libFuzzer when it exits.
The fuzzer monitor coordinates a _series_ of fuzzer runs . A run is one session of continuous fuzzing terminated by a fuzzing error or discovered fault . The monitor restarts the libFuzzer when it exits .
pub async fn start_fuzzer_monitor(
        &self,
        worker_id: usize,
        stats_sender: Option<&StatsSender>,
    ) -> Result<()> {
        let local_input_dir = self.create_local_temp_dir().await?;
        loop {
            let instant = Instant::now();
            self.run_fuzzer(&local_input_dir.path(), worker_id, stats_sender)
                .await?;
            let mut entries = tokio::fs::read_dir(local_input_dir.path()).await?;
            while let Ok(Some(entry)) = entries.next_entry().await {
                let destination_path = self
                    .config
                    .inputs
                    .local_path
                    .clone()
                    .join(entry.file_name());
                tokio::fs::rename(&entry.path(), &destination_path)
                    .await
                    .with_context(|| {
                        format!(
                            "unable to move crashing input into results directory: {} - {}",
                            entry.path().display(),
                            destination_path.display()
                        )
                    })?;
            }
            // if libFuzzer is exiting rapidly, give some breathing room to allow the
            // handles to be reaped.
            let runtime = instant.elapsed();
            if runtime < COOLOFF_PERIOD {
                sleep(COOLOFF_PERIOD - runtime).await;
            }
        }
    }
pub async fn start_fuzzer_monitor ( & self , worker_id : usize , stats_sender : Option < & StatsSender > , ) -> Result < ( ) > { let local_input_dir = self . create_local_temp_dir ( ) . await ? ; loop { let instant = Instant :: now ( ) ; self . run_fuzzer ( & local_input_dir . path ( ) , worker_id , stats_sender ) . await ? ; let mut entries = tokio :: fs :: read_dir ( local_input_dir . path ( ) ) . await ? ; while let Ok ( Some ( entry ) ) = entries . next_entry ( ) . await { let destination_path = self . config . inputs . local_path . clone ( ) . join ( entry . file_name ( ) ) ; tokio :: fs :: rename ( & entry . path ( ) , & destination_path ) . await . with_context ( | | { format ! ( " " entry path ( ) display ( ) destination_path display ( ) ) } ) ? ; } // if libFuzzer is exiting rapidly, give some breathing room to allow the // handles to be reaped. let runtime = instant . elapsed ( ) ; if runtime < COOLOFF_PERIOD { sleep ( COOLOFF_PERIOD - runtime ) . await ; } } }
The fuzzer monitor coordinates a _series_ of fuzzer runs.
The fuzzer monitor coordinates a _series_ of fuzzer runs .
&self
worker_id
usize
stats_sender
Option<&StatsSender>
&self
worker_id
usize
stats_sender
Option<&StatsSender>