From 2a91a78df9ed766fac414f94e9d3cc5fa71add55 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 12 Sep 2024 15:53:24 +0200 Subject: syz-manager: send new inputs to the hub only once We used to send corpus updates (added/removed elements) to the hub in each sync. But that produced too much churn since hub algorithm is O(N^2) (distributing everything to everybody), and lots of new inputs are later removed (either we can't reproduce coverage after restart, or inputs removed during corpus minimization). So now we don't send new inputs in each sync, instead we aim at sending corpus once after initial triage. This solves the problem with non-reproducible/removed inputs. Typical instance life-time on syzbot is <24h, for such instances we send the corpus once. If an instance somehow lives for longer, then we re-connect and re-send once in a while (e.g. a local long-running instance). --- syz-manager/manager.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'syz-manager/manager.go') diff --git a/syz-manager/manager.go b/syz-manager/manager.go index c090d1a0d..71168fb82 100644 --- a/syz-manager/manager.go +++ b/syz-manager/manager.go @@ -974,14 +974,19 @@ func (mgr *Manager) corpusInputHandler(updates <-chan corpus.NewItemEvent) { } } -func (mgr *Manager) getMinimizedCorpus() (corpus []*corpus.Item, repros [][]byte) { +func (mgr *Manager) getMinimizedCorpus() []*corpus.Item { mgr.mu.Lock() defer mgr.mu.Unlock() mgr.minimizeCorpusLocked() - corpus = mgr.corpus.Items() - repros = mgr.newRepros + return mgr.corpus.Items() +} + +func (mgr *Manager) getNewRepros() [][]byte { + mgr.mu.Lock() + defer mgr.mu.Unlock() + repros := mgr.newRepros mgr.newRepros = nil - return + return repros } func (mgr *Manager) addNewCandidates(candidates []fuzzer.Candidate) { -- cgit mrf-deployment