From 4b4dc9d1f30c996dc5eefbecbf91399939adbee5 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 9 Mar 2016 12:07:15 +0100 Subject: executor: ignore the case when test process kills loop process This lead to lots of false positives. --- ipc/ipc.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'ipc') diff --git a/ipc/ipc.go b/ipc/ipc.go index 92c1a253e..8301d0f78 100644 --- a/ipc/ipc.go +++ b/ipc/ipc.go @@ -174,8 +174,9 @@ func (env *Env) Exec(p *prog.Prog) (output []byte, cov [][]uint32, errnos []int, return } } - output, failed, hanged, err0 = env.cmd.exec() - if err0 != nil { + var restart bool + output, failed, hanged, restart, err0 = env.cmd.exec() + if err0 != nil || restart { env.cmd.close() env.cmd = nil return @@ -404,7 +405,7 @@ func (c *command) kill() { syscall.Kill(c.cmd.Process.Pid, syscall.SIGKILL) } -func (c *command) exec() (output []byte, failed, hanged bool, err0 error) { +func (c *command) exec() (output []byte, failed, hanged, restart bool, err0 error) { var tmp [1]byte if _, err := c.outwp.Write(tmp[:]); err != nil { output, _ = ioutil.ReadAll(c.rp) @@ -448,11 +449,19 @@ func (c *command) exec() (output []byte, failed, hanged bool, err0 error) { // Magic values returned by executor. if ws.ExitStatus() == 67 { err0 = fmt.Errorf("executor failed: %s", output) - return } if ws.ExitStatus() == 68 { failed = true } + if ws.ExitStatus() == 69 { + // This is a temporal error (ENOMEM) or an unfortunate + // program that messes with testing setup (e.g. kills executor + // loop process). Pretend that nothing happened. + // It's better than a false crash report. + err0 = nil + hanged = false + restart = true + } } } return -- cgit mrf-deployment