unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22452: 24.4; Tramp remote shell fails on remote+sudo+homedir destination
@ 2016-01-24  2:00 Ken Manheimer
  2016-01-24  2:20 ` Ken Manheimer
  2016-01-24 17:48 ` Michael Albinus
  0 siblings, 2 replies; 8+ messages in thread
From: Ken Manheimer @ 2016-01-24  2:00 UTC (permalink / raw)
  To: 22452

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

Tramp fails to start a remote shell when the remote path is exactly of
the form '/ssh:host|sudo:root@host:'. It fails with a message in the
minibuffer, "Selecting deleted buffer".

To reproduce the error:

* Start emacs with -Q
* In any buffer (*scratch* is fine):
  M-Esc (setq default-directory "/ssh:example.com|sudo:root@example.com:")
* In that same buffer, Esc-x shell

This fails (with "Selecting deleted buffer") for me in the version of
emacs listed in the bug report and more recent versions, which I
compiled, eg: GNU Emacs 24.5.50.1 (x86_64-apple-darwin14.5.0, NS
apple-appkit-1348.17) of 2015-12-16 on twist.myriadicity.net.

I can't get a backtrace for it, even if I set debug-on-error and
signal-on-error.





In GNU Emacs 24.4.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21)
 of 2014-10-20 on builder10-9.porkrind.org
Windowing system distributor `Apple', version 10.3.1348
Configured using:
 `configure --with-ns'

Important settings:
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-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
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-: C-y <return> M-x s h e l l <return> M-x e m a c
s - r C-a C-k r e p o r t - e m <tab> <return>

Recent messages:
Tramp: Opening connection for root@myr using sudo...
Tramp: Sending command `exec ssh   -o
ControlPath=/var/folders/5s/5565scz120l9bsp9y97gn3hr0000gn/T/tramp.75422Jhp.%r@%h:%p
-o ControlMaster=auto -o ControlPersist=no -e none myr'
Tramp: Waiting for prompts from remote shell...done
Tramp: Found remote shell prompt on `myr'
Tramp: Sending command `exec env SHELL=/bin/sh sudo -u root -s -H -p
Password:'
Tramp: Waiting for prompts from remote shell...done
Tramp: Found remote shell prompt on `myr'
Tramp: Opening connection for root@myr using sudo...done
Tramp: Waiting for prompts from remote shell...failed
Tramp: Opening connection for root@myr using sudo...failed
byte-code: Selecting deleted buffer

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rfc822 mml easymenu mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils tramp-cmds
tramp-cache tramp-sh tramp tramp-compat auth-source eieio byte-opt
bytecomp byte-compile cconv eieio-core gnus-util mm-util mail-prsvr
password-cache tramp-loaddefs trampver shell pcomplete comint ansi-color
ring format-spec advice help-fns time-date tooltip electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel ns-win 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
cocoa ns multi-tty emacs)

Memory information:
((conses 16 93141 15547)
 (symbols 48 19906 0)
 (miscs 40 41 132)
 (strings 32 19106 30804)
 (string-bytes 1 574404)
 (vectors 16 12830)
 (vector-slots 8 421987 6836)
 (floats 8 115 514)
 (intervals 56 180 0)
 (buffers 960 13))

[-- Attachment #2: Type: text/html, Size: 5137 bytes --]

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

* bug#22452: 24.4; Tramp remote shell fails on remote+sudo+homedir destination
  2016-01-24  2:00 bug#22452: 24.4; Tramp remote shell fails on remote+sudo+homedir destination Ken Manheimer
@ 2016-01-24  2:20 ` Ken Manheimer
  2016-01-24 17:48 ` Michael Albinus
  1 sibling, 0 replies; 8+ messages in thread
From: Ken Manheimer @ 2016-01-24  2:20 UTC (permalink / raw)
  To: 22452

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

Please note that the problem only occurs when the remote path ends with
syntax that denotes the target home directory  -  "...:" or "...:~").

Ie, the shell start problem does not happen if you allow something like
emacs' "cd" function to take the remote path and fill in the explicit home
directory path. That's specifically why I set the starting buffer's
default-directory to the target path, rather than using CD.

Ken

[-- Attachment #2: Type: text/html, Size: 537 bytes --]

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

* bug#22452: 24.4; Tramp remote shell fails on remote+sudo+homedir destination
  2016-01-24  2:00 bug#22452: 24.4; Tramp remote shell fails on remote+sudo+homedir destination Ken Manheimer
  2016-01-24  2:20 ` Ken Manheimer
@ 2016-01-24 17:48 ` Michael Albinus
  2016-01-24 18:38   ` Ken Manheimer
  1 sibling, 1 reply; 8+ messages in thread
From: Michael Albinus @ 2016-01-24 17:48 UTC (permalink / raw)
  To: Ken Manheimer; +Cc: 22452

Ken Manheimer <ken.manheimer@gmail.com> writes:

Hi Ken,

> Tramp fails to start a remote shell when the remote path is exactly of
> the form '/ssh:host|sudo:root@host:'. It fails with a message in the
> minibuffer, "Selecting deleted buffer".
>
> To reproduce the error:
>
> * Start emacs with -Q
> * In any buffer (*scratch* is fine):
> M-Esc (setq default-directory
> "/ssh:example.com|sudo:root@example.com:")
> * In that same buffer, Esc-x shell
>
> This fails (with "Selecting deleted buffer") for me in the version of
> emacs listed in the bug report and more recent versions, which I
> compiled, eg: GNU Emacs 24.5.50.1 (x86_64-apple-darwin14.5.0, NS
> apple-appkit-1348.17) of 2015-12-16 on twist.myriadicity.net.
>
> I can't get a backtrace for it, even if I set debug-on-error and
> signal-on-error.

Same here, hard to debug. The error doesn't happen if tramp-verbose is
less than 3 prior calling M-x shell. So maybe you bind it temporarily to
2 in your package, as workaround.

I'll continue to debug.

Best regards, Michael.





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

* bug#22452: 24.4; Tramp remote shell fails on remote+sudo+homedir destination
  2016-01-24 17:48 ` Michael Albinus
@ 2016-01-24 18:38   ` Ken Manheimer
  2016-01-24 18:48     ` Michael Albinus
  2016-01-28 12:45     ` Michael Albinus
  0 siblings, 2 replies; 8+ messages in thread
From: Ken Manheimer @ 2016-01-24 18:38 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 22452

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

I'm glad you're investigating, Michael!

Interesting that changing tramp-verbose avoids the problem. Sounds like
that, in itself, might be a lead on the problem?

In any case, I do have a good workaround, which I'm sure you saw the reply,
in the follow-up I sent just a moment ago to you and emacs-devel. For the
sake of the bug transcript I'll repeat the substance of the message here:

I actually have a workaround, and the premise of it resides in the special
conditions I included for the repeating the problem. In order to repeat the
problem, you have to specifically use a default-directory that is set to
the remote+sudo+homedir format, and not allow something like `(cd path)' to
first resolve the home directory to an explicit path. So there's my
workaround, for multishell - use `(cd path)', rather than directly setting
default-directory.

Upshot is that I believe that there still is a bug worth unravelling
[especially since it involves an aggravating and elusive "Selecting deleted
buffer" event], in the way that shells start when default-directory is set
to remote+sudo+homedir format, but I can avoid that by using `cd'.

Ken

On Sun, Jan 24, 2016 at 12:48 PM, Michael Albinus <michael.albinus@gmx.de>
wrote:

> Ken Manheimer <ken.manheimer@gmail.com> writes:
>
> Hi Ken,
>
> > Tramp fails to start a remote shell when the remote path is exactly of
> > the form '/ssh:host|sudo:root@host:'. It fails with a message in the
> > minibuffer, "Selecting deleted buffer".
> >
> > To reproduce the error:
> >
> > * Start emacs with -Q
> > * In any buffer (*scratch* is fine):
> > M-Esc (setq default-directory
> > "/ssh:example.com|sudo:root@example.com:")
> > * In that same buffer, Esc-x shell
> >
> > This fails (with "Selecting deleted buffer") for me in the version of
> > emacs listed in the bug report and more recent versions, which I
> > compiled, eg: GNU Emacs 24.5.50.1 (x86_64-apple-darwin14.5.0, NS
> > apple-appkit-1348.17) of 2015-12-16 on twist.myriadicity.net.
> >
> > I can't get a backtrace for it, even if I set debug-on-error and
> > signal-on-error.
>
> Same here, hard to debug. The error doesn't happen if tramp-verbose is
> less than 3 prior calling M-x shell. So maybe you bind it temporarily to
> 2 in your package, as workaround.
>
> I'll continue to debug.
>
> Best regards, Michael.
>

[-- Attachment #2: Type: text/html, Size: 3355 bytes --]

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

* bug#22452: 24.4; Tramp remote shell fails on remote+sudo+homedir destination
  2016-01-24 18:38   ` Ken Manheimer
@ 2016-01-24 18:48     ` Michael Albinus
  2016-01-24 19:11       ` Ken Manheimer
  2016-01-28 12:45     ` Michael Albinus
  1 sibling, 1 reply; 8+ messages in thread
From: Michael Albinus @ 2016-01-24 18:48 UTC (permalink / raw)
  To: Ken Manheimer; +Cc: 22452

Ken Manheimer <ken.manheimer@gmail.com> writes:

Hi Ken,

> I'm glad you're investigating, Michael!

Yes. We are in the `expand-file-name' business. An absolute local file
name does not trigger any action; "~" or "" as local file name require
actions. The problem itself happens in `tramp-maybe-open-connection'.

But the "Selecting deleted buffer" error is hidden very well, likely by
an `ignore-errors' wrapper. And debugging changes the behaviour.

> Interesting that changing tramp-verbose avoids the problem. Sounds
> like that, in itself, might be a lead on the problem?

My guess is it is related to Tramp's debug buffer (it won't be touched
when tramp-verbose is less than 3). I'll continue to dig.

> Ken

Best regards, Michael.





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

* bug#22452: 24.4; Tramp remote shell fails on remote+sudo+homedir destination
  2016-01-24 18:48     ` Michael Albinus
@ 2016-01-24 19:11       ` Ken Manheimer
  0 siblings, 0 replies; 8+ messages in thread
From: Ken Manheimer @ 2016-01-24 19:11 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 22452

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

On Sun, Jan 24, 2016 at 1:48 PM, Michael Albinus <michael.albinus@gmx.de>
wrote:

> Ken Manheimer <ken.manheimer@gmail.com> writes:
>
> [...]

But the "Selecting deleted buffer" error is hidden very well, likely by
> an `ignore-errors' wrapper. And debugging changes the behaviour.
>

Ignore-errors wrappers are often not sufficiently thought through. An idea
I've often had is that code which legitimately is not interrupted by errors
is therefore, inherently, acting as a kind of "executive", responsible for
running code for something else. (Some common examples are read-eval-print
loops, more sophisticated ones are RPC services, interpreters, dev tools
like debuggers and profilers, etc.) While the executive needs to continue,
the part that's often insufficiently tended is a responsibility to convey
the error to the parties for which it's running the code, so they can react
accordingly.

That's a pretty darn abstract assessment, though, very vague about what
"convey the error" means.  In this case, it may just mean indicating more
about the code context where the error occurred, so that someone debugging
the problem has more leads to track it down. A language that I like for
this kind of thing, Python, provides library calls which expose the
traceback context, so that info can be explicitly included. Not sure if
emacs lisp has similar facilities.

Ken

> Interesting that changing tramp-verbose avoids the problem. Sounds
> > like that, in itself, might be a lead on the problem?
>
> My guess is it is related to Tramp's debug buffer (it won't be touched
> when tramp-verbose is less than 3). I'll continue to dig.
>
> > Ken
>
> Best regards, Michael.
>

[-- Attachment #2: Type: text/html, Size: 2869 bytes --]

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

* bug#22452: 24.4; Tramp remote shell fails on remote+sudo+homedir destination
  2016-01-24 18:38   ` Ken Manheimer
  2016-01-24 18:48     ` Michael Albinus
@ 2016-01-28 12:45     ` Michael Albinus
  2016-01-31 17:09       ` Ken Manheimer
  1 sibling, 1 reply; 8+ messages in thread
From: Michael Albinus @ 2016-01-28 12:45 UTC (permalink / raw)
  To: Ken Manheimer; +Cc: 22452-done

Version: 25.1

Ken Manheimer <ken.manheimer@gmail.com> writes:

> I'm glad you're investigating, Michael!
>
> Upshot is that I believe that there still is a bug worth unravelling
> [especially since it involves an aggravating and elusive "Selecting
> deleted buffer" event], in the way that shells start when
> default-directory is set to remote+sudo+homedir format, but I can
> avoid that by using `cd'.

Finally, I could fix it. While establishing the connection, a
`file-remote-p` call was performed which included `expand-file-name' of
`default-directory'. Since the connection wasn't stablished yet, the
error occured.

There won't be a new Emacs 24.x release, so I have fixed it in Emacs
25.1 (commit deae005667516b7e1296527f7e34c54604a81882). You could check
it there. In case of problems, pls tell.

> Ken

Best regards, Michael.





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

* bug#22452: 24.4; Tramp remote shell fails on remote+sudo+homedir destination
  2016-01-28 12:45     ` Michael Albinus
@ 2016-01-31 17:09       ` Ken Manheimer
  0 siblings, 0 replies; 8+ messages in thread
From: Ken Manheimer @ 2016-01-31 17:09 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 22452-done

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

Good job tracking that down - thanks much!

I may not be able to examine it soon, but will keep alert for problems.
Using `cd' instead of changing default-directory is proving to be a decent
workaround, worth sticking with since that means my package can work with
emacs 24 (and 23, for that matter).

On Thu, Jan 28, 2016 at 7:45 AM, Michael Albinus <michael.albinus@gmx.de>
wrote:

> Version: 25.1
>
> Ken Manheimer <ken.manheimer@gmail.com> writes:
>
> > I'm glad you're investigating, Michael!
> >
> > Upshot is that I believe that there still is a bug worth unravelling
> > [especially since it involves an aggravating and elusive "Selecting
> > deleted buffer" event], in the way that shells start when
> > default-directory is set to remote+sudo+homedir format, but I can
> > avoid that by using `cd'.
>
> Finally, I could fix it. While establishing the connection, a
> `file-remote-p` call was performed which included `expand-file-name' of
> `default-directory'. Since the connection wasn't stablished yet, the
> error occured.
>
> There won't be a new Emacs 24.x release, so I have fixed it in Emacs
> 25.1 (commit deae005667516b7e1296527f7e34c54604a81882). You could check
> it there. In case of problems, pls tell.
>
> > Ken
>
> Best regards, Michael.
>

[-- Attachment #2: Type: text/html, Size: 1824 bytes --]

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

end of thread, other threads:[~2016-01-31 17:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-24  2:00 bug#22452: 24.4; Tramp remote shell fails on remote+sudo+homedir destination Ken Manheimer
2016-01-24  2:20 ` Ken Manheimer
2016-01-24 17:48 ` Michael Albinus
2016-01-24 18:38   ` Ken Manheimer
2016-01-24 18:48     ` Michael Albinus
2016-01-24 19:11       ` Ken Manheimer
2016-01-28 12:45     ` Michael Albinus
2016-01-31 17:09       ` Ken Manheimer

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).