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.
This commit is contained in:
Dag-Erling Smørgrav 2016-09-30 12:17:49 +02:00
parent 183f023ab6
commit 2ba5067496

View file

@ -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
};