mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-17 12:18:08 +00:00
Collect persistent coverage data and dump it at the end of the run
With CODE_COVERAGE builds, we need to collect the coverage data of each iteration in a persistant buffer that has the same size as the regular trace buffer used for fuzzing. We dump this information at the end of the run and when combined with pointer data and module info, this can be used to calculate code coverage.
This commit is contained in:
@ -252,6 +252,10 @@ void afl_fsrv_init(afl_forkserver_t *fsrv) {
|
||||
fsrv->uses_crash_exitcode = false;
|
||||
fsrv->uses_asan = false;
|
||||
|
||||
#ifdef __AFL_CODE_COVERAGE
|
||||
fsrv->persistent_trace_bits = NULL;
|
||||
#endif
|
||||
|
||||
fsrv->init_child_func = fsrv_exec_child;
|
||||
list_append(&fsrv_list, fsrv);
|
||||
|
||||
@ -278,6 +282,10 @@ void afl_fsrv_init_dup(afl_forkserver_t *fsrv_to, afl_forkserver_t *from) {
|
||||
fsrv_to->fsrv_kill_signal = from->fsrv_kill_signal;
|
||||
fsrv_to->debug = from->debug;
|
||||
|
||||
#ifdef __AFL_CODE_COVERAGE
|
||||
fsrv_to->persistent_trace_bits = from->persistent_trace_bits;
|
||||
#endif
|
||||
|
||||
// These are forkserver specific.
|
||||
fsrv_to->out_dir_fd = -1;
|
||||
fsrv_to->child_pid = -1;
|
||||
|
Reference in New Issue
Block a user