diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2024-07-11 17:50:42 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-07-11 16:39:58 +0000 |
| commit | b04e57fd40197ad82e1b77e1db4c63f3f7d413cf (patch) | |
| tree | b1f731892ea29bd1515ea951ff2c4c895990083c /syz-manager | |
| parent | ea61de3f3cc7e9b244a0b591c076e385cacef326 (diff) | |
syz-manager: fix the one time reproduction check
We need to consider all reproduction attempts, not just the current
queue.
Diffstat (limited to 'syz-manager')
| -rw-r--r-- | syz-manager/repro.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/syz-manager/repro.go b/syz-manager/repro.go index 178127084..0671aab74 100644 --- a/syz-manager/repro.go +++ b/syz-manager/repro.go @@ -34,6 +34,7 @@ type reproManager struct { mu sync.Mutex queue []*Crash reproducing map[string]bool + attempted map[string]bool } func newReproManager(mgr reproManagerView, reproVMs int, onlyOnce bool) *reproManager { @@ -46,6 +47,7 @@ func newReproManager(mgr reproManagerView, reproVMs int, onlyOnce bool) *reproMa reproVMs: reproVMs, reproducing: map[string]bool{}, pingQueue: make(chan struct{}, 1), + attempted: map[string]bool{}, } ret.statNumReproducing = stats.Create("reproducing", "Number of crashes being reproduced", stats.Console, stats.NoGraph, func() int { @@ -102,18 +104,15 @@ func (m *reproManager) Enqueue(crash *Crash) { m.mu.Lock() defer m.mu.Unlock() - if m.onlyOnce { + if m.onlyOnce && m.attempted[crash.Title] { // Try to reproduce each bug at most 1 time in this mode. // Since we don't upload bugs/repros to dashboard, it likely won't have // the reproducer even if we succeeded last time, and will repeatedly // say it needs a repro. - for _, queued := range m.queue { - if queued.Title == crash.Title { - return - } - } + return } log.Logf(1, "scheduled a reproduction of '%v'", crash.Title) + m.attempted[crash.Title] = true m.queue = append(m.queue, crash) // Ping the loop. |
