[Intel-gfx] [PATCH i-g-t] lib/igt_core: Print stacktrace when receiving one of the crash signals.

Marius Vlad marius.c.vlad at intel.com
Sat Aug 20 15:32:36 UTC 2016


While at it add SIGFPE as a crash signal.

Signed-off-by: Marius Vlad <marius.c.vlad at intel.com>
CC: Chris Wilson <chris at chris-wilson.co.uk>
---
 lib/igt_core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 801f02f..67e1a4f 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -1482,7 +1482,8 @@ static bool exit_handler_disabled;
 #define SILENT(x) { x, NULL, 0 }
 static const struct { int number; const char *name; size_t name_len; } handled_signals[] =
 	{ SILENT(SIGINT), SILENT(SIGHUP), SILENT(SIGTERM), SILENT(SIGQUIT),
-	  SILENT(SIGPIPE), SIGDEF(SIGABRT), SIGDEF(SIGSEGV), SIGDEF(SIGBUS) };
+	  SILENT(SIGPIPE), SIGDEF(SIGABRT), SIGDEF(SIGSEGV), SIGDEF(SIGBUS),
+	  SIGDEF(SIGFPE) };
 #undef SILENT
 #undef SIGDEF
 
@@ -1542,6 +1543,7 @@ static bool crash_signal(int sig)
 	switch (sig) {
 	case SIGILL:
 	case SIGBUS:
+	case SIGFPE:
 	case SIGSEGV:
 		return true;
 	default:
@@ -1571,7 +1573,7 @@ static void fatal_sig_handler(int sig)
 				igt_exitcode = 128 + sig;
 
 			failed_one = true;
-
+			print_backtrace();
 			exit_subtest("CRASH");
 		}
 		break;
-- 
2.5.0



More information about the Intel-gfx mailing list