bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs dies on very early "X connection to ... broken"


From: Todd Allen
Subject: emacs dies on very early "X connection to ... broken"
Date: Sun, 10 Jun 2001 22:24:59 -0600 (MDT)

I discovered this by initiating an emacs session, and then trying to execute
M-x make-frame-on-display and then specifying a display which really was an
forwarded port using ssh.  The .Xauthority records that were available to
emacs didn't match the ones that the ssh session had set up.  And ssh refused
the connection quite forcefully.  Emacs tried to recover, but its recovery
process produced an error and the tool died.

This is with:
GNU Emacs 20.7.1 (i386-redhat-linux-gnu, X toolkit) of Tue Oct 10 2000 on 
porky.devel.redhat.com

To reproduce this, you'll need ssh, and it will have to be configured to do
X11 port forwarding.  I'll provide a couple sanity checks in the example.

First, open an ssh connection from machine A to machine B.  You should have a
shell prompt on machine B.  Determine the forwarded port on machine B with:

   echo $DISPLAY

It should be something like "machineB:10.0".  If that worked, then ssh is
configured and doing X11 port forwarding.  Leave this shell open, so we can
use the display machineB:10.0, but do NOT do any of the rest of the commands
from the shell there.  Issue the rest of these commands from pretty much
anywhere else.

I'll use "machineB:10.0" as the display in the rest of my example.  You'll
need to replace it with whatever you got.

Issue xdpyinfo -display "machineB:10.0".  It should respond with:

   X connection to machineB:10.0 broken (explicit kill or server shutdown).

That's ssh's overly forceful way of rejecting the connection based on a lack
of proper authority records.

If you've got this far, then your test arrangement is all set up.  Now, start
emacs:

   emacs --no-init-file -synchronous

and then:

   M-x make-frame-on-display machineB:10.0

The emacs session will die with:

   Error: Couldn't find per display information

There may be other circumstances than just ssh port-forwared Xservers that
could cause a dead connection very early in the process, too.  I don't think
they should crash the whole emacs session.

It occurs to me that getting this test rig set up may prove difficult, so I'm
providing a walkback from gdb.  It may prove easier to see what went wrong
from that:

#0  exit (status=1) at exit.c:40
#1  0x40096338 in _XtDefaultError () from /usr/X11R6/lib/libXt.so.6
#2  0x400963bd in XtError () from /usr/X11R6/lib/libXt.so.6
#3  0x40095f7b in XtAppGetErrorDatabaseText () from /usr/X11R6/lib/libXt.so.6
#4  0x40095fc8 in _XtDefaultErrorMsg () from /usr/X11R6/lib/libXt.so.6
#5  0x40096051 in XtErrorMsg () from /usr/X11R6/lib/libXt.so.6
#6  0x4009532f in _XtSortPerDisplayList () from /usr/X11R6/lib/libXt.so.6
#7  0x400958af in _XtGetPerDisplay () from /usr/X11R6/lib/libXt.so.6
#8  0x4009538b in XtDisplayToApplicationContext ()
   from /usr/X11R6/lib/libXt.so.6
#9  0x4009567d in XtCloseDisplay () from /usr/X11R6/lib/libXt.so.6
#10 0x80a221a in x_connection_closed (display=0x8473460, 
    error_message=0xbfffbac0 "Connection lost to X server `trex:10.0'")
    at /usr/src/redhat/BUILD/emacs-20.7/src/xterm.c:5268
#11 0x80a258b in x_io_error_quitter (display=0x8473460)
    at /usr/src/redhat/BUILD/emacs-20.7/src/xterm.c:5368
#12 0x40131e0e in _XIOError () from /usr/X11R6/lib/libX11.so.6
#13 0x4012f6a4 in _XRead () from /usr/X11R6/lib/libX11.so.6
#14 0x40121a23 in XOpenDisplay () from /usr/X11R6/lib/libX11.so.6
#15 0x4009483c in XtOpenDisplay () from /usr/X11R6/lib/libXt.so.6
#16 0x80a547f in x_term_init (display_name=943743904, xrm_option=0x0, 
    resource_name=0x83fcbfc "emacs")
    at /usr/src/redhat/BUILD/emacs-20.7/src/xterm.c:7141
#17 0x80ae87a in x_display_info_for_name (name=943743904)
    at /usr/src/redhat/BUILD/emacs-20.7/src/xfns.c:5096
#18 0x80a6336 in check_x_display_info (frame=943743904)
    at /usr/src/redhat/BUILD/emacs-20.7/src/xfns.c:274
#19 0x80ad01b in Fx_create_frame (parms=1480417588)
    at /usr/src/redhat/BUILD/emacs-20.7/src/xfns.c:3239
#20 0x8138215 in Ffuncall (nargs=2, args=0xbfffbfe0)
    at /usr/src/redhat/BUILD/emacs-20.7/src/eval.c:2467
#21 0x817bfe3 in Fbyte_code (bytestr=941640060, vector=1210075824, maxdepth=6)
    at /usr/src/redhat/BUILD/emacs-20.7/src/bytecode.c:433
#22 0x8138a5a in funcall_lambda (fun=1210075476, nargs=1, 
    arg_vector=0xbfffc194) at /usr/src/redhat/BUILD/emacs-20.7/src/eval.c:2654
#23 0x81383fb in Ffuncall (nargs=2, args=0xbfffc190)
    at /usr/src/redhat/BUILD/emacs-20.7/src/eval.c:2515
#24 0x817bfe3 in Fbyte_code (bytestr=941610320, vector=1210045808, maxdepth=3)
    at /usr/src/redhat/BUILD/emacs-20.7/src/bytecode.c:433
#25 0x8138a5a in funcall_lambda (fun=1210045728, nargs=1, 
    arg_vector=0xbfffc334) at /usr/src/redhat/BUILD/emacs-20.7/src/eval.c:2654
#26 0x81383fb in Ffuncall (nargs=2, args=0xbfffc330)
    at /usr/src/redhat/BUILD/emacs-20.7/src/eval.c:2515
#27 0x817bfe3 in Fbyte_code (bytestr=941609856, vector=1210045344, maxdepth=3)
    at /usr/src/redhat/BUILD/emacs-20.7/src/bytecode.c:433
#28 0x8138a5a in funcall_lambda (fun=1210045256, nargs=1, 
    arg_vector=0xbfffc504) at /usr/src/redhat/BUILD/emacs-20.7/src/eval.c:2654
#29 0x81383fb in Ffuncall (nargs=2, args=0xbfffc500)
    at /usr/src/redhat/BUILD/emacs-20.7/src/eval.c:2515
#30 0x8133a80 in Fcall_interactively (function=406534420, 
    record_flag=405664500, keys=1211072424)
    at /usr/src/redhat/BUILD/emacs-20.7/src/callint.c:790
#31 0x80c5549 in Fcommand_execute (cmd=406534420, record_flag=405664500, 
    keys=405664452, special=405664452)
    at /usr/src/redhat/BUILD/emacs-20.7/src/keyboard.c:7984
#32 0x80c58df in Fexecute_extended_command (prefixarg=405664452)
    at /usr/src/redhat/BUILD/emacs-20.7/src/keyboard.c:8088
#33 0x8138215 in Ffuncall (nargs=2, args=0xbfffc890)
    at /usr/src/redhat/BUILD/emacs-20.7/src/eval.c:2467
#34 0x8133a80 in Fcall_interactively (function=405840164, 
    record_flag=405664452, keys=1211072424)
    at /usr/src/redhat/BUILD/emacs-20.7/src/callint.c:790
#35 0x80c5549 in Fcommand_execute (cmd=405840164, record_flag=405664452, 
    keys=405664452, special=405664452)
    at /usr/src/redhat/BUILD/emacs-20.7/src/keyboard.c:7984
#36 0x80baa5c in command_loop_1 ()
    at /usr/src/redhat/BUILD/emacs-20.7/src/keyboard.c:1502
#37 0x8135b62 in internal_condition_case (bfun=0x80b9650 <command_loop_1>, 
    handlers=405664956, hfun=0x80b9210 <cmd_error>)
    at /usr/src/redhat/BUILD/emacs-20.7/src/eval.c:1150
#38 0x80b94d8 in command_loop_2 ()
    at /usr/src/redhat/BUILD/emacs-20.7/src/keyboard.c:1093
#39 0x81355eb in internal_catch (tag=405664932, 
    func=0x80b94b0 <command_loop_2>, arg=405664452)
    at /usr/src/redhat/BUILD/emacs-20.7/src/eval.c:925
#40 0x80b9445 in command_loop ()
    at /usr/src/redhat/BUILD/emacs-20.7/src/keyboard.c:1072
#41 0x80b8fd7 in recursive_edit_1 ()
    at /usr/src/redhat/BUILD/emacs-20.7/src/keyboard.c:821
#42 0x80b90fe in Frecursive_edit ()
    at /usr/src/redhat/BUILD/emacs-20.7/src/keyboard.c:869
#43 0x80b7c62 in main (argc=3, argv=0xbfffd114, envp=0xbfffd124)
    at /usr/src/redhat/BUILD/emacs-20.7/src/emacs.c:1361
#44 0x40268f31 in __libc_start_main (main=0x80b6ed0 <main>, argc=3, 
    ubp_av=0xbfffd114, init=0x804c958 <_init>, fini=0x8194934 <_fini>, 
    rtld_fini=0x4000e274Reading in symbols for dl-fini.c...done.
 <_dl_fini>, stack_end=0xbfffd10c) at ../sysdeps/generic/libc-start.c:129

I suspect that it's getting a new failure because it's trying to close a
connection that it never successfully opened in the first place.

-- 
Todd Allen
Concurrent Computer Corporation



reply via email to

[Prev in Thread] Current Thread [Next in Thread]