GNU bug report logs - #22174
24.4; emacs --daemon crashes when ssh is disconnected. I am using lucid x toolkit.

Previous Next

Package: emacs;

Reported by: Cody Addison <cody.addison <at> gmail.com>

Date: Tue, 15 Dec 2015 04:21:02 UTC

Severity: normal

Merged with 11676, 14958, 35003

Found in versions 24.1, 24.2, 24.4, 27.0.50

To reply to this bug, email your comments to 22174 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#22174; Package emacs. (Tue, 15 Dec 2015 04:21:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Cody Addison <cody.addison <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 15 Dec 2015 04:21:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Cody Addison <cody.addison <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4; emacs --daemon crashes when ssh is disconnected. I am using
 lucid x toolkit.
Date: Mon, 14 Dec 2015 22:05:54 -0600
[Message part 1 (text/plain, inline)]
I am using emacs in server mode on a remote machine. The intent is to
have a persistent emacs session that I can reconnect to.

Here are the steps I typically do:
% ssh <machine>
% tmux attach (This step doesn't seem important. I've tried this with and
without tmux).
% emacs --daemon
% emacsclient -n -c
% tmux detach
% exit

At this point the server is toast.

I am using cygwin on Windows 7 for the ssh client and X server. I have
also tried emacs 24.5 with no success. I have tried multiple X tool kits
(athena and motif) with no success.




In GNU Emacs 24.4.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars)
 of 2015-10-01 on sdocg001
Windowing system distributor `The Cygwin/X Project', version 11.0.11704000
System Description: Ubuntu 14.04.1 LTS

Configured using:
 `configure --with-x-toolkit=lucid
 --prefix=/home/a0866938/opt/emacs-24.4 --with-jpeg=no --with-gif=no
 --with-tiff=no'

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  show-paren-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x r e p o <tab> r t <tab> <return>

Recent messages:
Loading delsel...done
Loading paren...done
Loading /home/a0866938/emacs_scripts/tiasm_mode.el (source)...done
Loading
/home/a0866938/.emacs.d/elpa/color-theme-20080305.34/themes/color-theme-example.el
(source)...done
Loading
/home/a0866938/.emacs.d/elpa/color-theme-20080305.34/themes/color-theme-example.elc...done
Loading
/home/a0866938/.emacs.d/elpa/color-theme-20080305.34/themes/color-theme-library.el
(source)...done
Loading
/home/a0866938/.emacs.d/elpa/color-theme-20080305.34/themes/color-theme-library.elc...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
help-fns mail-prsvr mail-utils help-mode solarized-theme
solarized-definitions cl-macs color-theme wid-edit cl gv cl-loaddefs
cl-lib jka-compr paren delsel cus-start cus-load color-theme-autoloads
info easymenu package epg-config time-date tooltip electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind gfilenotify dynamic-setting x-toolkit x multi-tty emacs)

Memory information:
((conses 16 277417 13086)
 (symbols 48 24532 0)
 (miscs 40 40 109)
 (strings 32 43033 16146)
 (string-bytes 1 860921)
 (vectors 16 14072)
 (vector-slots 8 432696 5323)
 (floats 8 174 265)
 (intervals 56 220 210)
 (buffers 960 12)
 (heap 1024 41052 1153))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22174; Package emacs. (Tue, 15 Dec 2015 15:49:02 GMT) Full text and rfc822 format available.

Message #8 received at 22174 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Cody Addison <cody.addison <at> gmail.com>
Cc: 22174 <at> debbugs.gnu.org
Subject: Re: bug#22174: 24.4;
 emacs --daemon crashes when ssh is disconnected. I am using lucid x
 toolkit.
Date: Tue, 15 Dec 2015 17:48:13 +0200
> Date: Mon, 14 Dec 2015 22:05:54 -0600
> From: Cody Addison <cody.addison <at> gmail.com>
> 
> Here are the steps I typically do:
> % ssh <machine>
> % tmux attach (This step doesn't seem important. I've tried this with and
> without tmux).
> % emacs --daemon
> % emacsclient -n -c
> % tmux detach
> % exit
> 
> At this point the server is toast.

Can you attach GDB to the daemon before the final step, and when it
crashes (or exits or aborts or whatever), produce a backtrace and post
it here?

One more thing to try is the latest emacs-25 branch, if you can build
it or get a hold of snapshot binaries somewhere.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22174; Package emacs. (Tue, 15 Dec 2015 15:57:01 GMT) Full text and rfc822 format available.

Message #11 received at 22174 <at> debbugs.gnu.org (full text, mbox):

From: Cody Addison <cody.addison <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 22174 <at> debbugs.gnu.org
Subject: Re: bug#22174: 24.4; emacs --daemon crashes when ssh is disconnected.
 I am using lucid x toolkit.
Date: Tue, 15 Dec 2015 09:56:13 -0600
[Message part 1 (text/plain, inline)]
Eli,

Sure. I'll give it a try tonight and send you the results. A few more
details that may help:

1. The exit command hangs. I typically have to use Ctrl-C. This only
happens if I've opened emacsclient with X forwarding. I suspect the server
still has an open connection over ssh, but this isn't really an area I know
much about.
2. I exit the emacs client with C-x C-c. Sometimes I just put the laptop to
sleep without closing emacs or the terminal. Both have the same results.
3. This was working for a while. I don't believe anything has changed since
it stopped working, but it's possible. Right now I can reproduce the crash
every time.

On Tue, Dec 15, 2015 at 9:48 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > Date: Mon, 14 Dec 2015 22:05:54 -0600
> > From: Cody Addison <cody.addison <at> gmail.com>
> >
> > Here are the steps I typically do:
> > % ssh <machine>
> > % tmux attach (This step doesn't seem important. I've tried this with and
> > without tmux).
> > % emacs --daemon
> > % emacsclient -n -c
> > % tmux detach
> > % exit
> >
> > At this point the server is toast.
>
> Can you attach GDB to the daemon before the final step, and when it
> crashes (or exits or aborts or whatever), produce a backtrace and post
> it here?
>
> One more thing to try is the latest emacs-25 branch, if you can build
> it or get a hold of snapshot binaries somewhere.
>
> Thanks.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22174; Package emacs. (Wed, 16 Dec 2015 19:37:02 GMT) Full text and rfc822 format available.

Message #14 received at 22174 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Cody Addison <cody.addison <at> gmail.com>
Cc: 22174 <at> debbugs.gnu.org
Subject: Re: bug#22174: 24.4; emacs --daemon crashes when ssh is disconnected.
 I am using lucid x toolkit.
Date: Wed, 16 Dec 2015 21:36:32 +0200
[Please keep the bug address on the CC list.]

> Date: Wed, 16 Dec 2015 12:59:49 -0600
> From: Cody Addison <cody.addison <at> gmail.com>
> 
> Here is the result. I am including the backtrace of all 3 threads. The SIGTERM
> comes when I Ctrl-C the ssh command. I didn't expect that to pass through to
> the emacs daemon.
> 
> (gdb) continue
> Continuing.
> [New Thread 0x7f789b17d700 (LWP 52670)]
> [New Thread 0x7f789a97c700 (LWP 52765)]
> 
> Program received signal SIGTERM, Terminated.
> [Switching to Thread 0x7f789b17d700 (LWP 52670)]
> 
> backtrace thread 1:
> 
> (gdb) thread 1
> [Switching to thread 1 (Thread 0x7f78a10fa880 (LWP 26190))]
> #0 0x00007f789e045e79 in __pselect (nfds=6, readfds=0x7fff4c537f40,
> writefds=0x7fff4c537fc0, exceptfds=0x0, timeout=<optimized out>,
> sigmask=<optimized out>) at ../sysdeps/unix/sysv/linux/pselect.c:77
> 77 ../sysdeps/unix/sysv/linux/pselect.c: No such file or directory.
> (gdb) backtrace
> #0 0x00007f789e045e79 in __pselect (nfds=6, readfds=0x7fff4c537f40,
> writefds=0x7fff4c537fc0, exceptfds=0x0, timeout=<optimized out>,
> sigmask=<optimized out>) at ../sysdeps/unix/sysv/linux/pselect.c:77
> #1 0x000000000065505b in xg_select (fds_lim=6, rfds=0x7fff4c538550,
> wfds=0x7fff4c5385d0, efds=0x0, timeout=0x7fff4c538530, sigmask=0x0)
> at ../../emacs-24.4/src/xgselect.c:105
> #2 0x000000000061b0c7 in wait_reading_process_output (time_limit=0, nsecs=0,
> read_kbd=-1, do_display=true, wait_for_cell=12752882, wait_proc=0x0,
> just_wait_proc=0) at ../../emacs-24.4/src/process.c:4606
> #3 0x000000000053c869 in kbd_buffer_get_event (kbp=0x7fff4c5388b8,
> used_mouse_menu=0x7fff4c538de9, end_time=0x0)
> at ../../emacs-24.4/src/keyboard.c:3906
> #4 0x00000000005390da in read_event_from_main_queue (end_time=0x0,
> local_getcjmp=0x7fff4c538bf0, used_mouse_menu=0x7fff4c538de9)
> at ../../emacs-24.4/src/keyboard.c:2246
> #5 0x000000000053933e in read_decoded_event_from_main_queue (end_time=0x0,
> local_getcjmp=0x7fff4c538bf0, prev_event=12752882,
> used_mouse_menu=0x7fff4c538de9) at ../../emacs-24.4/src/keyboard.c:2309
> #6 0x000000000053a835 in read_char (commandflag=1, map=36984518,
> prev_event=12752882, used_mouse_menu=0x7fff4c538de9, end_time=0x0)
> at ../../emacs-24.4/src/keyboard.c:2895
> #7 0x0000000000546170 in read_key_sequence (keybuf=0x7fff4c538fd0,
> bufsize=30, prompt=12752882, dont_downcase_last=false,
> can_return_switch_frame=true, fix_current_buffer=true,
> prevent_redisplay=false) at ../../emacs-24.4/src/keyboard.c:9088
> #8 0x00000000005375c1 in command_loop_1 ()
> at ../../emacs-24.4/src/keyboard.c:1452
> #9 0x00000000005c970b in internal_condition_case (
> bfun=0x5371f9 <command_loop_1>, handlers=12804482,
> hfun=0x536ae8 <cmd_error>) at ../../emacs-24.4/src/eval.c:1348
> #10 0x0000000000536f53 in command_loop_2 (ignore=12752882)
> at ../../emacs-24.4/src/keyboard.c:1177
> #11 0x00000000005c8f1d in internal_catch (tag=12800418,
> func=0x536f2d <command_loop_2>, arg=12752882)
> at ../../emacs-24.4/src/eval.c:1112
> #12 0x0000000000536f01 in command_loop ()
> at ../../emacs-24.4/src/keyboard.c:1156
> #13 0x00000000005366e3 in recursive_edit_1 ()
> at ../../emacs-24.4/src/keyboard.c:777
> #14 0x0000000000536850 in Frecursive_edit ()
> at ../../emacs-24.4/src/keyboard.c:848
> #15 0x0000000000534867 in main (argc=2, argv=0x7fff4c5393d8)
> at ../../emacs-24.4/src/emacs.c:1646
> 
> backtrace thread 2:
> 
> (gdb) thread 2
> [Switching to thread 2 (Thread 0x7f789c1a5700 (LWP 26191))]
> #0 0x00007f789e04112d in poll () at ../sysdeps/unix/syscall-template.S:81
> 81 ../sysdeps/unix/syscall-template.S: No such file or directory.
> (gdb) backtrace
> #0 0x00007f789e04112d in poll () at ../sysdeps/unix/syscall-template.S:81
> #1 0x00007f789e57ffe4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #2 0x00007f789e5800ec in g_main_context_iteration ()
> from /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #3 0x00007f789e580129 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #4 0x00007f789e5a4f05 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #5 0x00007f789e321182 in start_thread (arg=0x7f789c1a5700)
> at pthread_create.c:312
> #6 0x00007f789e04e47d in clone ()
> at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
> 
> backtrace thread 3:
> 
> 0x00007f789e32920b in raise (sig=15)
> at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
> 37 ../nptl/sysdeps/unix/sysv/linux/pt-raise.c: No such file or directory.
> (gdb) backtrace
> #0 0x00007f789e32920b in raise (sig=15)
> at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
> #1 0x00007f789ced5adc in ffi_call_unix64 ()
> from /usr/lib/x86_64-linux-gnu/libffi.so.6
> #2 0x00007f789ced540c in ffi_call ()
> from /usr/lib/x86_64-linux-gnu/libffi.so.6
> #3 0x00007f789e850055 in g_cclosure_marshal_generic_va ()
> from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
> #4 0x00007f789e84f5e7 in ?? ()
> from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
> #5 0x00007f789e868088 in g_signal_emit_valist ()
> from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
> #6 0x00007f789e868ce2 in g_signal_emit ()
> from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
> #7 0x00007f789eb539d5 in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
> #8 0x00007f789e57fce5 in g_main_context_dispatch ()
> from /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #9 0x00007f789e580048 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #10 0x00007f789e5800ec in g_main_context_iteration ()
> from /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #11 0x00007f789b1851ad in ?? ()
> from /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
> #12 0x00007f789e5a4f05 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #13 0x00007f789e321182 in start_thread (arg=0x7f789b17d700)
> at pthread_create.c:312
> #14 0x00007f789e04e47d in clone ()
> at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Looks like thread 3, which runs some Glib code, deliberately killed
the entire process by raising SIGTERM.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22174; Package emacs. (Wed, 16 Dec 2015 19:39:02 GMT) Full text and rfc822 format available.

Message #17 received at 22174 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Cody Addison <cody.addison <at> gmail.com>
Cc: 22174 <at> debbugs.gnu.org
Subject: Re: bug#22174: 24.4; emacs --daemon crashes when ssh is disconnected.
 I am using lucid x toolkit.
Date: Wed, 16 Dec 2015 21:38:55 +0200
> Date: Wed, 16 Dec 2015 12:59:49 -0600
> From: Cody Addison <cody.addison <at> gmail.com>
> 
> Here is the result. I am including the backtrace of all 3 threads. The SIGTERM
> comes when I Ctrl-C the ssh command. I didn't expect that to pass through to
> the emacs daemon.

And why do you use Ctrl-C to interrupt ssh?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22174; Package emacs. (Wed, 16 Dec 2015 20:02:01 GMT) Full text and rfc822 format available.

Message #20 received at 22174 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Cody Addison <cody.addison <at> gmail.com>
Cc: 22174 <at> debbugs.gnu.org
Subject: Re: bug#22174: 24.4; emacs --daemon crashes when ssh is disconnected.
 I am using lucid x toolkit.
Date: Wed, 16 Dec 2015 22:02:07 +0200
[Please don't omit the bug address from the CC list.]

> Date: Wed, 16 Dec 2015 13:46:09 -0600
> From: Cody Addison <cody.addison <at> gmail.com>
> 
> Because it hangs. If I start ssh and don't open an emacsclient, exit works
> fine. However, if I start an emacsclient, exit hangs.

How do you exit?  What do you type to exit?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22174; Package emacs. (Wed, 16 Dec 2015 20:03:02 GMT) Full text and rfc822 format available.

Message #23 received at 22174 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Cody Addison <cody.addison <at> gmail.com>
Cc: 22174 <at> debbugs.gnu.org
Subject: Re: bug#22174: 24.4; emacs --daemon crashes when ssh is disconnected.
 I am using lucid x toolkit.
Date: Wed, 16 Dec 2015 22:02:50 +0200
[Resending to the bug address.]

> Date: Wed, 16 Dec 2015 13:48:07 -0600
> From: Cody Addison <cody.addison <at> gmail.com>
> 
> I'm still trying out a few things, but it seems that if I start emacs --daemon
> with DISPLAY unset, things seem to work fine. 

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22174; Package emacs. (Wed, 16 Dec 2015 20:05:02 GMT) Full text and rfc822 format available.

Message #26 received at 22174 <at> debbugs.gnu.org (full text, mbox):

From: Cody Addison <cody.addison <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 22174 <at> debbugs.gnu.org
Subject: Re: bug#22174: 24.4; emacs --daemon crashes when ssh is disconnected.
 I am using lucid x toolkit.
Date: Wed, 16 Dec 2015 14:04:07 -0600
[Message part 1 (text/plain, inline)]
I just type exit. I have also tried logout.

On Wed, Dec 16, 2015 at 2:02 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:

> [Resending to the bug address.]
>
> > Date: Wed, 16 Dec 2015 13:48:07 -0600
> > From: Cody Addison <cody.addison <at> gmail.com>
> >
> > I'm still trying out a few things, but it seems that if I start emacs
> --daemon
> > with DISPLAY unset, things seem to work fine.
>
> Thanks.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22174; Package emacs. (Wed, 16 Dec 2015 20:41:01 GMT) Full text and rfc822 format available.

Message #29 received at 22174 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Cody Addison <cody.addison <at> gmail.com>
Cc: 22174 <at> debbugs.gnu.org
Subject: Re: bug#22174: 24.4; emacs --daemon crashes when ssh is disconnected.
 I am using lucid x toolkit.
Date: Wed, 16 Dec 2015 22:40:34 +0200
> Date: Wed, 16 Dec 2015 14:04:07 -0600
> From: Cody Addison <cody.addison <at> gmail.com>
> Cc: 22174 <at> debbugs.gnu.org
> 
> I just type exit. I have also tried logout.

To the shell, after you already exited emacsclient frame?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22174; Package emacs. (Wed, 16 Dec 2015 20:45:01 GMT) Full text and rfc822 format available.

Message #32 received at 22174 <at> debbugs.gnu.org (full text, mbox):

From: Cody Addison <cody.addison <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 22174 <at> debbugs.gnu.org
Subject: Re: bug#22174: 24.4; emacs --daemon crashes when ssh is disconnected.
 I am using lucid x toolkit.
Date: Wed, 16 Dec 2015 14:44:23 -0600
[Message part 1 (text/plain, inline)]
Yes
On Dec 16, 2015 2:40 PM, "Eli Zaretskii" <eliz <at> gnu.org> wrote:

> > Date: Wed, 16 Dec 2015 14:04:07 -0600
> > From: Cody Addison <cody.addison <at> gmail.com>
> > Cc: 22174 <at> debbugs.gnu.org
> >
> > I just type exit. I have also tried logout.
>
> To the shell, after you already exited emacsclient frame?
>
[Message part 2 (text/html, inline)]

Merged 11676 14958 22174. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 05 May 2019 04:16:02 GMT) Full text and rfc822 format available.

Forcibly Merged 11676 14958 22174 35003. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 22 Jan 2022 15:33:02 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 115 days ago.

Previous Next


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