Skip to content

Commit

Permalink
Merge pull request cms-sw#10864 from bbockelm/fix-sigstack
Browse files Browse the repository at this point in the history
Fix sigstack printer.
  • Loading branch information
cmsbuild committed Aug 20, 2015
2 parents 45f7add + 0ad1c49 commit 9777212
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions FWCore/Services/src/InitRootHandlers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ namespace {
// handlers are *not* async-signal safe. Hence, a deadlock is possible if we invoke
// fork() from our signal handlers. Accordingly, we use clone (not POSIX, but AS-safe)
// as that is closer to the 'raw metal' syscall and avoids pthread_atfork handlers.
int pid =
int pid =
#ifdef __linux__
clone(edm::service::cmssw_stacktrace, child_stack_ptr, CLONE_VFORK|CLONE_VM|CLONE_FS|SIGCHLD, nullptr);
clone(edm::service::cmssw_stacktrace, child_stack_ptr, CLONE_VM|CLONE_FS|SIGCHLD, nullptr);
#else
fork();
if (child_stack_ptr) {} // Suppress 'unused variable' warning on non-Linux
Expand All @@ -255,6 +255,14 @@ namespace {
full_cerr_write("\nA fatal system signal has occurred: ");
full_cerr_write(signalname);
full_cerr_write("\n");

// For these three known cases, re-raise the signal so get the correct
// exit code.
if ((sig == SIGILL) || (sig == SIGSEGV) || (sig == SIGBUS))
{
signal(sig, SIG_DFL);
raise(sig);
}
::abort();
}

Expand Down

0 comments on commit 9777212

Please sign in to comment.