aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2016-11-01 00:01:07 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2016-11-13 19:11:51 -0500
commit06236f4efb926aa433e2cb3e36e8467f4a0e42c0 (patch)
treee0928dfff1be1ee1f462c2918a5cddceb1ea9175 /tools/testing
parent9f751b82b491d06c6438066b511d44fa4cc49168 (diff)
selftests/powerpc: Abort load_unaligned_zeropad on unhandled SEGV
If the load unaligned zeropad test takes a SEGV which can't be handled, we increment segv_error, print the offending NIP and then return without taking any further action. In almost all cases this means we'll just take the SEGV again, and loop eternally spamming the console. Instead just abort(), it's a fatal error in the test. The test harness will notice that the child died and print a nice message for us. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c b/tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c
index 6cae06117b55..cf7a4a114a90 100644
--- a/tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c
+++ b/tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c
@@ -73,7 +73,6 @@ extern char __stop___ex_table[];
73#error implement UCONTEXT_NIA 73#error implement UCONTEXT_NIA
74#endif 74#endif
75 75
76static int segv_error;
77 76
78static void segv_handler(int signr, siginfo_t *info, void *ptr) 77static void segv_handler(int signr, siginfo_t *info, void *ptr)
79{ 78{
@@ -95,7 +94,7 @@ static void segv_handler(int signr, siginfo_t *info, void *ptr)
95 } 94 }
96 95
97 printf("No exception table match for NIA %lx ADDR %lx\n", *ip, addr); 96 printf("No exception table match for NIA %lx ADDR %lx\n", *ip, addr);
98 segv_error++; 97 abort();
99} 98}
100 99
101static void setup_segv_handler(void) 100static void setup_segv_handler(void)
@@ -145,8 +144,6 @@ static int test_body(void)
145 for (i = 0; i < page_size; i++) 144 for (i = 0; i < page_size; i++)
146 FAIL_IF(do_one_test(mem_region+i, i)); 145 FAIL_IF(do_one_test(mem_region+i, i));
147 146
148 FAIL_IF(segv_error);
149
150 return 0; 147 return 0;
151} 148}
152 149