Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Adding statistic metrics: peak_rss_mb and slowest_exec_ms #15

Merged
merged 4 commits into from Aug 28, 2019

Conversation

neuracr
Copy link
Contributor

@neuracr neuracr commented Aug 27, 2019

Gather more metrics and print them in the fuzzer_stats report to better understand how a fuzzer behaves:

  • peak_rss_mb: the maximum rss value reached during the fuzzing. This is collected by the parent process at the end of the fuzzing session using getrusage on RUSAGE_CHILDREN (the parent process needs to end and wait for the children to use the RUSAGE_CHILDREN option).
  • slowest_exec_ms: duration of the slowest execution in ms that is not considered as a hang.

afl-fuzz.c Show resolved Hide resolved
…on stops programmatically before calling waitpid
@jonathanmetzman
Copy link
Contributor

Probably worth mentioning in the commit that these stats are reported by libFuzzer

@jduart jduart merged commit f16c032 into google:master Aug 28, 2019
jduart pushed a commit that referenced this pull request Sep 2, 2019
PR #15 added new statistics outputed to the out/fuzzer_stats file. Add tests for it.

- create a .travis/ directory in which we can put helper scripts for travis
- create .travis/check_fuzzer_stats.sh to parse out/fuzzer_stats and check for expected key:value pairs.
- run several jobs to test for different environment variables ( AFL_EXIT_WHEN_DONE, AFL_BENCH_JUST_ONE, AFL_BENCH_UNTIL_CRASH, and manual stopping)
afl-fuzz.c Show resolved Hide resolved
afl-fuzz.c Show resolved Hide resolved
@@ -3440,7 +3449,8 @@ static void write_stats_file(double bitmap_cvg, double stability, double eps) {
"afl_banner : %s\n"
"afl_version : " VERSION "\n"
"target_mode : %s%s%s%s%s%s%s\n"
"command_line : %s\n",
"command_line : %s\n"
"slowest_exec_ms : %llu\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we naming/making this slowest_exec_ms instead of libFuzzer's slowest_unit_time_sec because the other AFL time stats are reported in ms and because AFL's timeout is usually < 1 second?

Maybe this should be named slowest_exec to be consistent with exec_timeout?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know that libFuzzer measures slow units in seconds. But I think that since we gather the times in ms granularity (even μs) it's better to keep ms, because seconds seem a bit too coarse in a fuzzing context.
Talking about the name, if we decide to keep it in ms, I think it's better to mention it so that people don't get confused. I don't have an opinion for unit or exec.
Can we continue to discuss this is #23 ?

@jonathanmetzman
Copy link
Contributor

jonathanmetzman commented Sep 4, 2019

Probably worth documenting these stats in docs/status_screen.txt like the other stats.

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

Successfully merging this pull request may close these issues.

None yet

3 participants