[PATCH v2 00/14] Fix signal-unsafe logging

Peter Hutterer peter.hutterer at who-t.net
Wed Apr 11 16:53:41 PDT 2012


On Mon, Apr 09, 2012 at 11:17:26AM -0700, Chase Douglas wrote:
> This new patch set includes a few fixes to the first and many more fixed
> logging paths. All paths in the server that occur when it encounters a
> fatal signal are now handled properly.
> 
> I do not think this affects the crash I have been seeing in the Ubuntu
> server. I tracked that issue down to a bug in the synaptics input
> module. Since the only known issue is that running the server under
> valgrind may fail if messages are logged inappropriately, I suggest we
> not apply this to any stable branches.
> 
> The full tree is still maintained at:
> 
> http://cgit.freedesktop.org/~cndougla/xserver/log/?h=signal-logging
> 
> Thanks!

Looks good and this is certainly needed. I do have a few comments though:

- I'd really like to see some tests of these new functions. Should be easy
  enough to write, given that they're all exposed and you can use strlen,
  strcmp, etc. to compare results.
  Plus, you should be able to test them inside a signal handler too with
  little effort.

- AFAICT, every single caller to LogMessageVerbSigSafe uses -1 as verbosity.
  How about a LogMessageSigSafe wrapper?

- the API is rather shocking, replacing one vararg function with a number of
  mixed calls makes it really hard to grep for the message.
  a poor man's printf parsing that searches for %d, %s and %x would help
  here.

- given that input drivers almost always use signal-sensitive processing,
  making xf86IDrvMsg signal safe would go a long way 

Cheers,
  Peter


More information about the xorg-devel mailing list