[PATCH i-g-t] lib/igt_core.c: Flag the test as failing after a segfault

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



fatal_signal_handler() was trapping fatal errors but not
flagging the test as failing or setting an exit code.
The result was that the test would return Ok or Skipped
depending on what the other subtests did even though one
of the subtests had segfaulted.

Signed-off-by: Derek Morton <derek.j.morton@xxxxxxxxx>
---
 lib/igt_core.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 8a1a249..b29f7e3 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -1433,8 +1433,15 @@ static void fatal_sig_handler(int sig)
 			igt_assert_eq(write(STDERR_FILENO, ".\n", 2), 2);
 		}
 
-		if (in_subtest && crash_signal(sig))
+		if (in_subtest && crash_signal(sig)) {
+			/* Linux standard to return exit code as 128 + signal */
+			if (!failed_one)
+				igt_exitcode = 128 + sig;
+
+			failed_one = true;
+
 			exit_subtest("CRASH");
+		}
 		break;
 	}
 
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux