aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-12-01 17:27:08 +0100
committerDmitry Vyukov <dvyukov@google.com>2017-12-01 17:27:08 +0100
commit48359b97770f794600de4b58aab8aa069ee993db (patch)
tree7ba2d1147829f1ecd2853f0c12930edc3443747b
parent948edf8055be2275a7c051e49cd38223517f98be (diff)
dashboard/app: improve needRepro
Don't reproduce corrupted reports. Don't reproduce if canonical bug already has repro.
-rw-r--r--dashboard/app/api.go21
-rw-r--r--syz-manager/manager.go5
2 files changed, 20 insertions, 6 deletions
diff --git a/dashboard/app/api.go b/dashboard/app/api.go
index cab952561..53ea252ac 100644
--- a/dashboard/app/api.go
+++ b/dashboard/app/api.go
@@ -406,7 +406,7 @@ func apiReportCrash(c context.Context, ns string, r *http.Request) (interface{},
return nil, err
}
resp := &dashapi.ReportCrashResp{
- NeedRepro: needRepro(bug),
+ NeedRepro: needRepro(c, bug),
}
return resp, nil
}
@@ -616,7 +616,7 @@ func apiNeedRepro(c context.Context, ns string, r *http.Request) (interface{}, e
return nil, fmt.Errorf("%v: can't find bug for crash %q", ns, req.Title)
}
resp := &dashapi.NeedReproResp{
- NeedRepro: needRepro(bug),
+ NeedRepro: needRepro(c, bug),
}
return resp, nil
}
@@ -728,10 +728,23 @@ func isActiveBug(c context.Context, bug *Bug) (bool, error) {
return canon.Status == BugStatusOpen, nil
}
-func needRepro(bug *Bug) bool {
+func needRepro(c context.Context, bug *Bug) bool {
+ if !needReproForBug(bug) {
+ return false
+ }
+ canon, err := canonicalBug(c, bug)
+ if err != nil {
+ log.Errorf(c, "failed to get canonical bug: %v", err)
+ return false
+ }
+ return needReproForBug(canon)
+}
+
+func needReproForBug(bug *Bug) bool {
return bug.ReproLevel < ReproLevelC &&
bug.NumRepro < 5 &&
- len(bug.Commits) == 0
+ len(bug.Commits) == 0 &&
+ bug.Title != corruptedReportTitle
}
func putText(c context.Context, ns, tag string, data []byte, dedup bool) (int64, error) {
diff --git a/syz-manager/manager.go b/syz-manager/manager.go
index 6be5761ba..9fda114f5 100644
--- a/syz-manager/manager.go
+++ b/syz-manager/manager.go
@@ -384,8 +384,9 @@ func (mgr *Manager) vmLoop() {
}
} else {
cid := &dashapi.CrashID{
- BuildID: mgr.cfg.Tag,
- Title: crash.Title,
+ BuildID: mgr.cfg.Tag,
+ Title: crash.Title,
+ Corrupted: crash.Corrupted,
}
needRepro, err := mgr.dash.NeedRepro(cid)
if err != nil {