aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2022-04-19 12:21:48 +0000
committerAleksandr Nogikh <wp32pw@gmail.com>2022-04-29 17:16:33 +0200
commit316eb530e5b1c0c0dacd5e17f52fd315a48fd970 (patch)
treee177dfe4403b92831a39d5b4a4aff36050e432fc
parent2d51d57a71659b063ddcb21cc50845d05d39708b (diff)
dashboard: remember and display strace flag
Receive the information, whether the crash log contains strace output, from the syz-manager. Adjust bug reporting email depending on that flag.
-rw-r--r--dashboard/app/api.go1
-rw-r--r--dashboard/app/email_test.go49
-rw-r--r--dashboard/app/entities.go1
-rw-r--r--dashboard/app/mail_bug.txt2
-rw-r--r--dashboard/app/reporting.go1
-rw-r--r--dashboard/app/reporting_test.go2
-rw-r--r--dashboard/dashapi/dashapi.go8
-rw-r--r--syz-manager/manager.go4
8 files changed, 67 insertions, 1 deletions
diff --git a/dashboard/app/api.go b/dashboard/app/api.go
index 606881e8d..e2ee8ab7a 100644
--- a/dashboard/app/api.go
+++ b/dashboard/app/api.go
@@ -784,6 +784,7 @@ func saveCrash(c context.Context, ns string, req *dashapi.Crash, bug *Bug, bugKe
GetEmails(req.Recipients, dashapi.Cc)),
ReproOpts: req.ReproOpts,
ReportLen: prio,
+ Flags: int64(req.Flags),
}
var err error
if crash.Log, err = putText(c, ns, textCrashLog, req.Log, false); err != nil {
diff --git a/dashboard/app/email_test.go b/dashboard/app/email_test.go
index 53696aa14..7c946d543 100644
--- a/dashboard/app/email_test.go
+++ b/dashboard/app/email_test.go
@@ -771,3 +771,52 @@ func TestEmailManagerCC(t *testing.T) {
"default@maintainers.com",
})
}
+
+func TestStraceReport(t *testing.T) {
+ c := NewCtx(t)
+ defer c.Close()
+
+ build := testBuild(1)
+ c.client2.UploadBuild(build)
+
+ crash := testCrash(build, 1)
+ crash.Flags = dashapi.CrashUnderStrace
+ crash.Maintainers = []string{`"Foo Bar" <foo@bar.com>`, `bar@foo.com`, `idont@want.EMAILS`}
+ c.client2.ReportCrash(crash)
+
+ // Report the crash over email and check all fields.
+ msg := c.pollEmailBug()
+ _, extBugID, err := email.RemoveAddrContext(msg.Sender)
+ c.expectOK(err)
+ _, dbCrash, dbBuild := c.loadBug(extBugID)
+ crashLogLink := externalLink(c.ctx, textCrashLog, dbCrash.Log)
+ kernelConfigLink := externalLink(c.ctx, textKernelConfig, dbBuild.KernelConfig)
+ c.expectEQ(msg.Body, fmt.Sprintf(`Hello,
+
+syzbot found the following issue on:
+
+HEAD commit: 111111111111 kernel_commit_title1
+git tree: repo1 branch1
+console+strace: %[2]v
+kernel config: %[3]v
+dashboard link: https://testapp.appspot.com/bug?extid=%[1]v
+compiler: compiler1
+CC: [bar@foo.com foo@bar.com idont@want.EMAILS]
+
+Unfortunately, I don't have any reproducer for this issue yet.
+
+IMPORTANT: if you fix the issue, please add the following tag to the commit:
+Reported-by: syzbot+%[1]v@testapp.appspotmail.com
+
+report1
+
+---
+This report is generated by a bot. It may contain errors.
+See https://goo.gl/tpsmEJ for more information about syzbot.
+syzbot engineers can be reached at syzkaller@googlegroups.com.
+
+syzbot will keep track of this issue. See:
+https://goo.gl/tpsmEJ#status for how to communicate with syzbot.`,
+ extBugID, crashLogLink, kernelConfigLink))
+ c.checkURLContents(crashLogLink, crash.Log)
+}
diff --git a/dashboard/app/entities.go b/dashboard/app/entities.go
index d1c9cdf3b..7df17690f 100644
--- a/dashboard/app/entities.go
+++ b/dashboard/app/entities.go
@@ -143,6 +143,7 @@ type Crash struct {
Reported time.Time // set if this crash was ever reported
Maintainers []string `datastore:",noindex"`
Log int64 // reference to CrashLog text entity
+ Flags int64 // properties of the Crash
Report int64 // reference to CrashReport text entity
ReproOpts []byte `datastore:",noindex"`
ReproSyz int64 // reference to ReproSyz text entity
diff --git a/dashboard/app/mail_bug.txt b/dashboard/app/mail_bug.txt
index 0fcc0529f..c2b2e652d 100644
--- a/dashboard/app/mail_bug.txt
+++ b/dashboard/app/mail_bug.txt
@@ -6,7 +6,7 @@ syzbot {{if .First}}found{{else}}has found a reproducer for{{end}} the following
HEAD commit: {{formatTagHash .KernelCommit}} {{formatCommitTableTitle .KernelCommitTitle}}
git tree: {{.KernelRepoAlias}}
-{{if .LogLink}}console output: {{.LogLink}}
+{{if .LogLink}}{{if .LogHasStrace}}console+strace{{else}}console output{{end}}: {{.LogLink}}
{{end}}{{if .KernelConfigLink}}kernel config: {{.KernelConfigLink}}
{{end}}dashboard link: {{.Link}}
{{if .CompilerID}}compiler: {{.CompilerID}}
diff --git a/dashboard/app/reporting.go b/dashboard/app/reporting.go
index 03220818b..d9dae7e13 100644
--- a/dashboard/app/reporting.go
+++ b/dashboard/app/reporting.go
@@ -427,6 +427,7 @@ func createBugReport(c context.Context, bug *Bug, crash *Crash, crashKey *db.Key
Moderation: reporting.moderation,
Log: crashLog,
LogLink: externalLink(c, textCrashLog, crash.Log),
+ LogHasStrace: dashapi.CrashFlags(crash.Flags)&dashapi.CrashUnderStrace > 0,
Report: report,
ReportLink: externalLink(c, textCrashReport, crash.Report),
CC: kernelRepo.CC.Always,
diff --git a/dashboard/app/reporting_test.go b/dashboard/app/reporting_test.go
index 453dbb1c7..a53114171 100644
--- a/dashboard/app/reporting_test.go
+++ b/dashboard/app/reporting_test.go
@@ -26,6 +26,7 @@ func TestReportBug(t *testing.T) {
Title: "title1",
Maintainers: []string{`"Foo Bar" <foo@bar.com>`, `bar@foo.com`},
Log: []byte("log1"),
+ Flags: dashapi.CrashUnderStrace,
Report: []byte("report1"),
MachineInfo: []byte("machine info 1"),
}
@@ -72,6 +73,7 @@ func TestReportBug(t *testing.T) {
MachineInfoLink: externalLink(c.ctx, textMachineInfo, dbCrash.MachineInfo),
Log: []byte("log1"),
LogLink: externalLink(c.ctx, textCrashLog, dbCrash.Log),
+ LogHasStrace: true,
Report: []byte("report1"),
ReportLink: externalLink(c.ctx, textCrashReport, dbCrash.Report),
ReproOpts: []uint8{},
diff --git a/dashboard/dashapi/dashapi.go b/dashboard/dashapi/dashapi.go
index a78e25073..bcd964852 100644
--- a/dashboard/dashapi/dashapi.go
+++ b/dashboard/dashapi/dashapi.go
@@ -251,6 +251,12 @@ func (dash *Dashboard) UploadCommits(commits []Commit) error {
return dash.Query("upload_commits", &CommitPollResultReq{commits}, nil)
}
+type CrashFlags int64
+
+const (
+ CrashUnderStrace CrashFlags = 1 << iota
+)
+
// Crash describes a single kernel crash (potentially with repro).
type Crash struct {
BuildID string // refers to Build.ID
@@ -261,6 +267,7 @@ type Crash struct {
Maintainers []string // deprecated in favor of Recipients
Recipients Recipients
Log []byte
+ Flags CrashFlags
Report []byte
MachineInfo []byte
// The following is optional and is filled only after repro.
@@ -355,6 +362,7 @@ type BugReport struct {
SyzkallerCommit string
Log []byte
LogLink string
+ LogHasStrace bool
Report []byte
ReportLink string
ReproC []byte
diff --git a/syz-manager/manager.go b/syz-manager/manager.go
index adc4b2556..de7b43d5e 100644
--- a/syz-manager/manager.go
+++ b/syz-manager/manager.go
@@ -1032,11 +1032,14 @@ func (mgr *Manager) saveRepro(res *ReproResult) {
report := repro.Report
output := report.Output
+
+ var crashFlags dashapi.CrashFlags
if res.strace != nil {
// If syzkaller managed to successfully run the repro with strace, send
// the report and the output generated under strace.
report = res.strace.Report
output = res.strace.Output
+ crashFlags = dashapi.CrashUnderStrace
}
dc := &dashapi.Crash{
BuildID: mgr.cfg.Tag,
@@ -1045,6 +1048,7 @@ func (mgr *Manager) saveRepro(res *ReproResult) {
Suppressed: report.Suppressed,
Recipients: report.Recipients.ToDash(),
Log: output,
+ Flags: crashFlags,
Report: report.Report,
ReproOpts: repro.Opts.Serialize(),
ReproSyz: repro.Prog.Serialize(),