From dd170fcec9a15df2760e4cd84d22aab51ef0d172 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Sun, 25 Jan 2026 21:00:40 +0000 Subject: pkg/manager: store status in the diff storage --- pkg/manager/diff_store.go | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'pkg/manager/diff_store.go') 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() -- cgit mrf-deployment