lib/tests: explicitly raise SIGSEGV
PATCH 1/1 lib/tests: explicitly raise SIGSEGV
Dereferencing a NULL pointer is undefined behaviour and may not always result in a segmentation fault. Explicitly raise the SIGSEGV signal to test handling of this signal.
--- lib/tests/igt_segfault.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
lib/tests/igt_segfault.c +5 -1
@@ -57,11 +57,15 @@ bool runc;char test[] ="test" ;char *argv_run[] = { test }; +static void crashme (void ) +{ +raise (SIGSEGV ); +} +static int do_fork (void ) {int pid, status;int argc; -void (*crashme)(void ) =NULL ;switch (pid =fork ()) {case -1 :
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
This relies on signal.h being included by wait.h. Would it be better to include it explicitly?
-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of Thomas Wood
Sent: Thursday, September 24, 2015 11:30 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH i-g-t] lib/tests: explicitly raise SIGSEGV
Dereferencing a NULL pointer is undefined behaviour and may not always result in a segmentation fault. Explicitly raise the SIGSEGV signal to test handling of this signal.
--- lib/tests/igt_segfault.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
lib/tests/igt_segfault.c +5 -1
@@ -57,11 +57,15 @@ bool runc;char test[] ="test" ;char *argv_run[] = { test }; +static void crashme (void ) +{ +raise (SIGSEGV ); +} +static int do_fork (void ) {int pid, status;int argc; -void (*crashme)(void ) =NULL ;switch (pid =fork ()) {case -1 :
--
1.9.1
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx