[PATCH] Don't call FatalError from the signal handler

Peter Hutterer mailinglists at who-t.net
Wed Apr 30 21:10:30 PDT 2008


Edgar Toernig wrote:
> Peter Hutterer wrote:
>> Can I please have a review of the attached patch? The problem is 
>> described in bug 10212.
>>
>> Bernardo Innocenti reported:
>> "Very often I can freeze the Xorg server (git head) by typing
>> my username in the gdm editbox.
> 
> Hmm... an app shouldn't be able to generate a segv in the
> server...  has anyone tried to find the bug?

This bug is on top of other bugs. The concrete problem is that if a bug 
causes the server to go down, the server should come down in a 
coordinated manner. Triggering another bug while going down is bad, and 
in some cases freezes the server.

So the actual bug isn't the problem as it can be fixed. But new bugs 
appear and the problem still applies.

>> Looks like a segfault happened and xf86SigHandler is trying
>> to kill the server from _inside_ the SEGV signal handler,
>> thus deadlocking on the global malloc arena lock.
>> [...] 
>> The attached patch sets up a siglongjmp environment and - in case of a 
>> fatal error during a signal - jumps back to the set up state before 
>> bringing down the server.
> 
> This won't help at all - the lock is still held.  A longjmp doesn't
> magically unlocks all locks and brings all data structures back into
> a consistent state.  It's really only a jump and the rules which
> functions are save to be called still apply.

Thanks. Do you have any suggestions to avoid this problem?

Cheers,
   Peter



More information about the xorg mailing list