diff options
| author | Taras Madan <tarasmadan@google.com> | 2025-07-01 10:15:11 +0200 |
|---|---|---|
| committer | Taras Madan <tarasmadan@google.com> | 2025-07-02 08:52:54 +0000 |
| commit | d94a0369a298b9dd3a9bc17d664840ea6f64401e (patch) | |
| tree | c3b24a3497e8ec085e88f2a12f6ae70bddbd07c6 /dashboard/app | |
| parent | bc80e4f080d226b12fae367dc46bc54ac3681009 (diff) | |
dashboard/app: use crash types instead, no regexps
Diffstat (limited to 'dashboard/app')
| -rw-r--r-- | dashboard/app/graphs.go | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/dashboard/app/graphs.go b/dashboard/app/graphs.go index 9ba5d6313..068259135 100644 --- a/dashboard/app/graphs.go +++ b/dashboard/app/graphs.go @@ -13,6 +13,8 @@ import ( "strconv" "time" + "github.com/google/syzkaller/pkg/report" + "github.com/google/syzkaller/pkg/report/crash" db "google.golang.org/appengine/v2/datastore" ) @@ -354,25 +356,25 @@ func createFoundBugs(c context.Context, bugs []*Bug) *uiGraph { types := []struct { name string color string - re *regexp.Regexp + pred crash.TypeGroupPred }{ - {"KASAN", "Red", regexp.MustCompile(`^KASAN:`)}, - {"KMSAN", "Gold", regexp.MustCompile(`^KMSAN:`)}, - {"KCSAN", "Fuchsia", regexp.MustCompile(`^KCSAN:`)}, - {"mem safety", "OrangeRed", regexp.MustCompile(`^(WARNING: refcount bug|UBSAN: array-index|BUG: corrupted list|BUG: unable to handle kernel paging request)`)}, - {"mem leak", "MediumSeaGreen", regexp.MustCompile(`^memory leak`)}, - {"locking", "DodgerBlue", regexp.MustCompile(`^(BUG: sleeping function|BUG: spinlock recursion|BUG: using ([a-z_]+)\\(\\) in preemptible|inconsistent lock state|WARNING: still has locks held|possible deadlock|WARNING: suspicious RCU usage)`)}, - {"hangs/stalls", "LightSalmon", regexp.MustCompile(`^(BUG: soft lockup|INFO: rcu .* stall|INFO: task hung)`)}, + {"KASAN", "Red", crash.Type.IsKASAN}, + {"KMSAN", "Gold", crash.Type.IsKMSAN}, + {"KCSAN", "Fuchsia", crash.Type.IsKCSAN}, + {"mem safety", "OrangeRed", crash.Type.IsMemSafety}, + {"mem leak", "MediumSeaGreen", crash.Type.IsMemoryLeak}, + {"locking", "DodgerBlue", crash.Type.IsLockingBug}, + {"hangs/stalls", "LightSalmon", crash.Type.IsHang}, // This must be at the end, otherwise "BUG:" will match other error types. - {"DoS", "Violet", regexp.MustCompile(`^(BUG:|kernel BUG|divide error|Internal error in|kernel panic:|general protection fault)`)}, - {"other", "Gray", regexp.MustCompile(`.*`)}, + {"DoS", "Violet", crash.Type.IsDoS}, + {"other", "Gray", func(crash.Type) bool { return true }}, {projected, "LightGray", nil}, } var sorted []time.Time months := make(map[time.Time]map[string]int) for _, bug := range bugs { for _, typ := range types { - if !typ.re.MatchString(bug.Title) { + if !typ.pred(report.TitleToCrashType(bug.Title)) { continue } t := bug.FirstTime |
