manager: don't save empty reports

This commit is contained in:
Dmitry Vyukov 2016-09-03 12:36:27 +02:00
parent 40280fa543
commit c7aabee440

View File

@ -313,13 +313,15 @@ func (mgr *Manager) saveCrasher(vmCfg *vm.Config, desc string, text, output []by
if err := ioutil.WriteFile(fn, output, 0660); err != nil {
continue
}
symbolized, err := report.Symbolize(mgr.cfg.Vmlinux, text)
if err != nil {
logf(0, "failed to symbolize crash: %v", err)
} else {
text = symbolized
if len(text) > 0 {
symbolized, err := report.Symbolize(mgr.cfg.Vmlinux, text)
if err != nil {
logf(0, "failed to symbolize crash: %v", err)
} else {
text = symbolized
}
ioutil.WriteFile(filepath.Join(dir, fmt.Sprintf("report%v", i)), []byte(text), 0660)
}
ioutil.WriteFile(filepath.Join(dir, fmt.Sprintf("report%v", i)), []byte(text), 0660)
break
}
}