diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-03-29 17:19:31 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-03-29 17:22:41 +0100 |
commit | 2b804c33e7511a3036b5f86d6b8a8ae806120c10 (patch) | |
tree | 42009488ef3aacf2362fd60dfea8defcdf47b05e /lib/igt_core.c | |
parent | 0bd117fa66d80a0285e860e22a973353f731ed2d (diff) |
lib: Tidy error message for a helper process who unexpectedly dies
Transform
gem_exec_suspend: igt_core.c:1429: igt_stop_helper: Assertion `(((signed char) ((((__extension__ (((union { __typeof(status) __in; int __i; }) { .__in = (status) }).__i))) & 0x7f) + 1) >> 1) > 0) && (((__extension__ (((union { __typeof(status) __in; int __i; }) { .__in = (status) }).__i))) & 0x7f) == (proc->use_SIGKILL ? 9 : 15)' failed.
into
(gem_exec_suspend:16589) igt-core-DEBUG: Helper died too early with status=0
gem_exec_suspend: igt_core.c:1437: igt_stop_helper: Assertion `helper_was_alive(proc, status)' failed.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/igt_core.c')
-rw-r--r-- | lib/igt_core.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/igt_core.c b/lib/igt_core.c index 1f9be7d0..832361b0 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -1305,6 +1305,13 @@ int igt_wait_helper(struct igt_helper_process *proc) return status; } +static bool helper_was_alive(struct igt_helper_process *proc, + int status) +{ + return (WIFSIGNALED(status) && + WTERMSIG(status) == (proc->use_SIGKILL ? SIGKILL : SIGTERM)); +} + /** * igt_stop_helper: * @proc: #igt_helper_process structure @@ -1320,8 +1327,9 @@ void igt_stop_helper(struct igt_helper_process *proc) kill(proc->pid, proc->use_SIGKILL ? SIGKILL : SIGTERM); status = igt_wait_helper(proc); - assert(WIFSIGNALED(status) && - WTERMSIG(status) == (proc->use_SIGKILL ? SIGKILL : SIGTERM)); + if (!helper_was_alive(proc, status)) + igt_debug("Helper died too early with status=%d\n", status); + assert(helper_was_alive(proc, status)); } static void children_exit_handler(int sig) |