[PATCH] Don't call FatalError from the signal handler
froese at gmx.de
Wed Apr 30 13:37:31 PDT 2008
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?
> 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.
PS: Not that it matters but why is malloc using locks anyway? Last
time I looked the X-server was single threaded...
More information about the xorg