Commit 89e3ac07 authored by Chase Douglas's avatar Chase Douglas Committed by Keith Packard
Browse files

Log safely in fatal signal handler

While we probably don't need to be signal safe here since we will never
return to the normal context, the logging signal context check will
cause unsafe logging to be unhandled. Using signal safe logging here
resolves the issue.
Signed-off-by: default avatarChase Douglas <>
Reviewed-by: Peter Hutterer's avatarPeter Hutterer <>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <>
parent 6fd5add0
......@@ -113,7 +113,7 @@ OsSigHandler(int signo)
const char *dlerr = dlerror();
if (dlerr) {
LogMessage(X_ERROR, "Dynamic loader error: %s\n", dlerr);
LogMessageVerbSigSafe(X_ERROR, 1, "Dynamic loader error: %s\n", dlerr);
#endif /* RTLD_DI_SETSIGNAL */
......@@ -129,8 +129,8 @@ OsSigHandler(int signo)
if (sip->si_code == SI_USER) {
ErrorF("Recieved signal %d sent by process %ld, uid %ld\n",
signo, (long) sip->si_pid, (long) sip->si_uid);
ErrorFSigSafe("Recieved signal %u sent by process %u, uid %u\n", signo,
sip->si_pid, sip->si_uid);
else {
switch (signo) {
......@@ -138,7 +138,7 @@ OsSigHandler(int signo)
case SIGBUS:
case SIGILL:
case SIGFPE:
ErrorF("%s at address %p\n", strsignal(signo), sip->si_addr);
ErrorFSigSafe("%s at address %p\n", strsignal(signo), sip->si_addr);
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