os: Handle SIGABRT
Without this, assertion failures can make life hard for users and those trying to help them. v2: * Change commit log wording slightly to "can make life hard", since apparently e.g. logind can alleviate that somewhat. * Set default handler for SIGABRT in hw/xfree86/common/xf86Init.c:InstallSignalHandlers() and hw/xquartz/quartz.c:QuartzInitOutput() (Eric Anholt) Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
committed by
Adam Jackson
parent
23f2f1932a
commit
27a6b9f7c8
@@ -309,6 +309,7 @@ InstallSignalHandlers(void)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
OsSignal(SIGSEGV, SIG_DFL);
|
OsSignal(SIGSEGV, SIG_DFL);
|
||||||
|
OsSignal(SIGABRT, SIG_DFL);
|
||||||
OsSignal(SIGILL, SIG_DFL);
|
OsSignal(SIGILL, SIG_DFL);
|
||||||
#ifdef SIGEMT
|
#ifdef SIGEMT
|
||||||
OsSignal(SIGEMT, SIG_DFL);
|
OsSignal(SIGEMT, SIG_DFL);
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ QuartzInitOutput(int argc,
|
|||||||
{
|
{
|
||||||
/* For XQuartz, we want to just use the default signal handler to work better with CrashTracer */
|
/* For XQuartz, we want to just use the default signal handler to work better with CrashTracer */
|
||||||
signal(SIGSEGV, SIG_DFL);
|
signal(SIGSEGV, SIG_DFL);
|
||||||
|
signal(SIGABRT, SIG_DFL);
|
||||||
signal(SIGILL, SIG_DFL);
|
signal(SIGILL, SIG_DFL);
|
||||||
#ifdef SIGEMT
|
#ifdef SIGEMT
|
||||||
signal(SIGEMT, SIG_DFL);
|
signal(SIGEMT, SIG_DFL);
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ OsInit(void)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
int siglist[] = { SIGSEGV, SIGQUIT, SIGILL, SIGFPE, SIGBUS,
|
int siglist[] = { SIGSEGV, SIGQUIT, SIGILL, SIGFPE, SIGBUS,
|
||||||
|
SIGABRT,
|
||||||
SIGSYS,
|
SIGSYS,
|
||||||
SIGXCPU,
|
SIGXCPU,
|
||||||
SIGXFSZ,
|
SIGXFSZ,
|
||||||
|
|||||||
@@ -1352,6 +1352,12 @@ OsAbort(void)
|
|||||||
{
|
{
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
OsBlockSignals();
|
OsBlockSignals();
|
||||||
|
#endif
|
||||||
|
#if !defined(WIN32) || defined(__CYGWIN__)
|
||||||
|
/* abort() raises SIGABRT, so we have to stop handling that to prevent
|
||||||
|
* recursion
|
||||||
|
*/
|
||||||
|
OsSignal(SIGABRT, SIG_DFL);
|
||||||
#endif
|
#endif
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user