Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout forkserver #136

Merged
merged 11 commits into from
May 30, 2021
Merged

Timeout forkserver #136

merged 11 commits into from
May 30, 2021

Conversation

tokatoka
Copy link
Member

@tokatoka tokatoka commented May 28, 2021

#82 #111
I've made the TimeoutForkserverExecutor that wraps around the normal ForkserverExecutor and can check timeout also. It can be used similarly as the TimeoutExecutor, (just pass the Executor and the Duration to call the constructor).

@tokatoka tokatoka marked this pull request as draft May 28, 2021 07:28
@tokatoka
Copy link
Member Author

tokatoka commented May 28, 2021

I have to fix some clippy errors..

@tokatoka
Copy link
Member Author

tokatoka commented May 28, 2021

I don't like it either when clippy complains "XXX is being shadowed" 😓

@tokatoka tokatoka marked this pull request as ready for review May 28, 2021 08:09

pub fn read_st_timed(&mut self, timeout: &mut TimeVal) -> Result<Option<(usize, i32)>, Error> {
let mut buf: [u8; 4] = [0u8; 4];
let st_read = self.st_pipe.read_end().unwrap();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use ? instead of unwrap here?

&mut copy,
)?;
if sret > 0 {
let rlen = self.st_pipe.read(&mut buf)?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

read_exact?

@domenukk
Copy link
Member

Looks good, awesome stuff! :)

@domenukk domenukk merged commit e68eaf8 into main May 30, 2021
@domenukk
Copy link
Member

Should we maybe change the forkserver example to use the TimeoutForkserver now?

@tokatoka
Copy link
Member Author

ok

@tokatoka tokatoka deleted the timeout_forkserver branch June 2, 2021 07:19
khang06 pushed a commit to khang06/LibAFL that referenced this pull request Oct 11, 2022
* barebones for TimeoutForkserverExecutor

* TimeoutForkserverExecutor

* update pid in forkserverexecutor

* clppy and other small fixes

* doc

* fix

* no unwrap

* read_exact and error handling

* fix

* semicolon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants