Commit e3e340d5 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Trigger the panic dump handler also on sigabrt

This allows for a panic dump and backtrace to be produced on
sigabrt. This is useful e.g. when using jemalloc's debug flags, which
can through a special environment variable enable memory allocation
consistency checks and trigger sigabrt on errors.
parent 1bc257db
......@@ -465,6 +465,9 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
memset(&sa, 0, sizeof sa);
sa.sa_handler = SIG_DFL;
(void)sigaction(SIGSEGV, &sa, NULL);
/* Set SIGABRT back to default so the final abort() has the
desired effect */
(void)sigaction(SIGABRT, &sa, NULL);
switch(kind) {
case VAS_WRONG:
......
......@@ -384,6 +384,7 @@ mgt_launch_child(struct cli *cli)
sa.sa_flags = SA_SIGINFO;
(void)sigaction(SIGSEGV, &sa, NULL);
(void)sigaction(SIGBUS, &sa, NULL);
(void)sigaction(SIGABRT, &sa, NULL);
}
(void)signal(SIGINT, SIG_DFL);
(void)signal(SIGTERM, SIG_DFL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment