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

Make --timeout use seconds #208

Closed
smoelius opened this issue May 10, 2023 · 2 comments · Fixed by #219
Closed

Make --timeout use seconds #208

smoelius opened this issue May 10, 2023 · 2 comments · Fixed by #219
Assignees
Labels
good first issue Good for newcomers

Comments

@smoelius
Copy link
Collaborator

      --timeout <TIMEOUT>     Number of milliseconds to consider a hang when fuzzing or replaying
                              (equivalent to -- -t <TIMEOUT> when fuzzing)

AFLplusplus's -V option uses seconds, as do libfuzzer's --timeout and --max_total_time options, and it's hard to keep the distinction.

Also, the extra granularity probably isn't necessary.

@smoelius smoelius added the good first issue Good for newcomers label May 10, 2023
@dhruvdabhi101
Copy link
Contributor

Hello, I am rust beginner. And I think I found the change i need to make to fix this issue. So can you please assign this issue to me ?

I have to just change

- Duration::from_millies 
+ Duration::from_secs

and also some changes where i need to change from 1000 to 1 because of conversion from millisecs to secs.
Screenshot 2023-05-24 at 16 35 28

@smoelius
Copy link
Collaborator Author

@dhruvdabhi101 Thanks very much for your interest. I've assigned the issue to you.

One other location that I want to call out as needing to change is this one:

args.extend(["-t".to_owned(), format!("{}", timeout * NANOS_PER_MILLI)]);

Incidentally, I think there is a bug there. 😬 afl-fuzz expects its -t argument to be in milliseconds, not nanos:

  -t msec       - timeout for each run (auto-scaled, default 1000 ms). Add a '+'

So I think that line should probably be:

 args.extend(["-t".to_owned(), format!("{}", timeout)]); 

But following your changes, it will be something like:

 args.extend(["-t".to_owned(), format!("{}", timeout * MILLIS_PER_SEC)]); 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants