summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-04-30 15:44:37 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-05-07 09:41:14 +1000
commit042c6d861f7bb7038ddcdd6b59766fd9094d0e52 (patch)
tree84d86d91ae87263d7f63e5bea44dda741a7f1694
parentd9848fb4b182ca21bacf28ed7410d1a502cb000e (diff)
os: Use ErrorFSigSafe from FatalError and it's friends
Backtrace logging etc. is already sigsafe, but the actual FatalError message in response is not yet, leading to amusing logs like this: (EE) Segmentation fault at address 0x0 (EE) BUG: triggered 'if (inSignalContext)' (EE) BUG: log.c:499 in LogVMessageVerb() (EE) Warning: attempting to log data in a signal unsafe manner while in signal context. Please update to check inSignalContext and/or use LogMessageVerbSigSafe() or ErrorFSigSafe(). The offending log format message is: Fatal server error: Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
-rw-r--r--glx/glxdri.c2
-rw-r--r--glx/glxdri2.c2
-rw-r--r--os/log.c10
3 files changed, 7 insertions, 7 deletions
diff --git a/glx/glxdri.c b/glx/glxdri.c
index 1964d2e0c..1ac683978 100644
--- a/glx/glxdri.c
+++ b/glx/glxdri.c
@@ -889,7 +889,7 @@ glxDRILeaveVT(ScrnInfoPtr scrn)
__GLXDRIscreen *screen = (__GLXDRIscreen *)
glxGetScreen(xf86ScrnToScreen(scrn));
- LogMessage(X_INFO, "AIGLX: Suspending AIGLX clients for VT switch\n");
+ LogMessageVerbSigSafe(X_INFO, -1, "AIGLX: Suspending AIGLX clients for VT switch\n");
glxSuspendClients();
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 65485793b..8a1fa4159 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -835,7 +835,7 @@ glxDRILeaveVT(ScrnInfoPtr scrn)
__GLXDRIscreen *screen = (__GLXDRIscreen *)
glxGetScreen(xf86ScrnToScreen(scrn));
- LogMessage(X_INFO, "AIGLX: Suspending AIGLX clients for VT switch\n");
+ LogMessageVerbSigSafe(X_INFO, -1, "AIGLX: Suspending AIGLX clients for VT switch\n");
glxSuspendClients();
diff --git a/os/log.c b/os/log.c
index 3dc675f5c..f19faf5ee 100644
--- a/os/log.c
+++ b/os/log.c
@@ -250,7 +250,7 @@ void
LogClose(enum ExitCode error)
{
if (logFile) {
- ErrorF("Server terminated %s (%d). Closing log file.\n",
+ ErrorFSigSafe("Server terminated %s (%d). Closing log file.\n",
(error == EXIT_NO_ERROR) ? "successfully" : "with error", error);
fclose(logFile);
logFile = NULL;
@@ -878,9 +878,9 @@ FatalError(const char *f, ...)
static Bool beenhere = FALSE;
if (beenhere)
- ErrorF("\nFatalError re-entered, aborting\n");
+ ErrorFSigSafe("\nFatalError re-entered, aborting\n");
else
- ErrorF("\nFatal server error:\n");
+ ErrorFSigSafe("\nFatal server error:\n");
va_start(args, f);
@@ -897,9 +897,9 @@ FatalError(const char *f, ...)
va_end(apple_args);
}
#endif
- VErrorF(f, args);
+ VErrorFSigSafe(f, args);
va_end(args);
- ErrorF("\n");
+ ErrorFSigSafe("\n");
if (!beenhere)
OsVendorFatalError(f, args2);
va_end(args2);