From 9b0a32dc80b6b0c0f35d06fc833f29510efccd72 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 10 May 2015 09:09:54 +0100 Subject: [PATCH] lib/core: Limit fatal signal CRASH reporting to the fatal signals Signed-off-by: Chris Wilson --- lib/igt_core.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/igt_core.c b/lib/igt_core.c index 251cfd23..8a1a249f 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -1405,6 +1405,18 @@ static void igt_atexit_handler(void) call_exit_handlers(0); } +static bool crash_signal(int sig) +{ + switch (sig) { + case SIGILL: + case SIGBUS: + case SIGSEGV: + return true; + default: + return false; + } +} + static void fatal_sig_handler(int sig) { int i; @@ -1421,7 +1433,7 @@ static void fatal_sig_handler(int sig) igt_assert_eq(write(STDERR_FILENO, ".\n", 2), 2); } - if (in_subtest) + if (in_subtest && crash_signal(sig)) exit_subtest("CRASH"); break; }