提交 9018a337 编写于 作者: A Aleksandr Nogikh 提交者: Aleksandr Nogikh

syz-manager: don't report all pkg/repro errors on shutdown

Otherwise we're getting "repro failed: all VMs failed to boot" pkg/repro
errors if a sykaller instance is shutting down.
上级 058b3a5a
......@@ -543,12 +543,14 @@ func (ctx *context) testWithInstance(callback func(execInterface) (rep *instance
return true, nil
}
var ErrNoVMs = errors.New("all VMs failed to boot")
// A helper method for testWithInstance.
func (ctx *context) runOnInstance(callback func(execInterface) (rep *instance.RunResult,
err error)) (*instance.RunResult, error) {
inst := <-ctx.instances
if inst == nil {
return nil, fmt.Errorf("all VMs failed to boot")
return nil, ErrNoVMs
}
defer ctx.returnInstance(inst)
return callback(inst.execProg)
......
......@@ -469,14 +469,26 @@ func (mgr *Manager) vmLoop() {
}
func reportReproError(err error) {
shutdown := false
select {
case <-vm.Shutdown:
shutdown = true
default:
}
switch err {
case repro.ErrNoPrograms:
// This is not extraordinary as programs are collected via SSH.
log.Logf(0, "repro failed: %v", err)
default:
// Report everything else as errors.
log.Errorf("repro failed: %v", err)
return
case repro.ErrNoVMs:
// This error is to be expected if we're shutting down.
if shutdown {
return
}
}
// Report everything else as errors.
log.Errorf("repro failed: %v", err)
}
func (mgr *Manager) runRepro(crash *Crash, vmIndexes []int, putInstances func(...int)) *ReproResult {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册