sighandler: block signals while handling SIGSEGV

If we get SIGSEGV we need to bail out quickly, leaving other signals
unblocked could lead to other signal handlers getting triggered.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Andrew Gregory 2019-06-07 21:12:16 -07:00 committed by Allan McRae
parent 0e67ee55bd
commit e7156e78b8

View file

@ -96,7 +96,7 @@ void install_segv_handler(void)
{ {
struct sigaction new_action; struct sigaction new_action;
new_action.sa_handler = segv_handler; new_action.sa_handler = segv_handler;
sigemptyset(&new_action.sa_mask); sigfillset(&new_action.sa_mask);
new_action.sa_flags = SA_RESTART; new_action.sa_flags = SA_RESTART;
sigaction(SIGSEGV, &new_action, NULL); sigaction(SIGSEGV, &new_action, NULL);
} }