diff options
| author | Mara Mihali <maramihali@google.com> | 2021-07-07 16:51:39 +0000 |
|---|---|---|
| committer | Marco Elver <me@marcoelver.com> | 2021-07-08 10:00:58 +0200 |
| commit | 1b20171a857edaeb6232e42ae1e0b783d4c5f666 (patch) | |
| tree | 539072b62129cc09f964f34ea64adcfae606ab9f /syz-verifier/main.go | |
| parent | 1aade7546f2c85b87c16978919f101686593c956 (diff) | |
syz-verifier: improve readability of results
Diffstat (limited to 'syz-verifier/main.go')
| -rwxr-xr-x | syz-verifier/main.go | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/syz-verifier/main.go b/syz-verifier/main.go index 65a7a5cdd..b277d3176 100755 --- a/syz-verifier/main.go +++ b/syz-verifier/main.go @@ -11,6 +11,7 @@ import ( "os" "path/filepath" "strconv" + "strings" "sync" "time" @@ -312,7 +313,8 @@ func (vrf *Verifier) processResults(res []*verf.Result, prog *prog.Prog) { } } - err := osutil.WriteFile(filepath.Join(vrf.resultsdir, fmt.Sprintf("result-%d", oldest)), createReport(rr)) + err := osutil.WriteFile(filepath.Join(vrf.resultsdir, + fmt.Sprintf("result-%d", oldest)), createReport(rr, len(vrf.pools))) if err != nil { log.Printf("failed to write result-%d file, err %v", oldest, err) } @@ -320,20 +322,29 @@ func (vrf *Verifier) processResults(res []*verf.Result, prog *prog.Prog) { log.Printf("result-%d written successfully", oldest) } -func createReport(rr *verf.ResultReport) []byte { - data := fmt.Sprintf("Errno mismatches found for program:\n%s\n", rr.Prog) - data += "CALL REPORTS FOUND BELOW\n" - - for _, cr := range rr.Reports { - data += fmt.Sprintf("Report for call: %s", cr.Call) +func createReport(rr *verf.ResultReport, pools int) []byte { + calls := strings.Split(rr.Prog, "\n") + calls = calls[:len(calls)-1] + data := "ERRNO mismatches found for program:\n\n" + for idx, cr := range rr.Reports { + tick := "[=]" if cr.Mismatch { - data += " - MISMATCH FOUND" + tick = "[!]" } - data += "\n" - for pool, errno := range cr.Errnos { - data += fmt.Sprintf("Pool: %d, Errno: %d, Flag: %d\n", pool, errno, cr.Flags[pool]) + data += fmt.Sprintf("%s %s\n", tick, calls[idx]) + + // Ensure results are ordered by pool index. + for i := 0; i < pools; i++ { + errno, ok := cr.Errnos[i] + if !ok { + // VM crashed so we don't have reports from this pool. + continue + } + + data += fmt.Sprintf("\t↳ Pool: %d, Errno: %d, Flag: %d\n", i, errno, cr.Flags[i]) } + data += "\n" } |
