Skip to content

Commit

Permalink
Fixes #10842. Handle SIGABRT even if UI thread deadlocked.
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-kristjansson committed Jun 18, 2012
1 parent b047371 commit e6f9936
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mythtv/libs/libmythbase/signalhandling.cpp
Expand Up @@ -153,8 +153,15 @@ void SignalHandler::signalHandler(int signum)
// One must not return from SEGV, ILL, BUS or FPE. When these
// are raised by the program itself they will immediately get
// re-raised on return.
//
// We also handle SIGABRT the same way. While it is safe to
// return from the signal handler for SIGABRT doing so means
// SIGABRT will fail when the UI thread is deadlocked; but
// SIGABRT is the signal one uses to get a core of a
// deadlocked program.
if ((signum == SIGSEGV) || (signum == SIGILL) ||
(signum == SIGBUS) || (signum == SIGFPE))
(signum == SIGBUS) || (signum == SIGFPE) ||
(signum == SIGABRT))
{
// Wait for UI event loop to handle this, however we may be
// blocking it if this signal occured in the UI thread.
Expand Down Expand Up @@ -211,7 +218,6 @@ void SignalHandler::handleSignal(void)
signal(SIGABRT, SIG_DFL);
usleep(100000);
s_exit_program = true;
raise(signum);
break;
case SIGUSR1:
LOG(VB_GENERAL, LOG_CRIT, "Received SIGUSR1");
Expand Down

0 comments on commit e6f9936

Please sign in to comment.