AFLplusplus / LibAFL

Advanced Fuzzing Library - Slot your Fuzzer together in Rust! Scales across cores and machines. For Windows, Android, MacOS, Linux, no_std, ...
Other
2.05k stars 322 forks source link

Implement State save restore to disk on SIGINT to allow to stop and resume a fuzzer #288

Open andreafioraldi opened 3 years ago

andreafioraldi commented 3 years ago

We should implement the handler for posix and windows and extend it to work with multiple processes when using a launcher

domenukk commented 3 years ago

I don't think we have the state available at any time, necessarily. We could set a "exit_soon" flag to true in the handler and check that at certain points in time

domenukk commented 3 years ago

An AFL-Like resume with ondiskcorpus may be fine, though?

s1341 commented 3 years ago

Currently loading from an OnDiskCorpus is quite horrific, especially when running ('resuming') on multiple cores. It takes forever and each core sends all testcases to every other core.... We need to provide a better user experience for this.

s1341 commented 3 years ago

After running a fuzz-campaign for about a week with LibAFL, it's clear to me that some way to stop and resume the fuzzing, potentially with tweaks to the fuzzer in between, is a critical requirement.

Assuming we just re-read the queue, we need to either delegate the queue-reading to a single node (a 'queue importer'?), or find a way to efficiently spread the queue-reading across nodes, without causing a cascade of 'new test-cases' from every node to every other node.

tokatoka commented 2 years ago

I think at least we should add proper signal handlings for SIGINT and SIGTERM

tokatoka commented 2 years ago

The shmem allocated for StateRestorer is not freed when the process is killed, so we need to implement this.