From 7e94e6947b4e622cce1b149718c4030b5fb3f27d Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Mon, 12 Jul 2021 17:03:27 +0000 Subject: all: make all kernel commit hashes 12 byte long Currently email and web templates use 8 byte representation of commit hashes. While this is enough for syzkaller, it becomes less and less suitable for Linux kernel tags. Switch to 12 byte representation for all Linux kernel commit hash mentions. --- dashboard/app/bisect_test.go | 22 +++++++++++----------- dashboard/app/email_test.go | 8 ++++---- dashboard/app/mail_bisect_result.txt | 4 ++-- dashboard/app/mail_bug.txt | 4 ++-- dashboard/app/templates.html | 6 +++--- pkg/html/html.go | 2 +- syz-manager/html.go | 2 +- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/dashboard/app/bisect_test.go b/dashboard/app/bisect_test.go index fe74a70e9..5a83b18f8 100644 --- a/dashboard/app/bisect_test.go +++ b/dashboard/app/bisect_test.go @@ -155,7 +155,7 @@ Date: Wed Feb 9 04:05:06 2000 +0000 kernel: add a bug bisection log: %[2]v -start commit: 11111111 kernel_commit_title1 +start commit: 111111111111 kernel_commit_title1 git tree: repo1 branch1 final oops: %[3]v console output: %[4]v @@ -201,7 +201,7 @@ For information about bisection process see: https://goo.gl/tpsmEJ#bisection syzbot found the following issue on: -HEAD commit: 11111111 kernel_commit_title1 +HEAD commit: 111111111111 kernel_commit_title1 git tree: repo1 branch1 console output: %[2]v kernel config: %[3]v @@ -396,7 +396,7 @@ Date: Wed Feb 9 04:05:06 2000 +0000 kernel: add a fix bisection log: %[2]v -start commit: 11111111 kernel_commit_title1 +start commit: 111111111111 kernel_commit_title1 git tree: repo1 branch1 final oops: %[3]v console output: %[4]v @@ -481,11 +481,11 @@ func TestBisectCauseInconclusive(t *testing.T) { c.expectEQ(len(msg.Attachments), 0) c.expectEQ(msg.Body, fmt.Sprintf(`Bisection is inconclusive: the first bad commit could be any of: -11111111 kernel: break build -22222222 kernel: now add a bug to the broken build +111111111111 kernel: break build +222222222222 kernel: now add a bug to the broken build bisection log: %[2]v -start commit: 11111111 kernel_commit_title1 +start commit: 111111111111 kernel_commit_title1 git tree: repo1 branch1 kernel config: %[3]v dashboard link: https://testapp.appspot.com/bug?extid=%[1]v @@ -510,7 +510,7 @@ For information about bisection process see: https://goo.gl/tpsmEJ#bisection syzbot found the following issue on: -HEAD commit: 11111111 kernel_commit_title1 +HEAD commit: 111111111111 kernel_commit_title1 git tree: repo1 branch1 console output: %[2]v kernel config: %[3]v @@ -521,8 +521,8 @@ C reproducer: %[5]v Bisection is inconclusive: the first bad commit could be any of: -11111111 kernel: break build -22222222 kernel: now add a bug to the broken build +111111111111 kernel: break build +222222222222 kernel: now add a bug to the broken build bisection log: %[6]v @@ -701,7 +701,7 @@ func TestBisectCauseAncient(t *testing.T) { c.expectEQ(msg.Body, fmt.Sprintf(`Bisection is inconclusive: the issue happens on the oldest tested release. bisection log: %[2]v -oldest commit: 11111111 kernel_commit_title1 +oldest commit: 111111111111 kernel_commit_title1 git tree: repo1 branch1 final oops: %[3]v console output: %[4]v @@ -729,7 +729,7 @@ For information about bisection process see: https://goo.gl/tpsmEJ#bisection syzbot found the following issue on: -HEAD commit: 11111111 kernel_commit_title1 +HEAD commit: 111111111111 kernel_commit_title1 git tree: repo1 branch1 console output: %[2]v kernel config: %[3]v diff --git a/dashboard/app/email_test.go b/dashboard/app/email_test.go index 3b6028f42..7f2d3ee36 100644 --- a/dashboard/app/email_test.go +++ b/dashboard/app/email_test.go @@ -49,7 +49,7 @@ func TestEmailReport(t *testing.T) { syzbot found the following issue on: -HEAD commit: 11111111 kernel_commit_title1 +HEAD commit: 111111111111 kernel_commit_title1 git tree: repo1 branch1 console output: %[2]v kernel config: %[3]v @@ -158,7 +158,7 @@ For more options, visit https://groups.google.com/d/optout. c.expectEQ(msg.Headers["In-Reply-To"], []string{"<1234>"}) c.expectEQ(msg.Body, fmt.Sprintf(`syzbot has found a reproducer for the following issue on: -HEAD commit: 10101010 a really long title, longer than 80 chars, really.. +HEAD commit: 101010101010 a really long title, longer than 80 chars, re.. git tree: repo10alias console output: %[3]v kernel config: %[4]v @@ -209,7 +209,7 @@ report1 syzbot found the following issue on: -HEAD commit: 10101010 a really long title, longer than 80 chars, really.. +HEAD commit: 101010101010 a really long title, longer than 80 chars, re.. git tree: repo10alias console output: %[3]v kernel config: %[4]v @@ -281,7 +281,7 @@ Content-Type: text/plain c.expectEQ(len(msg.Attachments), 0) c.expectEQ(msg.Body, fmt.Sprintf(`syzbot has found a reproducer for the following issue on: -HEAD commit: 10101010 a really long title, longer than 80 chars, really.. +HEAD commit: 101010101010 a really long title, longer than 80 chars, re.. git tree: repo10alias console output: %[4]v kernel config: %[5]v diff --git a/dashboard/app/mail_bisect_result.txt b/dashboard/app/mail_bisect_result.txt index 4ec27d854..2f95a5741 100644 --- a/dashboard/app/mail_bisect_result.txt +++ b/dashboard/app/mail_bisect_result.txt @@ -8,11 +8,11 @@ Date: {{formatKernelTime $bisect.Commit.Date}} {{$bisect.Commit.Title}} {{else if $bisect.Commits}}Bisection is inconclusive: the {{if $bisect.Fix}}fix{{else}}first bad{{end}} commit could be any of: {{range $com := $bisect.Commits}} -{{formatShortHash $com.Hash}} {{$com.Title}}{{end}} +{{formatTagHash $com.Hash}} {{$com.Title}}{{end}} {{else}}Bisection is inconclusive: the issue happens on the {{if $bisect.Fix}}latest{{else}}oldest{{end}} tested release. {{end}} bisection log: {{$bisect.LogLink}} -{{if $bisect.Commit}}start commit: {{else if $bisect.Commits}}start commit: {{else}}{{if $bisect.Fix}}latest commit: {{else}}oldest commit: {{end}}{{end}}{{formatShortHash $br.KernelCommit}} {{formatCommitTableTitle $br.KernelCommitTitle}} +{{if $bisect.Commit}}start commit: {{else if $bisect.Commits}}start commit: {{else}}{{if $bisect.Fix}}latest commit: {{else}}oldest commit: {{end}}{{end}}{{formatTagHash $br.KernelCommit}} {{formatCommitTableTitle $br.KernelCommitTitle}} git tree: {{$br.KernelRepoAlias}} {{if $bisect.CrashReportLink}}final oops: {{$bisect.CrashReportLink}} {{end}}{{if $bisect.CrashLogLink}}console output: {{$bisect.CrashLogLink}} diff --git a/dashboard/app/mail_bug.txt b/dashboard/app/mail_bug.txt index 47a06348e..0fcc0529f 100644 --- a/dashboard/app/mail_bug.txt +++ b/dashboard/app/mail_bug.txt @@ -4,7 +4,7 @@ Hello, {{end -}} syzbot {{if .First}}found{{else}}has found a reproducer for{{end}} the following issue on: -HEAD commit: {{formatShortHash .KernelCommit}} {{formatCommitTableTitle .KernelCommitTitle}} +HEAD commit: {{formatTagHash .KernelCommit}} {{formatCommitTableTitle .KernelCommitTitle}} git tree: {{.KernelRepoAlias}} {{if .LogLink}}console output: {{.LogLink}} {{end}}{{if .KernelConfigLink}}kernel config: {{.KernelConfigLink}} @@ -26,7 +26,7 @@ Date: {{formatKernelTime .BisectCause.Commit.Date}} {{.BisectCause.Commit.Title}} {{else if .BisectCause.Commits}}Bisection is inconclusive: the first bad commit could be any of: {{range $com := .BisectCause.Commits}} -{{formatShortHash $com.Hash}} {{$com.Title}}{{end}} +{{formatTagHash $com.Hash}} {{$com.Title}}{{end}} {{else}}Bisection is inconclusive: the issue happens on the oldest tested release. {{end}} bisection log: {{.BisectCause.LogLink}} diff --git a/dashboard/app/templates.html b/dashboard/app/templates.html index dc9e8869d..0748aab71 100644 --- a/dashboard/app/templates.html +++ b/dashboard/app/templates.html @@ -213,7 +213,7 @@ Use of this source code is governed by Apache 2 LICENSE that can be found in the {{formatStat $mgr.TotalExecs}} {{end}} {{with $build := $mgr.CurrentBuild}} - {{link $build.KernelCommitLink (formatShortHash $build.KernelCommit)}} + {{link $build.KernelCommitLink (formatTagHash $build.KernelCommit)}} {{formatLateness $mgr.Now $build.KernelCommitDate}} {{if $mgr.FailedBuildBugLink}}failing{{end}} {{link $build.SyzkallerCommitLink (formatShortHash $build.SyzkallerCommit)}} @@ -239,7 +239,7 @@ Use of this source code is governed by Apache 2 LICENSE that can be found in the {{range $com := .}} {{if $com.Hash}} - {{formatShortHash $com.Hash}} + {{formatTagHash $com.Hash}} {{end}} {{link $com.Link $com.Title}} @@ -334,7 +334,7 @@ Use of this source code is governed by Apache 2 LICENSE that can be found in the {{formatTime $b.Time}} {{$b.KernelAlias}} {{link $b.KernelCommitLink (formatShortHash $b.KernelCommit)}} + {{formatTime $b.KernelCommitDate}}">{{link $b.KernelCommitLink (formatTagHash $b.KernelCommit)}} {{link $b.SyzkallerCommitLink (formatShortHash $b.SyzkallerCommit)}} {{if $b.KernelConfigLink}}.config{{end}} {{if $b.LogLink}}log{{end}} diff --git a/pkg/html/html.go b/pkg/html/html.go index 6f3779261..6d24ba7e7 100644 --- a/pkg/html/html.go +++ b/pkg/html/html.go @@ -170,7 +170,7 @@ func formatTagHash(v string) string { func formatCommitTableTitle(v string) string { // This function is very specific to how we format tables in text emails. // Truncate commit title so that whole line fits into 78 chars. - const commitTitleLen = 51 + const commitTitleLen = 47 if len(v) <= commitTitleLen { return v } diff --git a/syz-manager/html.go b/syz-manager/html.go index 46c062752..449061a69 100644 --- a/syz-manager/html.go +++ b/syz-manager/html.go @@ -803,7 +803,7 @@ Report: {{.Triaged}} {{end}} {{formatTime $c.Time}} - {{formatShortHash $c.Tag}} + {{formatTagHash $c.Tag}} {{end}} -- cgit mrf-deployment