Skip to content
Snippets Groups Projects
Commit 2ce32f42 authored by Jan David Mol's avatar Jan David Mol
Browse files

Task #2669: Force abort() on several fatal signals, because OpenMPI promises to do so but doesn't

parent 206a9fc1
No related branches found
No related tags found
No related merge requests found
...@@ -219,10 +219,29 @@ static void enableCoreDumps() ...@@ -219,10 +219,29 @@ static void enableCoreDumps()
} }
static void ignoreSigPipe() static void abortHandler(int sig)
{ {
(void)sig;
abort();
}
static void installSigHandlers()
{
// ignore SIGPIPE
if (signal(SIGPIPE, SIG_IGN) < 0) if (signal(SIGPIPE, SIG_IGN) < 0)
perror("warning: ignoring SIGPIPE failed"); perror("warning: ignoring SIGPIPE failed");
// force abort() on a few signals, as OpenMPI appears to be broken in this regard
if (signal(SIGBUS, abortHandler) < 0)
perror("warning: rerouting SIGBUS failed");
if (signal(SIGSEGV, abortHandler) < 0)
perror("warning: rerouting SIGSEGV failed");
if (signal(SIGILL, abortHandler) < 0)
perror("warning: rerouting SIGILL failed");
if (signal(SIGFPE, abortHandler) < 0)
perror("warning: rerouting SIGFPE failed");
} }
...@@ -272,7 +291,7 @@ static void master_thread() ...@@ -272,7 +291,7 @@ static void master_thread()
LOG_DEBUG("Master thread running"); LOG_DEBUG("Master thread running");
enableCoreDumps(); enableCoreDumps();
ignoreSigPipe(); installSigHandlers();
#if defined CATCH_EXCEPTIONS #if defined CATCH_EXCEPTIONS
try { try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment