Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Not terminating process on timeout in Windows for the coverage task #3513

Closed
tevoinea opened this issue Sep 18, 2023 · 0 comments · Fixed by #3529
Closed

Not terminating process on timeout in Windows for the coverage task #3513

tevoinea opened this issue Sep 18, 2023 · 0 comments · Fixed by #3529
Labels
bug Something isn't working

Comments

@tevoinea
Copy link
Member

tevoinea commented Sep 18, 2023

Information

  • Onefuzz version: 8.8
  • OS: Windows 11

Provide detailed reproduction steps (if any)

If this timeout case hits, we never terminate the child process.

crate::timer::timed(self.timeout, move || {
let mut recorder =
WindowsRecorder::new(&loader, self.module_allowlist, self.cache.as_ref());
let (mut dbg, child) = Debugger::init(self.cmd, &mut recorder)?;
dbg.run(&mut recorder)?;
// If the debugger callbacks fail, this may return with a spurious clean exit.
let output = child.wait_with_output()?.into();
// Check if debugging was stopped due to a callback error.
//
// If so, the debugger terminated the target, and the recorded coverage and
// output are both invalid.
if let Some(err) = recorder.stop_error {
return Err(err);
}
let coverage = recorder.coverage;
Ok(Recorded { coverage, output })
})?

Expected result

What is the expected result of the above steps?

We should call quit_debugging from the Debugger module as well as kill and/or wait on the returned `Child.

pub fn quit_debugging(&self) {

https://doc.rust-lang.org/std/process/struct.Child.html#method.kill
https://doc.rust-lang.org/std/process/struct.Child.html#method.wait

AB#166281

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants