Subject: bug#16093: 24.3.50; Crash of emacs --daemon on killing X server

From: Jan Djärv <[email-masked]>
Date: Wed, 11 Dec 2013 07:01:12 +0100

Hello.

11 dec 2013 kl. 00:39 skrev Nix <[email-masked]>:

> On 9 Dec 2013, Dmitry Antipov stated:
> 
>> On 12/09/2013 07:58 PM, Nix wrote:
>>> It is fairly clear that we should not be calling xftfont_close() if the
>>> X server is not there! Why has this started happening?
>> 
>> Hm... IIUC there is no convenient way to check whether X display connection
>> is alive. But we can do some tricks, for example, try to select() or poll()
>> ConnectionNumber() - if there is no EBADF, X server is hopefully present...
> 
> Well, it's never happened before. Something has clearly changed... maybe
> we're just cleaning up fonts much more lazily than before? (An ugly hack
> to "fix" it in that case might just be to trigger a garbage-collect when
> the last frame on a given terminal goes away.)
> 
> The Xlib error handler should really be being called, which suggests
> this is a bug in Xft as well: I'll chase that up. (But that can't be the
> cause of this: I last updated my Xft a year and a half ago.)

If the display connection is gone, no error handler is called.  It is normal.
The change is that font objects that are garbage collected runs the fonmt specific cleanup, which is at a random time, in this case after the display went away.

	Jan D.