GNU bug report logs - #18375
24.4.50; Emacs hangs X session manager logout in certain cases

Previous Next

Package: emacs;

Reported by: Christoph Ruegge <chrueg <at> gmail.com>

Date: Sun, 31 Aug 2014 23:33:03 UTC

Severity: normal

Tags: patch

Found in version 24.4.50

Done: Jan Djärv <jan.h.d <at> swipnet.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: Christoph Ruegge <chrueg <at> gmail.com>
Cc: "18375 <at> debbugs.gnu.org" <18375 <at> debbugs.gnu.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#18375: 24.4.50; Emacs hangs X session manager logout in certain cases
Date: Wed, 3 Sep 2014 20:40:43 +0200
Hi.

3 sep 2014 kl. 11:53 skrev Christoph Ruegge <chrueg <at> gmail.com>:

> They
> also give applications the opportunity to query the user about unsaved
> changes and such things. Now Emacs does not do that, but it's fairly
> simple to do implement using `emacs-save-session-functions'.
> Additionally, the only reason for me to log out is usually to restart
> the computer, so Emacs will get killed anyway. Having the opportunity
> to query about potential data loss may be useful.

Save state is part of the session protocol.  But as daemon is supposed to survive the session, there is no saving of state needed when the session dies.

> That being said, I realize that my patch is rather intrusive and that
> the more minimal solution of the daemon not using the SM at all is
> better, especially since the daemon _can_ survive losing the X
> connection (maybe in case of an X crash), which would lead to
> unexpected behaviour in the next session. So one simply has to rely on
> something like auto-save to prevent data loss.
> 
> Still, there's a corner case of the same bug occuring in non-daemon
> mode, since it's technically possible to close the first terminal
> after using e.g. "emacsclient -t", though that is likely a rather rare
> situation.

The tests I done shows that the SM connection is not closed properly, ever.
So it is a bug.  On the other hand, X style session management is kind of deprecated.
You can see this in Fedora 20, where the whole desktop dies when emacsclient -c starts a new frame for a daemon outside the session.  I guess it looses it when a process outside the session attach to the session (or something like that).

I will fix the bug, and disable SM for daemon.

As for exposing SM to lisp, that might not be a bad idea, but it would be better to implement and expose the newer d-bus based SM than the old X based SM.   The latter will probably go away within a couple of years.  Gnome only has a compability layer for it on top of the d-bus SM.

	Jan D.





This bug report was last modified 10 years and 347 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.