diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-07-22 09:59:09 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-07-22 09:38:18 +0000 |
| commit | f063dfd966f00f90fbae94d179f26cf36fea3f5b (patch) | |
| tree | 2e58f27f65a6f9d2dece091ddcef3a23d8cefbb0 /executor/executor_test.h | |
| parent | 7538bc297d62e223e4216db0e039be296aff4553 (diff) | |
executor: fix writing of remote coverage
We never reset remote coverage, so if there is one block,
we will write it after every call and multiple times at the end.
It can lead to "too many calls in output" and just writes quadratic
amount of coverage/signal.
Reset remote coverage after writing.
Diffstat (limited to 'executor/executor_test.h')
| -rw-r--r-- | executor/executor_test.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/executor/executor_test.h b/executor/executor_test.h index 5e128d851..c94de09a2 100644 --- a/executor/executor_test.h +++ b/executor/executor_test.h @@ -121,9 +121,8 @@ static void cover_unprotect(cover_t* cov) { } -static long syz_inject_cover(volatile long a, volatile long b) +static long inject_cover(cover_t* cov, long a, long b) { - cover_t* cov = ¤t_thread->cov; if (cov->data == nullptr) return ENOENT; uint32 size = std::min((uint32)b, cov->mmap_alloc_size); @@ -132,6 +131,16 @@ static long syz_inject_cover(volatile long a, volatile long b) return 0; } +static long syz_inject_cover(volatile long a, volatile long b) +{ + return inject_cover(¤t_thread->cov, a, b); +} + +static long syz_inject_remote_cover(volatile long a, volatile long b) +{ + return inject_cover(&extra_cov, a, b); +} + static const char* setup_fault() { return nullptr; |
