GNU bug report logs - #63633
Emacs becomes unresponsive when trying to ssh into localhost (MacOS)

Previous Next

Package: emacs;

Reported by: Arteen Abrishami <arteen1000 <at> gmail.com>

Date: Sun, 21 May 2023 22:12:02 UTC

Severity: normal

Tags: notabug

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 63633 in the body.
You can then email your comments to 63633 AT debbugs.gnu.org in the normal way.

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#63633; Package emacs. (Sun, 21 May 2023 22:12:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Arteen Abrishami <arteen1000 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 21 May 2023 22:12:02 GMT) Full text and rfc822 format available.

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

From: Arteen Abrishami <arteen1000 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Emacs becomes unresponsive when trying to ssh into localhost (MacOS)
Date: Sun, 21 May 2023 15:11:37 -0700
[Message part 1 (text/plain, inline)]
I have a Linux VM that I ssh into from my MacOS machine. From the terminal, in shell, this looks like: `ssh user <at> localhost -p 2222`. This works.

I also am able to use tramp to ssh into a different machine. On the terminal, this looks like `ssh machinename`. For tramp I use `M-x dired <RET> /ssh:machinename:/home/user <RET>`. 

I am trying to ssh into the localhost via emacs. I use `M-x dired <RET> /ssh:user <at> localhost#2222:/ <RET>`. This does not work. The message it will show is “Opening connection will for user <at> localhost using ssh…” forever.

Emacs will become unresponsive, and I will hear my fans very loudly. This continues for as long as I’ve let it. I have to Force Quit emacs. I am running GNU Emacs 30.0.50.

- Arteen
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63633; Package emacs. (Mon, 22 May 2023 08:15:01 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Arteen Abrishami <arteen1000 <at> gmail.com>
Cc: 63633 <at> debbugs.gnu.org
Subject: Re: bug#63633: Emacs becomes unresponsive when trying to ssh into
 localhost (MacOS)
Date: Mon, 22 May 2023 10:14:31 +0200
Arteen Abrishami <arteen1000 <at> gmail.com> writes:

Hi Arteen,

> I am trying to ssh into the localhost via emacs. I use `M-x dired
> <RET> /ssh:user <at> localhost#2222:/ <RET>`. This does not work. The
> message it will show is “Opening connection will for user <at> localhost
> using ssh…” forever.
>
> Emacs will become unresponsive, and I will hear my fans very loudly.
> This continues for as long as I’ve let it. I have to Force Quit emacs.
> I am running GNU Emacs 30.0.50.

Please run from the terminal

--8<---------------cut here---------------start------------->8---
# emacs -Q --eval '(setq tramp-verbose 10)' /ssh:user <at> localhost#2222:/
--8<---------------cut here---------------end--------------->8---

Interrupt with C-g if it hangs. There will be a buffer "*debug tramp/ssh
user <at> localhost#2222*" which will tell us what's up.

> - Arteen

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63633; Package emacs. (Mon, 22 May 2023 17:03:03 GMT) Full text and rfc822 format available.

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

From: Arteen Abrishami <arteen1000 <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 63633 <at> debbugs.gnu.org
Subject: Re: bug#63633: Emacs becomes unresponsive when trying to ssh into
 localhost (MacOS)
Date: Mon, 22 May 2023 10:01:42 -0700

> On May 22, 2023, at 1:14 AM, Michael Albinus <michael.albinus <at> gmx.de> wrote:

Hi Michael,

> 
> --8<---------------cut here---------------start------------->8---
> # emacs -Q --eval '(setq tramp-verbose 10)' /ssh:user <at> localhost#2222:/
> --8<---------------cut here---------------end--------------->8—
> 

Here’s the trace: 

‘''
  backtrace()
  tramp-error(nil quit "")
  tramp-signal-hook-function(quit nil)
  signal(quit nil)
  tramp-maybe-open-connection((tramp-file-name "ssh" "cs111" nil "localhost" "2222" "/" nil))
  tramp-send-command((tramp-file-name "ssh" "cs111" nil "localhost" "2222" "/" nil) "test 0 2>/dev/null; echo tramp_exit_status $?")
  tramp-send-command-and-check((tramp-file-name "ssh" "cs111" nil "localhost" "2222" "/" nil) "test 0")
  tramp-get-test-command((tramp-file-name "ssh" "cs111" nil "localhost" "2222" "/" nil))
  tramp-run-test((tramp-file-name "ssh" "cs111" nil "localhost" "2222" "/" nil) "-d" "/")
  tramp-sh-handle-file-directory-p("/ssh:cs111 <at> localhost#2222:/")
  tramp-sh-file-name-handler(file-directory-p "/ssh:cs111 <at> localhost#2222:/")
  apply(tramp-sh-file-name-handler file-directory-p "/ssh:cs111 <at> localhost#2222:/")
  tramp-file-name-handler(file-directory-p "/ssh:cs111 <at> localhost#2222:/")
  file-directory-p("/ssh:cs111 <at> localhost#2222:/")
  find-file-noselect("/ssh:cs111 <at> localhost#2222:/")
  command-line-1(("--eval" "(setq tramp-verbose 10)" "/ssh:cs111 <at> localhost#2222:/"))
  command-line()
  normal-top-level()
‘''

I also confirmed that an ssh from my terminal outside of emacs works.



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63633; Package emacs. (Mon, 22 May 2023 17:24:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Arteen Abrishami <arteen1000 <at> gmail.com>
Cc: 63633 <at> debbugs.gnu.org
Subject: Re: bug#63633: Emacs becomes unresponsive when trying to ssh into
 localhost (MacOS)
Date: Mon, 22 May 2023 19:23:11 +0200
Arteen Abrishami <arteen1000 <at> gmail.com> writes:

> Hi Michael,

Hi Arteen,

>> --8<---------------cut here---------------start------------->8---
>> # emacs -Q --eval '(setq tramp-verbose 10)' /ssh:user <at> localhost#2222:/
>> --8<---------------cut here---------------end--------------->8—
>
> Here’s the trace: 

This is not what I've asked for. There is a Tramp debug buffer, which I
need to see. Please send it completely, as attachment.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63633; Package emacs. (Mon, 22 May 2023 19:26:01 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Arteen Abrishami <arteen1000 <at> gmail.com>
Cc: 63633 <at> debbugs.gnu.org
Subject: Re: bug#63633: Emacs becomes unresponsive when trying to ssh into
 localhost (MacOS)
Date: Mon, 22 May 2023 21:25:16 +0200
Arteen Abrishami <arteen1000 <at> gmail.com> writes:

Hi Arteen,

> The trace I sent was under ‘*debug tramp*’. There is also another under *debug tramp/ssh cs111 <at> localhost#2222*’. I’m attaching both. The second is quite large. 

Thanks. I know it is large, but this is part of the analysis.

--8<---------------cut here---------------start------------->8---
> 11:21:04.120251 tramp-send-command (6) # exec ssh -l cs111 -p 2222 -o ControlMaster=auto -o ControlPath=tramp.%C -o ControlPersist=no -e none localhost
> 11:21:17.538440 tramp-search-regexp (1) # Quit: "Quit", ""
> Last login: Mon May 22 04:19:56 2023 from 10.0.2.2
> %                                                                               [01;32mcs111 <at> cs111[00m [01;34m~[00m [00m [?2004h
--8<---------------cut here---------------end--------------->8---

Tramp has sent the "ssh -l ..." command. As result, it tries to detect
the shell prompt. It fails, because there are escape control sequences.

Pls teach your remote host NOT to send these characters. The Tramp
manual discusses the case.

If your remote shell is zsh, for example, you must add to the remote
~/.zshrc file

--8<---------------cut here---------------start------------->8---
[[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63633; Package emacs. (Mon, 22 May 2023 21:34:01 GMT) Full text and rfc822 format available.

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

From: Arteen Abrishami <arteen1000 <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 63633 <at> debbugs.gnu.org
Subject: Re: bug#63633: Emacs becomes unresponsive when trying to ssh into
 localhost (MacOS)
Date: Mon, 22 May 2023 14:33:14 -0700
Thanks. This works.

As an aside, I am finding that within the ssh session, inside eshell, if I update directory contents (via “rm” for example), it takes about 10 seconds for “ls” to recognize the fact that the file has been removed, and for the first few “ls” after removal it will note that the file is still there.

Would this be a separate issue?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63633; Package emacs. (Mon, 22 May 2023 21:46:03 GMT) Full text and rfc822 format available.

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

From: Arteen Abrishami <arteen1000 <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 63633 <at> debbugs.gnu.org
Subject: Re: bug#63633: Emacs becomes unresponsive when trying to ssh into
 localhost (MacOS)
Date: Mon, 22 May 2023 11:28:22 -0700
[Message part 1 (text/plain, inline)]
> This is not what I've asked for. There is a Tramp debug buffer, which I
> need to see. Please send it completely, as attachment.
> 
The trace I sent was under ‘*debug tramp*’. There is also another under *debug tramp/ssh cs111 <at> localhost#2222*’. I’m attaching both. The second is quite large. 

[debug-tramp.txt (text/plain, attachment)]
[debug-tramp-ssh.txt (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63633; Package emacs. (Tue, 23 May 2023 02:35:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Arteen Abrishami <arteen1000 <at> gmail.com>
Cc: 63633 <at> debbugs.gnu.org, michael.albinus <at> gmx.de
Subject: Re: bug#63633: Emacs becomes unresponsive when trying to ssh into
 localhost (MacOS)
Date: Tue, 23 May 2023 05:34:49 +0300
> Cc: 63633 <at> debbugs.gnu.org
> Resent-To: 63633-quiet <at> debbugs.gnu.org
> From: Arteen Abrishami <arteen1000 <at> gmail.com>
> Date: Mon, 22 May 2023 11:28:22 -0700
> 
> > This is not what I've asked for. There is a Tramp debug buffer, which I
> > need to see. Please send it completely, as attachment.
> > 
> The trace I sent was under ‘*debug tramp*’. There is also another under *debug tramp/ssh cs111 <at> localhost#2222*’. I’m attaching both. The second is quite large. 

Please always compress large (> 1MB) attachments.  This one was 15MB.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63633; Package emacs. (Tue, 23 May 2023 07:17:01 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 63633 <at> debbugs.gnu.org, Arteen Abrishami <arteen1000 <at> gmail.com>
Subject: Re: bug#63633: Emacs becomes unresponsive when trying to ssh into
 localhost (MacOS)
Date: Tue, 23 May 2023 09:16:47 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

Hi Eli,

>> > This is not what I've asked for. There is a Tramp debug buffer, which I
>> > need to see. Please send it completely, as attachment.
>> > 
>> The trace I sent was under ‘*debug tramp*’. There is also another under *debug tramp/ssh cs111 <at> localhost#2222*’. I’m attaching both. The second is quite large. 
>
> Please always compress large (> 1MB) attachments.  This one was 15MB.

This was my fault, not the fault of Arteen. Sorry.

I'll try to be more precise with the instructions for traces I give to
users.

Best regards, Michael.




Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Tue, 23 May 2023 07:43:02 GMT) Full text and rfc822 format available.

Notification sent to Arteen Abrishami <arteen1000 <at> gmail.com>:
bug acknowledged by developer. (Tue, 23 May 2023 07:43:02 GMT) Full text and rfc822 format available.

Message #34 received at 63633-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Arteen Abrishami <arteen1000 <at> gmail.com>
Cc: 63633-done <at> debbugs.gnu.org
Subject: Re: bug#63633: Emacs becomes unresponsive when trying to ssh into
 localhost (MacOS)
Date: Tue, 23 May 2023 09:42:02 +0200
Arteen Abrishami <arteen1000 <at> gmail.com> writes:

> Thanks. This works.

Thanks for the confirmation. Closing the bug.

> As an aside, I am finding that within the ssh session, inside eshell,
> if I update directory contents (via “rm” for example), it takes about
> 10 seconds for “ls” to recognize the fact that the file has been
> removed, and for the first few “ls” after removal it will note that
> the file is still there.
>
> Would this be a separate issue?

I cannot reproduce it here. Please check, which "rm" command you use,
you'll see it in the *eshell* buffer:

--8<---------------cut here---------------start------------->8---
~ $ which rm
eshell/rm is a byte-compiled Lisp function in ‘em-unix.el’.
--8<---------------cut here---------------end--------------->8---

If it is the same for you, please write a new bug report. Append the
contents of your *eshell* buffer in order to see the commands, and in
order to reproduce it locally.

Best regards, Michael.




Added tag(s) notabug. Request was from Michael Albinus <michael.albinus <at> gmx.de> to control <at> debbugs.gnu.org. (Tue, 23 May 2023 07:49:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 20 Jun 2023 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 326 days ago.

Previous Next


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