diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2016-03-09 12:07:15 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2016-03-10 17:47:13 +0100 |
| commit | 4b4dc9d1f30c996dc5eefbecbf91399939adbee5 (patch) | |
| tree | 77811450cd2727273961bbfc00bf780be8a3b90e /ipc | |
| parent | f419fc90dd6b663ac04d1a46c8bf99e1437609dc (diff) | |
executor: ignore the case when test process kills loop process
This lead to lots of false positives.
Diffstat (limited to 'ipc')
| -rw-r--r-- | ipc/ipc.go | 17 |
1 files changed, 13 insertions, 4 deletions
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 |
