meme / hotwax

Coverage-guided binary fuzzing powered by Frida Stalker
The Unlicense
179 stars 21 forks source link

Prefetch #15

Closed WorksButNotTested closed 3 years ago

WorksButNotTested commented 3 years ago

Obviously not expecting this to be merged right in. But I've played around with the prefetching and added a ton of comments. If you've got a more representative test, then I'd be interested to see what performance metric you get.

meme commented 3 years ago

Thanks for the PR. I have a local benchmark which is using the OpenSSL example from libFuzzer: https://google.github.io/clusterfuzz/setting-up-fuzzing/heartbleed-example/#building-a-libfuzzer-target-for-openssl. It seems to be a really good benchmark, and we get to find Heartbleed using hotwax!

I'll take a look at this PR's performance in isolation and then in conjunction with Ole's new logging offset calculation code.

WorksButNotTested commented 3 years ago

Cool thanks. I think before the prefetching was being done in the child, so each fork would fetch every block (including those which might not be reached) and then discard them. Hence the slow down.

Assuming the number of persistent loops isn't huge, then I can't logically see why using prefetch shouldn't have a positive effect, even if the block compilation overhead is low, but maybe I've missed something?!

meme commented 3 years ago

I've merged this into prefetch-ng where I'll work on it further there & provide my benchmark suite. Thanks again for this.