All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] lib/igt_core.c: Flag the test as failing after a segfault
@ 2015-05-18 13:37 Derek Morton
  2015-05-18 15:14 ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Derek Morton @ 2015-05-18 13:37 UTC (permalink / raw)
  To: intel-gfx; +Cc: thomas.wood

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@intel.com>
---
 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@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH i-g-t] lib/igt_core.c: Flag the test as failing after a segfault
  2015-05-18 13:37 [PATCH i-g-t] lib/igt_core.c: Flag the test as failing after a segfault Derek Morton
@ 2015-05-18 15:14 ` Daniel Vetter
  2015-05-19  9:42   ` Morton, Derek J
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Vetter @ 2015-05-18 15:14 UTC (permalink / raw)
  To: Derek Morton; +Cc: intel-gfx, thomas.wood

On Mon, May 18, 2015 at 02:37:31PM +0100, Derek Morton wrote:
> 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@intel.com>

This isn't the first trouble with our signal handler and test results. Can
you perhaps write a library unit test for this bug?

They're in lib/tests and executed with make check.

Thanks, Daniel

> ---
>  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@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH i-g-t] lib/igt_core.c: Flag the test as failing after a segfault
  2015-05-18 15:14 ` Daniel Vetter
@ 2015-05-19  9:42   ` Morton, Derek J
  0 siblings, 0 replies; 3+ messages in thread
From: Morton, Derek J @ 2015-05-19  9:42 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx, Wood, Thomas

I will take a look and submit a test as a separate patch.

//Derek

-----Original Message-----
From: Daniel Vetter [mailto:daniel.vetter@ffwll.ch] On Behalf Of Daniel Vetter
Sent: Monday, May 18, 2015 4:14 PM
To: Morton, Derek J
Cc: intel-gfx@lists.freedesktop.org; Wood, Thomas
Subject: Re: [Intel-gfx] [PATCH i-g-t] lib/igt_core.c: Flag the test as failing after a segfault

On Mon, May 18, 2015 at 02:37:31PM +0100, Derek Morton wrote:
> 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@intel.com>

This isn't the first trouble with our signal handler and test results. Can you perhaps write a library unit test for this bug?

They're in lib/tests and executed with make check.

Thanks, Daniel

> ---
>  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@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-19  9:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-18 13:37 [PATCH i-g-t] lib/igt_core.c: Flag the test as failing after a segfault Derek Morton
2015-05-18 15:14 ` Daniel Vetter
2015-05-19  9:42   ` Morton, Derek J

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.