On 04/11/2012 04:24 PM, Peter Hutterer wrote: > On Mon, Apr 09, 2012 at 11:17:31AM -0700, Chase Douglas wrote: >> Also, print out the offending message format. This will hopefully help >> developers track down unsafe logging. >> >> Signed-off-by: Chase Douglas <[email protected]> >> --- >> os/log.c | 31 +++++++++++++++++++++++++++++++ >> 1 files changed, 31 insertions(+), 0 deletions(-) >> >> diff --git a/os/log.c b/os/log.c >> index 2583fe8..8a59306 100644 >> --- a/os/log.c >> +++ b/os/log.c >> @@ -288,6 +288,21 @@ LogVWrite(int verb, const char *f, va_list args) >> int len = 0; >> static Bool newline = TRUE; >> >> + if (inSignalContext) { >> + static const char warning[] = "Warning: attempting to log data in a >> " >> + "signal unsafe manner while in signal >> " >> + "context. Please update to check " >> + "inSignalContext and/or use " >> + "LogMessageVerbSigSafe(). The >> offending " >> + "log format message is:\n"; >> + >> + write(logFileFd, warning, sizeof(warning) - 1); >> + >> + write(logFileFd, f, strlen_sigsafe(f)); >> + >> + return; >> + } >> + > > can we use a BUG_WARN derivative (BUG_WARN_SIGSAFE?) here?
Yeah, that makes sense. -- Chase _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
