syz-manager: fix repro saving

If manager is connected to dashboard it now does not save crashes.
Which means that when we save a repro the crash dir may not exist yet.
Create the dir when saving repros.
This commit is contained in:
Dmitry Vyukov 2017-07-21 09:05:29 +02:00
parent 240b07788c
commit 0bdcc49799

View File

@ -608,6 +608,7 @@ func (mgr *Manager) saveFailedRepro(desc string) {
}
}
dir := filepath.Join(mgr.crashdir, hash.String([]byte(desc)))
osutil.MkdirAll(dir)
for i := 0; i < maxReproAttempts; i++ {
name := filepath.Join(dir, fmt.Sprintf("repro%v", i))
if !osutil.IsExist(name) {
@ -620,6 +621,7 @@ func (mgr *Manager) saveFailedRepro(desc string) {
func (mgr *Manager) saveRepro(res *repro.Result) {
res.Report = mgr.symbolizeReport(res.Report)
dir := filepath.Join(mgr.crashdir, hash.String([]byte(res.Desc)))
osutil.MkdirAll(dir)
opts := fmt.Sprintf("# %+v\n", res.Opts)
prog := res.Prog.Serialize()