diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-11-14 10:04:22 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-11-14 10:04:22 +0100 |
| commit | 4bd78cef058ec8782ed0a8b4f2596f4748dbb575 (patch) | |
| tree | d6c7341926279c281a6af40b0640de0c2f284182 | |
| parent | 82b3b903a0c96c6867b6ca22f27f58d2633323f7 (diff) | |
pkg/report, pkg/repro, syz-manager: name crash attributes consistently
We currently have several names for crash attributes, which is disturbing.
E.g. crash title is called "Title" or "Desc". Name them consistently.
Title - single line bug identity.
Report - whole crash text.
Log - whole fuzzer/kernel output.
| -rw-r--r-- | pkg/report/freebsd.go | 12 | ||||
| -rw-r--r-- | pkg/report/linux.go | 30 | ||||
| -rw-r--r-- | pkg/report/linux_test.go | 24 | ||||
| -rw-r--r-- | pkg/report/report.go | 14 | ||||
| -rw-r--r-- | pkg/report/report_test.go | 20 | ||||
| -rw-r--r-- | pkg/repro/repro.go | 26 | ||||
| -rw-r--r-- | syz-manager/manager.go | 66 | ||||
| -rw-r--r-- | tools/syz-crush/crush.go | 6 | ||||
| -rw-r--r-- | tools/syz-symbolize/symbolize.go | 4 | ||||
| -rw-r--r-- | vm/vm.go | 8 |
10 files changed, 105 insertions, 105 deletions
diff --git a/pkg/report/freebsd.go b/pkg/report/freebsd.go index 70ffd2249..544ee68c0 100644 --- a/pkg/report/freebsd.go +++ b/pkg/report/freebsd.go @@ -50,10 +50,10 @@ func (ctx *freebsd) Parse(output []byte) *Report { } if oops == nil { oops = oops1 - rep.Start = pos - rep.Desc = string(output[pos+match : next]) + rep.StartPos = pos + rep.Title = string(output[pos+match : next]) } - rep.End = next + rep.EndPos = next } // Console output is indistinguishable from fuzzer output, // so we just collect everything after the oops. @@ -62,15 +62,15 @@ func (ctx *freebsd) Parse(output []byte) *Report { if lineEnd != 0 && output[lineEnd-1] == '\r' { lineEnd-- } - rep.Text = append(rep.Text, output[pos:lineEnd]...) - rep.Text = append(rep.Text, '\n') + rep.Report = append(rep.Report, output[pos:lineEnd]...) + rep.Report = append(rep.Report, '\n') } pos = next + 1 } if oops == nil { return nil } - rep.Desc = extractDescription(output[rep.Start:], oops) + rep.Title = extractDescription(output[rep.StartPos:], oops) return rep } diff --git a/pkg/report/linux.go b/pkg/report/linux.go index 8a137d9b6..3c7596eb5 100644 --- a/pkg/report/linux.go +++ b/pkg/report/linux.go @@ -95,10 +95,10 @@ func (ctx *linux) Parse(output []byte) *Report { } if oops == nil { oops = oops1 - rep.Start = pos - rep.Desc = string(output[pos+match : next]) + rep.StartPos = pos + rep.Title = string(output[pos+match : next]) } - rep.End = next + rep.EndPos = next } if ctx.consoleOutputRe.Match(output[pos:next]) && (!ctx.questionableRe.Match(output[pos:next]) || @@ -117,8 +117,8 @@ func (ctx *linux) Parse(output []byte) *Report { // Prepend 5 lines preceding start of the report, // they can contain additional info related to the report. for _, prefix := range textPrefix { - rep.Text = append(rep.Text, prefix...) - rep.Text = append(rep.Text, '\n') + rep.Report = append(rep.Report, prefix...) + rep.Report = append(rep.Report, '\n') } textPrefix = nil textLines++ @@ -140,8 +140,8 @@ func (ctx *linux) Parse(output []byte) *Report { skipLine = true } if !skipLine { - rep.Text = append(rep.Text, ln...) - rep.Text = append(rep.Text, '\n') + rep.Report = append(rep.Report, ln...) + rep.Report = append(rep.Report, '\n') } } } @@ -150,22 +150,22 @@ func (ctx *linux) Parse(output []byte) *Report { if oops == nil { return nil } - rep.Desc = extractDescription(output[rep.Start:], oops) + rep.Title = extractDescription(output[rep.StartPos:], oops) // Executor PIDs are not interesting. - rep.Desc = executorRe.ReplaceAllLiteralString(rep.Desc, "syz-executor") + rep.Title = executorRe.ReplaceAllLiteralString(rep.Title, "syz-executor") // Replace that everything looks like an address with "ADDR", // addresses in descriptions can't be good regardless of the oops regexps. - rep.Desc = addrRe.ReplaceAllLiteralString(rep.Desc, "ADDR") + rep.Title = addrRe.ReplaceAllLiteralString(rep.Title, "ADDR") // Replace that everything looks like a decimal number with "NUM". - rep.Desc = decNumRe.ReplaceAllLiteralString(rep.Desc, "NUM") + rep.Title = decNumRe.ReplaceAllLiteralString(rep.Title, "NUM") // Replace that everything looks like a file line number with "LINE". - rep.Desc = lineNumRe.ReplaceAllLiteralString(rep.Desc, ":LINE") + rep.Title = lineNumRe.ReplaceAllLiteralString(rep.Title, ":LINE") // Replace all raw references to runctions (e.g. "ip6_fragment+0x1052/0x2d80") // with just function name ("ip6_fragment"). Offsets and sizes are not stable. - rep.Desc = funcRe.ReplaceAllString(rep.Desc, "$1") + rep.Title = funcRe.ReplaceAllString(rep.Title, "$1") // CPU numbers are not interesting. - rep.Desc = cpuRe.ReplaceAllLiteralString(rep.Desc, "CPU") - rep.Corrupted = ctx.isCorrupted(rep.Desc, string(rep.Text)) + rep.Title = cpuRe.ReplaceAllLiteralString(rep.Title, "CPU") + rep.Corrupted = ctx.isCorrupted(rep.Title, string(rep.Report)) return rep } diff --git a/pkg/report/linux_test.go b/pkg/report/linux_test.go index e957ad40e..ffc6d04b7 100644 --- a/pkg/report/linux_test.go +++ b/pkg/report/linux_test.go @@ -1253,29 +1253,29 @@ func TestLinuxIgnores(t *testing.T) { if !reporter.ContainsCrash([]byte(log)) { t.Fatalf("no crash") } - if rep := reporter.Parse([]byte(log)); rep.Desc != "BUG: bug1" { - t.Fatalf("want `BUG: bug1`, found `%v`", rep.Desc) + if rep := reporter.Parse([]byte(log)); rep.Title != "BUG: bug1" { + t.Fatalf("want `BUG: bug1`, found `%v`", rep.Title) } if !reporter1.ContainsCrash([]byte(log)) { t.Fatalf("no crash") } - if rep := reporter1.Parse([]byte(log)); rep.Desc != "BUG: bug1" { - t.Fatalf("want `BUG: bug1`, found `%v`", rep.Desc) + if rep := reporter1.Parse([]byte(log)); rep.Title != "BUG: bug1" { + t.Fatalf("want `BUG: bug1`, found `%v`", rep.Title) } if !reporter2.ContainsCrash([]byte(log)) { t.Fatalf("no crash") } - if rep := reporter2.Parse([]byte(log)); rep.Desc != "BUG: bug2" { - t.Fatalf("want `BUG: bug2`, found `%v`", rep.Desc) + if rep := reporter2.Parse([]byte(log)); rep.Title != "BUG: bug2" { + t.Fatalf("want `BUG: bug2`, found `%v`", rep.Title) } if reporter3.ContainsCrash([]byte(log)) { t.Fatalf("found crash, should be ignored") } if rep := reporter3.Parse([]byte(log)); rep != nil { - t.Fatalf("found `%v`, should be ignored", rep.Desc) + t.Fatalf("found `%v`, should be ignored", rep.Title) } } @@ -1328,11 +1328,11 @@ Read of size 4 by task syz-executor2/5764 t.Fatal(err) } for log, text0 := range tests { - if rep := reporter.Parse([]byte(log)); string(rep.Text) != text0 { + if rep := reporter.Parse([]byte(log)); string(rep.Report) != text0 { t.Logf("log:\n%s", log) t.Logf("want text:\n%s", text0) - t.Logf("got text:\n%s", rep.Text) - t.Fatalf("bad text, desc: '%v'", rep.Desc) + t.Logf("got text:\n%s", rep.Report) + t.Fatalf("bad text, desc: '%v'", rep.Title) } } } @@ -1497,9 +1497,9 @@ func TestLinuxParseReport(t *testing.T) { for i, test := range parseReportTests { t.Run(fmt.Sprint(i), func(t *testing.T) { rep := reporter.Parse([]byte(test.in)) - if test.out != string(rep.Text) { + if test.out != string(rep.Report) { t.Logf("expect:\n%v", test.out) - t.Logf("got:\n%v", string(rep.Text)) + t.Logf("got:\n%v", string(rep.Report)) t.Fail() } }) diff --git a/pkg/report/report.go b/pkg/report/report.go index efc1623bd..403f7bc76 100644 --- a/pkg/report/report.go +++ b/pkg/report/report.go @@ -30,13 +30,13 @@ type Reporter interface { } type Report struct { - // Desc contains a representative description of the first oops. - Desc string - // Text contains whole oops text. - Text []byte - // Start and End denote region of output with oops message(s). - Start int - End int + // Title contains a representative description of the first oops. + Title string + // Report contains whole oops text. + Report []byte + // StartPos/EndPos denote region of output with oops message(s). + StartPos int + EndPos int // Corrupted indicates whether the report is truncated of corrupted in some other way. Corrupted bool } diff --git a/pkg/report/report_test.go b/pkg/report/report_test.go index 6802d0772..98a7725ac 100644 --- a/pkg/report/report_test.go +++ b/pkg/report/report_test.go @@ -69,28 +69,28 @@ func testParse(t *testing.T, os string, tests []ParseTest) { if !expectCrash && containsCrash { t.Fatalf("ContainsCrash found unexpected crash:\n%v", test.Log) } - if rep != nil && rep.Desc == "" { + if rep != nil && rep.Title == "" { t.Fatalf("found crash, but title is empty '%v' in:\n%v", test.Desc, test.Log) } - desc, corrupted := "", false + title, corrupted := "", false if rep != nil { - desc = rep.Desc + title = rep.Title corrupted = rep.Corrupted } - if desc == "" && test.Desc != "" { + if title == "" && test.Desc != "" { t.Fatalf("did not find crash message '%v' in:\n%v", test.Desc, test.Log) } - if desc != "" && test.Desc == "" { - t.Fatalf("found bogus crash message '%v' in:\n%v", desc, test.Log) + if title != "" && test.Desc == "" { + t.Fatalf("found bogus crash message '%v' in:\n%v", title, test.Log) } - if desc != test.Desc { - t.Fatalf("extracted bad crash message:\n%+q\nwant:\n%+q", desc, test.Desc) + if title != test.Desc { + t.Fatalf("extracted bad crash message:\n%+q\nwant:\n%+q", title, test.Desc) } if corrupted && !test.Corrupted { - t.Fatalf("incorrectly marked report as corrupted: '%v'\n%v", desc, test.Log) + t.Fatalf("incorrectly marked report as corrupted: '%v'\n%v", title, test.Log) } if !corrupted && test.Corrupted { - t.Fatalf("failed to mark report as corrupted: '%v'\n%v", desc, test.Log) + t.Fatalf("failed to mark report as corrupted: '%v'\n%v", title, test.Log) } } } diff --git a/pkg/repro/repro.go b/pkg/repro/repro.go index 5575d7768..11f0cccaf 100644 --- a/pkg/repro/repro.go +++ b/pkg/repro/repro.go @@ -35,9 +35,9 @@ type Result struct { Opts csource.Options CRepro bool Stats Stats - // Description, log and report of the final crash that we reproduced. + // Title, Log and Report of the final crash that we reproduced. // Can be different from what we started reproducing. - Desc string + Title string Log []byte Report []byte } @@ -45,11 +45,11 @@ type Result struct { type context struct { cfg *mgrconfig.Config reporter report.Reporter - crashDesc string + crashTitle string instances chan *instance bootRequests chan int stats Stats - desc string + title string log []byte report []byte } @@ -75,16 +75,16 @@ func Run(crashLog []byte, cfg *mgrconfig.Config, reporter report.Reporter, vmPoo return nil, fmt.Errorf("crash log does not contain any programs") } crashStart := len(crashLog) // assuming VM hanged - crashDesc := "hang" + crashTitle := "hang" if rep := reporter.Parse(crashLog); rep != nil { - crashStart = rep.Start - crashDesc = rep.Desc + crashStart = rep.StartPos + crashTitle = rep.Title } ctx := &context{ cfg: cfg, reporter: reporter, - crashDesc: crashDesc, + crashTitle: crashTitle, instances: make(chan *instance, len(vmIndexes)), bootRequests: make(chan int, len(vmIndexes)), } @@ -153,7 +153,7 @@ func Run(crashLog []byte, cfg *mgrconfig.Config, reporter report.Reporter, vmPoo if res != nil { ctx.reproLog(3, "repro crashed as:\n%s", string(ctx.report)) res.Stats = ctx.stats - res.Desc = ctx.desc + res.Title = ctx.title res.Log = ctx.log res.Report = ctx.report } @@ -595,15 +595,15 @@ func (ctx *context) testImpl(inst *vm.Instance, command string, duration time.Du if err != nil { return false, fmt.Errorf("failed to run command in VM: %v", err) } - desc, report, output, crashed, _ := vm.MonitorExecution(outc, errc, ctx.reporter) + title, report, output, crashed, _ := vm.MonitorExecution(outc, errc, ctx.reporter) if !crashed { ctx.reproLog(2, "program did not crash") return false, nil } - ctx.desc = desc + ctx.title = title ctx.log = output ctx.report = report - ctx.reproLog(2, "program crashed: %v", desc) + ctx.reproLog(2, "program crashed: %v", title) return true, nil } @@ -613,7 +613,7 @@ func (ctx *context) returnInstance(inst *instance) { } func (ctx *context) reproLog(level int, format string, args ...interface{}) { - prefix := fmt.Sprintf("reproducing crash '%v': ", ctx.crashDesc) + prefix := fmt.Sprintf("reproducing crash '%v': ", ctx.crashTitle) Logf(level, prefix+format, args...) ctx.stats.Log = append(ctx.stats.Log, []byte(fmt.Sprintf(format, args...)+"\n")...) } diff --git a/syz-manager/manager.go b/syz-manager/manager.go index 31df5d2eb..d32cf7b48 100644 --- a/syz-manager/manager.go +++ b/syz-manager/manager.go @@ -109,7 +109,7 @@ type Fuzzer struct { type Crash struct { vmIndex int hub bool // this crash was created based on a repro from hub - desc string + title string report []byte log []byte } @@ -339,7 +339,7 @@ type RunResult struct { type ReproResult struct { instances []int - desc0 string + title0 string res *repro.Result err error hub bool // repro came from hub @@ -371,19 +371,19 @@ func (mgr *Manager) vmLoop() { mgr.mu.Unlock() for crash := range pendingRepro { - if reproducing[crash.desc] { + if reproducing[crash.title] { continue } delete(pendingRepro, crash) if !crash.hub { if mgr.dash == nil { - if !mgr.needRepro(crash.desc) { + if !mgr.needRepro(crash.title) { continue } } else { cid := &dashapi.CrashID{ BuildID: mgr.cfg.Tag, - Title: crash.desc, + Title: crash.title, } needRepro, err := mgr.dash.NeedRepro(cid) if err != nil { @@ -394,8 +394,8 @@ func (mgr *Manager) vmLoop() { } } } - Logf(1, "loop: add to repro queue '%v'", crash.desc) - reproducing[crash.desc] = true + Logf(1, "loop: add to repro queue '%v'", crash.title) + reproducing[crash.title] = true reproQueue = append(reproQueue, crash) } @@ -422,10 +422,10 @@ func (mgr *Manager) vmLoop() { instances = instances[:len(instances)-instancesPerRepro] reproInstances += instancesPerRepro atomic.AddUint32(&mgr.numReproducing, 1) - Logf(1, "loop: starting repro of '%v' on instances %+v", crash.desc, vmIndexes) + Logf(1, "loop: starting repro of '%v' on instances %+v", crash.title, vmIndexes) go func() { res, err := repro.Run(crash.log, mgr.cfg, mgr.getReporter(), mgr.vmPool, vmIndexes) - reproDone <- &ReproResult{vmIndexes, crash.desc, res, err, crash.hub} + reproDone <- &ReproResult{vmIndexes, crash.title, res, err, crash.hub} }() } for !canRepro() && len(instances) != 0 { @@ -461,29 +461,29 @@ func (mgr *Manager) vmLoop() { if shutdown != nil && res.crash != nil && !mgr.isSuppressed(res.crash) { needRepro := mgr.saveCrash(res.crash) if needRepro { - Logf(1, "loop: add pending repro for '%v'", res.crash.desc) + Logf(1, "loop: add pending repro for '%v'", res.crash.title) pendingRepro[res.crash] = true } } case res := <-reproDone: atomic.AddUint32(&mgr.numReproducing, ^uint32(0)) crepro := false - desc := "" + title := "" if res.res != nil { crepro = res.res.CRepro - desc = res.res.Desc + title = res.res.Title } Logf(1, "loop: repro on %+v finished '%v', repro=%v crepro=%v desc='%v'", - res.instances, res.desc0, res.res != nil, crepro, desc) + res.instances, res.title0, res.res != nil, crepro, title) if res.err != nil { Logf(0, "repro failed: %v", res.err) } - delete(reproducing, res.desc0) + delete(reproducing, res.title0) instances = append(instances, res.instances...) reproInstances -= instancesPerRepro if res.res == nil { if !res.hub { - mgr.saveFailedRepro(res.desc0) + mgr.saveFailedRepro(res.title0) } } else { mgr.saveRepro(res.res, res.hub) @@ -544,21 +544,21 @@ func (mgr *Manager) runInstance(index int) (*Crash, error) { return nil, fmt.Errorf("failed to run fuzzer: %v", err) } - desc, text, output, crashed, timedout := vm.MonitorExecution(outc, errc, mgr.getReporter()) + title, report, output, crashed, timedout := vm.MonitorExecution(outc, errc, mgr.getReporter()) if timedout { // This is the only "OK" outcome. - Logf(0, "vm-%v: running for %v, restarting (%v)", index, time.Since(start), desc) + Logf(0, "vm-%v: running for %v, restarting (%v)", index, time.Since(start), title) return nil, nil } if !crashed { // syz-fuzzer exited, but it should not. - desc = "lost connection to test machine" + title = "lost connection to test machine" } cash := &Crash{ vmIndex: index, hub: false, - desc: desc, - report: text, + title: title, + report: report, log: output, } return cash, nil @@ -569,7 +569,7 @@ func (mgr *Manager) isSuppressed(crash *Crash) bool { if !re.Match(crash.log) { continue } - Logf(1, "vm-%v: suppressing '%v' with '%v'", crash.vmIndex, crash.desc, re.String()) + Logf(1, "vm-%v: suppressing '%v' with '%v'", crash.vmIndex, crash.title, re.String()) mgr.mu.Lock() mgr.stats["suppressed"]++ mgr.mu.Unlock() @@ -579,11 +579,11 @@ func (mgr *Manager) isSuppressed(crash *Crash) bool { } func (mgr *Manager) saveCrash(crash *Crash) bool { - Logf(0, "vm-%v: crash: %v", crash.vmIndex, crash.desc) + Logf(0, "vm-%v: crash: %v", crash.vmIndex, crash.title) mgr.mu.Lock() mgr.stats["crashes"]++ - if !mgr.crashTypes[crash.desc] { - mgr.crashTypes[crash.desc] = true + if !mgr.crashTypes[crash.title] { + mgr.crashTypes[crash.title] = true mgr.stats["crash types"]++ } mgr.mu.Unlock() @@ -601,7 +601,7 @@ func (mgr *Manager) saveCrash(crash *Crash) bool { } dc := &dashapi.Crash{ BuildID: mgr.cfg.Tag, - Title: crash.desc, + Title: crash.title, Maintainers: maintainers, Log: crash.log, Report: crash.report, @@ -616,11 +616,11 @@ func (mgr *Manager) saveCrash(crash *Crash) bool { } } - sig := hash.Hash([]byte(crash.desc)) + sig := hash.Hash([]byte(crash.title)) id := sig.String() dir := filepath.Join(mgr.crashdir, id) osutil.MkdirAll(dir) - if err := osutil.WriteFile(filepath.Join(dir, "description"), []byte(crash.desc+"\n")); err != nil { + if err := osutil.WriteFile(filepath.Join(dir, "description"), []byte(crash.title+"\n")); err != nil { Logf(0, "failed to write crash: %v", err) } // Save up to 100 reports. If we already have 100, overwrite the oldest one. @@ -647,7 +647,7 @@ func (mgr *Manager) saveCrash(crash *Crash) bool { osutil.WriteFile(filepath.Join(dir, fmt.Sprintf("report%v", oldestI)), crash.report) } - return mgr.needRepro(crash.desc) + return mgr.needRepro(crash.title) } const maxReproAttempts = 3 @@ -692,10 +692,10 @@ func (mgr *Manager) saveFailedRepro(desc string) { func (mgr *Manager) saveRepro(res *repro.Result, hub bool) { res.Report = mgr.symbolizeReport(res.Report) - dir := filepath.Join(mgr.crashdir, hash.String([]byte(res.Desc))) + dir := filepath.Join(mgr.crashdir, hash.String([]byte(res.Title))) osutil.MkdirAll(dir) - if err := osutil.WriteFile(filepath.Join(dir, "description"), []byte(res.Desc+"\n")); err != nil { + if err := osutil.WriteFile(filepath.Join(dir, "description"), []byte(res.Title+"\n")); err != nil { Logf(0, "failed to write crash: %v", err) } opts := fmt.Sprintf("# %+v\n", res.Opts) @@ -732,7 +732,7 @@ func (mgr *Manager) saveRepro(res *repro.Result, hub bool) { // Append this repro to repro list to send to hub if it didn't come from hub originally. if !hub { progForHub := []byte(fmt.Sprintf("# %+v\n# %v\n# %v\n%s", - res.Opts, res.Desc, mgr.cfg.Tag, prog)) + res.Opts, res.Title, mgr.cfg.Tag, prog)) mgr.mu.Lock() mgr.newRepros = append(mgr.newRepros, progForHub) mgr.mu.Unlock() @@ -750,7 +750,7 @@ func (mgr *Manager) saveRepro(res *repro.Result, hub bool) { } dc := &dashapi.Crash{ BuildID: mgr.cfg.Tag, - Title: res.Desc, + Title: res.Title, Maintainers: maintainers, Log: res.Log, Report: res.Report, @@ -1124,7 +1124,7 @@ func (mgr *Manager) hubSync() { mgr.hubReproQueue <- &Crash{ vmIndex: -1, hub: true, - desc: "external repro", + title: "external repro", report: nil, log: repro, } diff --git a/tools/syz-crush/crush.go b/tools/syz-crush/crush.go index 34f700bb3..b349e50bc 100644 --- a/tools/syz-crush/crush.go +++ b/tools/syz-crush/crush.go @@ -109,14 +109,14 @@ func runInstance(cfg *mgrconfig.Config, reporter report.Reporter, vmPool *vm.Poo } log.Logf(0, "vm-%v: crushing...", index) - desc, _, output, crashed, timedout := vm.MonitorExecution(outc, errc, reporter) + title, _, output, crashed, timedout := vm.MonitorExecution(outc, errc, reporter) if timedout { // This is the only "OK" outcome. log.Logf(0, "vm-%v: running long enough, restarting", index) } else { if !crashed { // syz-execprog exited, but it should not. - desc = "lost connection to test machine" + title = "lost connection to test machine" } f, err := ioutil.TempFile(".", "syz-crush") if err != nil { @@ -124,7 +124,7 @@ func runInstance(cfg *mgrconfig.Config, reporter report.Reporter, vmPool *vm.Poo return } defer f.Close() - log.Logf(0, "vm-%v: crashed: %v, saving to %v", index, desc, f.Name()) + log.Logf(0, "vm-%v: crashed: %v, saving to %v", index, title, f.Name()) f.Write(output) } return diff --git a/tools/syz-symbolize/symbolize.go b/tools/syz-symbolize/symbolize.go index e925159d2..d8a77691c 100644 --- a/tools/syz-symbolize/symbolize.go +++ b/tools/syz-symbolize/symbolize.go @@ -43,14 +43,14 @@ func main() { fmt.Fprintf(os.Stderr, "no crash found\n") os.Exit(1) } - text = rep.Text + text = rep.Report text, err = reporter.Symbolize(text) if err != nil { fmt.Fprintf(os.Stderr, "failed to symbolize: %v\n", err) os.Exit(1) } guiltyFile := reporter.ExtractGuiltyFile(text) - fmt.Printf("%v\n\n", rep.Desc) + fmt.Printf("%v\n\n", rep.Title) os.Stdout.Write(text) fmt.Printf("\n") fmt.Printf("guilty file: %v\n", guiltyFile) @@ -97,7 +97,7 @@ func (inst *Instance) Close() { } func MonitorExecution(outc <-chan []byte, errc <-chan error, reporter report.Reporter) ( - desc string, text, output []byte, crashed, timedout bool) { + title string, report, output []byte, crashed, timedout bool) { waitForOutput := func() { timer := time.NewTimer(10 * time.Second).C for { @@ -131,15 +131,15 @@ func MonitorExecution(outc <-chan []byte, errc <-chan error, reporter report.Rep if rep == nil { panic(fmt.Sprintf("reporter.ContainsCrash/Parse disagree:\n%s", output[matchPos:])) } - start := rep.Start + matchPos - beforeContext + start := rep.StartPos + matchPos - beforeContext if start < 0 { start = 0 } - end := rep.End + matchPos + afterContext + end := rep.EndPos + matchPos + afterContext if end > len(output) { end = len(output) } - return rep.Desc, rep.Text, output[start:end], true, false + return rep.Title, rep.Report, output[start:end], true, false } lastExecuteTime := time.Now() |
