From 2ba5067496762c0ec46733017390ee8d08b8aa22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Fri, 30 Sep 2016 12:17:49 +0200 Subject: [PATCH] Do not attempt to catch SIGABRT emanating from a test case. It is reasonable to assume that a SIGABRT originates from a call to abort(3), either directly or via assert(3). Both the C standard and POSIX give the implementation great latitude with regard to abort(3)'s behavior, and both explicitly mention that it may close all streams before raising SIGABRT. This means that we cannot safely proceed after a call to abort(3). One could argue that we can't safely proceed after a SIGBUS or SIGSEGV either, but in practice, the damage is usually quite limited. --- lib/test/cryb_t_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/test/cryb_t_main.c b/lib/test/cryb_t_main.c index 7d10b61..994b00e 100644 --- a/lib/test/cryb_t_main.c +++ b/lib/test/cryb_t_main.c @@ -147,7 +147,9 @@ t_add_tests(struct t_test *t, int n) */ static jmp_buf sigjmp; static int sigs[] = { - SIGABRT, SIGBUS, SIGSEGV, SIGSYS, SIGPIPE, SIGALRM, SIGTERM, + /* it is not safe to catch SIGABRT if raised by abort(3) */ + /* SIGABRT, */ + SIGBUS, SIGSEGV, SIGSYS, SIGPIPE, SIGALRM, SIGTERM, 0 };