diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2026-01-25 21:00:40 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2026-01-26 15:43:37 +0000 |
| commit | dd170fcec9a15df2760e4cd84d22aab51ef0d172 (patch) | |
| tree | 532d768100416bf9d0118f317840fbf827663e99 /pkg | |
| parent | b1fba588efbe2bb51372949feef8c2d6a8cd1c7d (diff) | |
pkg/manager: store status in the diff storage
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/manager/diff/manager.go | 7 | ||||
| -rw-r--r-- | pkg/manager/diff_store.go | 22 |
2 files changed, 27 insertions, 2 deletions
diff --git a/pkg/manager/diff/manager.go b/pkg/manager/diff/manager.go index cc4d8e0d1..cb19add63 100644 --- a/pkg/manager/diff/manager.go +++ b/pkg/manager/diff/manager.go @@ -191,6 +191,9 @@ loop: } log.Logf(1, "found repro for %q (orig title: %q, reliability: %2.f), took %.2f minutes", ret.Repro.Report.Title, origTitle, ret.Repro.Reliability, ret.Stats.TotalTime.Minutes()) + + dc.store.UpdateStatus(ret.Repro.Report.Title, manager.DiffBugStatusVerifying) + g.Go(func() error { runner.Run(groupCtx, ret.Repro, ret.Crash.FullRepro) return nil @@ -198,6 +201,7 @@ loop: } else { origTitle := ret.Crash.Report.Title log.Logf(1, "failed repro for %q, err=%s", origTitle, ret.Err) + dc.store.UpdateStatus(origTitle, manager.DiffBugStatusCompleted) } dc.store.SaveRepro(ret) case rep := <-dc.new.crashes: @@ -208,7 +212,10 @@ loop: rep.Title, need) dc.store.PatchedCrashed(rep.Title, rep.Report, rep.Output) if need { + dc.store.UpdateStatus(rep.Title, manager.DiffBugStatusVerifying) reproLoop.Enqueue(crash) + } else { + dc.store.UpdateStatus(rep.Title, manager.DiffBugStatusIgnored) } } } diff --git a/pkg/manager/diff_store.go b/pkg/manager/diff_store.go index 2fb7d7f19..dfbbc6491 100644 --- a/pkg/manager/diff_store.go +++ b/pkg/manager/diff_store.go @@ -16,8 +16,18 @@ import ( "github.com/google/syzkaller/pkg/osutil" ) +type DiffBugStatus string + +const ( + DiffBugStatusPending DiffBugStatus = "pending" + DiffBugStatusVerifying DiffBugStatus = "verifying" + DiffBugStatusCompleted DiffBugStatus = "completed" + DiffBugStatusIgnored DiffBugStatus = "ignored" +) + type DiffBug struct { Title string + Status DiffBugStatus Base DiffBugInfo Patched DiffBugInfo } @@ -49,8 +59,15 @@ type DiffFuzzerStore struct { bugs map[string]*DiffBug } +func (s *DiffFuzzerStore) UpdateStatus(title string, status DiffBugStatus) { + s.patch(title, func(obj *DiffBug) { + obj.Status = status + }) +} + func (s *DiffFuzzerStore) BaseCrashed(title string, report []byte) { s.patch(title, func(obj *DiffBug) { + obj.Status = DiffBugStatusCompleted obj.Base.Crashes++ if len(report) > 0 { obj.Base.Report = s.saveFile(title, "base_report", report) @@ -67,6 +84,7 @@ func (s *DiffFuzzerStore) EverCrashedBase(title string) bool { func (s *DiffFuzzerStore) BaseNotCrashed(title string) { s.patch(title, func(obj *DiffBug) { + obj.Status = DiffBugStatusCompleted if obj.Base.Crashes == 0 { obj.Base.NotCrashed = true } @@ -131,7 +149,7 @@ func (s *DiffFuzzerStore) PlainTextDump() []byte { }) var buf bytes.Buffer w := tabwriter.NewWriter(&buf, 0, 0, 1, ' ', 0) - fmt.Fprintln(w, "Title\tOn-Base\tOn-Patched") + fmt.Fprintln(w, "Title\tOn-Base\tOn-Patched\tStatus") printInfo := func(info *DiffBugInfo) { if info.Crashes > 0 { @@ -147,7 +165,7 @@ func (s *DiffFuzzerStore) PlainTextDump() []byte { printInfo(&item.Base) fmt.Fprintf(w, "\t") printInfo(&item.Patched) - fmt.Fprintf(w, "\n") + fmt.Fprintf(w, "\t%s\n", item.Status) } w.Flush() return buf.Bytes() |
