Emacs 24 crashing when launched with Synapse and an emacsclient window is closed


Vinh Nguyen


December 9, 2011

I'm currently using Emacs 24 (pre-release) installed from this repository on Ubuntu 11.04. An error (crash: segmentation fault) that arose after moving from Emacs 23 to Emacs 24 is as follow (could stem from the pre-release repository; might not be the case if I compile from source).

I launch emacs via Synapse. I start the daemon server (M-x server-start). Then, I launch text files from Nautilus via my emacs.sh script:

#! /bin/sh
## exec emacsclient --alternate-editor="emacs" -c "$@" ## not using this since I use DeskTop AND set server-on in .emacs...sometimes DeskTop would ask a question when accessing a lock session, and emacs will hang at the question
## taken from comments section at http://draptik.wordpress.com/2009/10/23/emacsclient-usage-on-a-gnulinux-system/

# ## following doesn't work for emacs 24, only 23
# emacsclient -e '(gnuserv-done-function)' 2>/dev/null ## suppress the stderr message
# if [ "$?" -ne "0" ]; then ## http://steve-parker.org/sh/exitcodes.shtml
#     emacs "$@"
# else
#     emacsclient -c "$@"
# fi
exec emacsclient --alternate-editor="emacs" -c "$@"

When I do C-x # to close the emacsclient window, the entire emacs program crashes. This does not happen when I launch files from the terminal; it only happens when I launch files using the script (or just the emacsclient command) using Nautilus. I even launched an unadulterated emacs session via emacs -q and this still happens.

My current solution is to launch my first emacs instance via the default Gnome "launch application" (Alt F2).