emacs –daemon crashing after closing emacsclient -c

I start emacs daemon with the following commnad.

$ emacs --daemon

This seems to work.
After this I start emacs client as follows

$ emacsclient -c

Whenever I close the emacsclient, the server also stops with the following error.

X protocol error: BadWindow (invalid Window parameter) on protocol request 42
When compiled with GTK, Emacs cannot recover from X disconnects.
This is a GTK bug: https://bugzilla.gnome.org/show_bug.cgi?id=85715
For details, see etc/PROBLEMS.
Fatal error (6)zsh: abort  

I have not found any information about this problem. Is there a way around this?

Asked By: Silverrocker


This is a known bug, FS#32423: emacsclient consistently crashes emacs. The bug has been reported to the Emacs authors. It is compounded by a Gtk bug. The following workarounds are reported to work:

  • Downgrading to Emacs 24.1 (instead of 24.2).
  • Downgrading Glib to 2.32 (instead of 2.34).
  • Compiling Emacs without Gtk (--with-x-toolkit=lucid).
  • Starting the daemon with no X connection available (try DISPLAY= emacs --daemon).

No actual solution seems to be known at this time.

This isn’t something you can fix on your own unless you’re a programmer and you’re familiar with the technologies involved. Your best bet is to use one of the workarounds and keep watching the bug reports for a fix.

Categories: Answers Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.