unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#985: 23.0.60; emacsclient -c error on first time in new SSH sessions
@ 2008-09-16 14:04 ` Markus Triska
  2008-09-16 15:23   ` Stefan Monnier
  2008-10-07 18:00   ` bug#985: marked as done (23.0.60; emacsclient -c error on first time in new SSH sessions) Emacs bug Tracking System
  0 siblings, 2 replies; 3+ messages in thread
From: Markus Triska @ 2008-09-16 14:04 UTC (permalink / raw)
  To: emacs-pretest-bug

On machine A (Ubuntu Intrepid), I do:

   $ emacs -nw -Q -f server-start

From machine B (OSX 10.4 or Ubuntu Intrepid running in Virtualbox), I
SSH to machine A:

   $ ssh -X -Y <machine A>

and then, in the SSH session, do:

   $ emacsclient -c

As expected, I get an X frame on machine B. I then close that frame
(C-x 5 0) and the SSH session (C-d) and, from B, SSH to A again:

   $ ssh -X -Y <machine A>

When I then do "emacsclient -c" in the SSH session, it says:

   Waiting for Emacs...
   *ERROR*: Connection lost to X server `localhost:10.0'

When I then again do "emacsclient -c", it works without problems, and
I get again an X frame on machine B every further time I do it.

In GNU Emacs 23.0.60.4 (i386-apple-darwin8.11.1, GTK+ Version 2.12.9)
 of 2008-09-14 on mt-computer.local
Windowing system distributor `The XFree86 Project, Inc', version 11.0.40400000
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t







^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#985: 23.0.60; emacsclient -c error on first time in new SSH sessions
  2008-09-16 14:04 ` bug#985: 23.0.60; emacsclient -c error on first time in new SSH sessions Markus Triska
@ 2008-09-16 15:23   ` Stefan Monnier
  2008-10-07 18:00   ` bug#985: marked as done (23.0.60; emacsclient -c error on first time in new SSH sessions) Emacs bug Tracking System
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2008-09-16 15:23 UTC (permalink / raw)
  To: Markus Triska; +Cc: emacs-pretest-bug, 985

> On machine A (Ubuntu Intrepid), I do:
>    $ emacs -nw -Q -f server-start

>> From machine B (OSX 10.4 or Ubuntu Intrepid running in Virtualbox), I
> SSH to machine A:

>    $ ssh -X -Y <machine A>

> and then, in the SSH session, do:

>    $ emacsclient -c

> As expected, I get an X frame on machine B. I then close that frame
> (C-x 5 0) and the SSH session (C-d) and, from B, SSH to A again:

>    $ ssh -X -Y <machine A>

> When I then do "emacsclient -c" in the SSH session, it says:

>    Waiting for Emacs...
>    *ERROR*: Connection lost to X server `localhost:10.0'

> When I then again do "emacsclient -c", it works without problems, and
> I get again an X frame on machine B every further time I do it.

I think I know what's going on: even tho you've closed the frame,
Emacs did not close the X11 connection, so when you ssh in again and try
"emacsclient -c" a second time (and with the same
DISPLAY=localhost:10.0), Emacs tries to reuse the old connection, which
fails because that X11-proxy was killed along with your first
ssh session.  At that point, Emacs throws away this stale connection, so
that the next attempt works again.

I guess Emacs could/should disconnect from the X server as soon as the
last frame is closed.


        Stefan






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#985: marked as done (23.0.60; emacsclient -c error on first  time in new SSH sessions)
  2008-09-16 14:04 ` bug#985: 23.0.60; emacsclient -c error on first time in new SSH sessions Markus Triska
  2008-09-16 15:23   ` Stefan Monnier
@ 2008-10-07 18:00   ` Emacs bug Tracking System
  1 sibling, 0 replies; 3+ messages in thread
From: Emacs bug Tracking System @ 2008-10-07 18:00 UTC (permalink / raw)
  To: Chong Yidong

[-- Attachment #1: Type: text/plain, Size: 885 bytes --]


Your message dated Tue, 07 Oct 2008 13:51:38 -0400
with message-id <87wsgkthsl.fsf@cyd.mit.edu>
and subject line Re: 23.0.60; emacsclient -c error on first time in new SSH sessions
has caused the Emacs bug report #985,
regarding 23.0.60; emacsclient -c error on first time in new SSH sessions
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact don@donarmstrong.com
immediately.)


-- 
985: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=985
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 3222 bytes --]

From: Markus Triska <markus.triska@gmx.at>
To: emacs-pretest-bug@gnu.org
Subject: 23.0.60; emacsclient -c error on first time in new SSH sessions
Date: Tue, 16 Sep 2008 16:04:27 +0200 (CEST)
Message-ID: <20080916140427.31679AE46AE@mt-computer.local>

On machine A (Ubuntu Intrepid), I do:

   $ emacs -nw -Q -f server-start

From machine B (OSX 10.4 or Ubuntu Intrepid running in Virtualbox), I
SSH to machine A:

   $ ssh -X -Y <machine A>

and then, in the SSH session, do:

   $ emacsclient -c

As expected, I get an X frame on machine B. I then close that frame
(C-x 5 0) and the SSH session (C-d) and, from B, SSH to A again:

   $ ssh -X -Y <machine A>

When I then do "emacsclient -c" in the SSH session, it says:

   Waiting for Emacs...
   *ERROR*: Connection lost to X server `localhost:10.0'

When I then again do "emacsclient -c", it works without problems, and
I get again an X frame on machine B every further time I do it.

In GNU Emacs 23.0.60.4 (i386-apple-darwin8.11.1, GTK+ Version 2.12.9)
 of 2008-09-14 on mt-computer.local
Windowing system distributor `The XFree86 Project, Inc', version 11.0.40400000
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t




[-- Attachment #3: Type: message/rfc822, Size: 2495 bytes --]

From: Chong Yidong <cyd@stupidchicken.com>
To: Markus Triska <markus.triska@gmx.at>
Cc: "Stefan Monnier" <monnier@IRO.UMontreal.CA>, 985-done@emacsbugs.donarmstrong.com, "Jan Djärv" <jan.h.d@swipnet.se>
Subject: Re: 23.0.60; emacsclient -c error on first time in new SSH sessions
Date: Tue, 07 Oct 2008 13:51:38 -0400
Message-ID: <87wsgkthsl.fsf@cyd.mit.edu>

> > On machine A, I do:
> >    $ emacs -nw -Q -f server-start
> > From machine B, I SSH to machine A:
> >    $ ssh -X -Y <machine A>
> >    $ emacsclient -c
> > As expected, I get an X frame on machine B. I then close that frame
> > (C-x 5 0) and the SSH session (C-d) and, from B, SSH to A again:
> >    $ ssh -X -Y <machine A>
> > When I then do "emacsclient -c" in the SSH session, it says:
> >    Waiting for Emacs...
> >    *ERROR*: Connection lost to X server `localhost:10.0'
>
> I think I know what's going on: even tho you've closed the frame,
> Emacs did not close the X11 connection, so when you ssh in again and
> try "emacsclient -c" a second time (and with the same
> DISPLAY=localhost:10.0), Emacs tries to reuse the old connection,
> which fails because that X11-proxy was killed along with your first
> ssh session.  At that point, Emacs throws away this stale connection,
> so that the next attempt works again.
>
> I guess Emacs could/should disconnect from the X server as soon as the
> last frame is closed.

Emacs does attempt to close the connection: see x_delete_terminal in
xterm.c:10634.  With GTK support, this calls xg_display_close, which
tries to keep a display open to avoid a GTK crash when no default
display exists.  This prevents the display from disconnecting properly.

I've just installed a fix that allows Emacs to disconnect properly,
while still avoiding the GTK crash.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-10-07 18:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87wsgkthsl.fsf@cyd.mit.edu>
2008-09-16 14:04 ` bug#985: 23.0.60; emacsclient -c error on first time in new SSH sessions Markus Triska
2008-09-16 15:23   ` Stefan Monnier
2008-10-07 18:00   ` bug#985: marked as done (23.0.60; emacsclient -c error on first time in new SSH sessions) Emacs bug Tracking System

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).