Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash using ssh on Windows #1470

Open
ferdinandyb opened this issue Feb 13, 2024 · 9 comments
Open

crash using ssh on Windows #1470

ferdinandyb opened this issue Feb 13, 2024 · 9 comments
Labels
bug Something isn't working platform: windows topics that directly address Windows platform

Comments

@ferdinandyb
Copy link
Contributor

Contour Terminal version

Contour Terminal Emulator 0.4.3.6442

Installer source

Github: source code cloned

Operating System

Windows

Architecture

x86-64

Other Software

No response

Steps to reproduce

I'm using tmux and vim most of the time, so it's really hard to tell if it happens with these or if it would happen with something else as well, but I'm using the ssh profile feature to connect to my local WSL. After a while input hangs and then it crashes.

Expected Behavior

No response

Actual Behavior

Here's the end of --debug all:

[2024-02-13 12:10:54.1568968.156896] [vt.trace.sequence] Processing SGR            CSI 48;5;236 m
[2024-02-13 12:10:54.1569555.156955] [vt.trace.sequence] text: "   "
[2024-02-13 12:10:54.1569975.156997] [vt.trace.sequence] Processing CUP            CSI 7;5 H
[2024-02-13 12:10:54.1570537.157053] [vt.trace.sequence] Processing DECRM          CSI ? 12 l
[2024-02-13 12:10:54.1571320.157132] [vt.trace.sequence] Processing DECSM          CSI ? 25 h
[2024-02-13 12:10:54.1572003.157200] [vt.trace.sequence] Processing SCS_G0_USASCII ESC ( B
[2024-02-13 12:10:54.1572593.157259] [vt.trace.sequence] Processing SGR            CSI m
[2024-02-13 12:10:54.1573053.157305] [vt.trace.sequence] Processing DECSM          CSI ? 2026 h
[2024-02-13 12:10:54.1573844.157368] [vt.trace.sequence] Processing DECRM          CSI ? 25 l
[2024-02-13 12:10:54.1574905.157490] [vt.trace.sequence] Processing SGR            CSI 38;5;84 m
[2024-02-13 12:10:54.1575684.157568] [vt.trace.sequence] Processing SGR            CSI 48;5;236 m
[2024-02-13 12:10:54.1576379.157637] [vt.trace.sequence] Processing CUP            CSI H
[2024-02-13 12:10:54.1576917.157691] [vt.trace.sequence] text: " 1: l/columnspecs.py+  "
[2024-02-13 12:10:54.1577817.157781] [vt.trace.sequence] Processing SGR            CSI 38;5;236 m
[2024-02-13 12:10:54.1578542.157854] [vt.trace.sequence] Processing SGR            CSI 48;5;239 m
[2024-02-13 12:10:54.1579196.157919] [vt.trace.sequence] text: ""
[2024-02-13 12:10:54.1579654.157965] [vt.trace.sequence] Processing SGR            CSI 38;5;253 m
[2024-02-13 12:10:54.1580595.158059] [vt.trace.sequence] text: " 5: spark_runner.py  ..."
[2024-02-13 12:10:54.1581729.158172] [vt.trace.sequence] Processing SGR            CSI 38;5;239 m
[2024-02-13 12:10:54.1582699.158269] [vt.trace.sequence] Processing SGR            CSI 48;5;237 m
[2024-02-13 12:10:54.1583804.158380] [vt.trace.sequence] text: ""
[2024-02-13 12:10:54.1584750.158474] [vt.trace.sequence] Processing SGR            CSI 38;5;236 m
[2024-02-13 12:10:54.1585646.158564] [vt.trace.sequence] text: "                       "
[2024-02-13 12:10:54.1586224.158622] [vt.trace.sequence] Processing SGR            CSI 38;5;237 m
[2024-02-13 12:10:54.1586892.158689] [vt.trace.sequence] text: ""
[2024-02-13 12:10:54.1587438.158743] [vt.trace.sequence] Processing SGR            CSI 38;5;61 m
[2024-02-13 12:10:54.1588167.158816] [gui.input] Key Release event received:  UpArrow
[2024-02-13 12:10:54.1621123.162112] [vt.trace.sequence] text: ""
[2024-02-13 12:10:54.1622055.162205] [gui.input] Key Repeat event received:  UpArrow
[2024-02-13 12:10:54.1622342.162234] [vt.trace.sequence] Processing SGR            CSI 38;5;253 m
[2024-02-13 12:10:54.1622761.162276] [vt.input] Sending  "UpArrow" Repeat.
[error] Failed to read from SSH channel. Decrypt failed

Additional notes

No response

@ferdinandyb ferdinandyb added the bug Something isn't working label Feb 13, 2024
@ferdinandyb
Copy link
Contributor Author

I'm just going to add a different example, maybe you can see a pattern:

[2024-02-13 12:47:31.3948360.394835] [vt.trace.sequence] Processing SGR            CSI 36 m
[2024-02-13 12:47:31.3948941.394894] [vt.trace.sequence] text: "2024-01-10 "
[2024-02-13 12:47:31.3949478.394947] [vt.trace.sequence] Processing SCS_G0_USASCII ESC ( B
[2024-02-13 12:47:31.3950042.395004] [vt.trace.sequence] Processing SGR            CSI m
[2024-02-13 12:47:31.3950575.395057] [vt.trace.sequence] Processing SGR            CSI 35 m
[2024-02-13 12:47:31.3951272.395127] [vt.trace.sequence] text: "Bence Ferdin.."
[2024-02-13 12:47:31.3951873.395187] [vt.trace.sequence] Processing SCS_G0_USASCII ESC ( B
[2024-02-13 12:47:31.3952282.395228] [vt.trace.sequence] Processing SGR            CSI m
[2024-02-13 12:47:31.3952717.395271] [vt.trace.sequence] text: " eval: add new dataset and refactor p-r-table"
[2024-02-13 12:47:31.3953253.395325] [vt.trace.sequence] Processing SGR            CSI 36 m
[2024-02-13 12:47:31.3953920.395392] [vt.trace.sequence] text: " "
[2024-02-13 12:47:31.3954358.395435] [vt.trace.sequence] Processing SCS_G0_USASCII ESC ( B
[2024-02-13 12:47:31.3954781.395478] [vt.trace.sequence] Processing SGR            CSI m
[2024-02-13 12:47:31.3955199.395519] [vt.trace.sequence] Processing EL             CSI K
[2024-02-13 12:47:31.3955890.395589] [vt.input] Sending mouse release Left  at (46, 14).
[error] Failed to read from SSH channel. Decrypt failed

@ferdinandyb
Copy link
Contributor Author

Hmm, I'm also doing double ssh right now (contour -> ssh into WSL -> ssh to remote machine -> tmux -> vim) so maybe it could also be related to that.

@ferdinandyb
Copy link
Contributor Author

If I don't use the contour ssh profile, but just open WSL via powershell as "normal" and then ssh away to the remote machine, then contour doesn't crash, but can hang for a bit. The input still seems to be received since after the freeze resolves itself actions done after the freeze are carried out (i.e. clicking on a tmux pane switches). I was again working in tmux, with vim and ipython on the remote. This freeze does not happen in Wezterm, so there's definitely something going on with contour.

@ferdinandyb
Copy link
Contributor Author

So this is probably actually three things:

  • the built-in ssh should wait more for input
  • if the built-in ssh decides to give up, it should display an error instead of closing: Improve session termination diagnostic #1327
  • remote ssh + tmux + vim seems to sometimes freeze up contour (switching to normal mode works though, so not entirely). I'm not sure which of the ssh+tmux+vim is needed for this as I never really do anything else on the remote, but I don't think I ever saw this locally.

@ferdinandyb
Copy link
Contributor Author

I had a crash recently when using the ssh feature and opening tmux. It hung without actually opening the tmux window, so just displaying the prompt with tmux typed. I have a feeling that what is going on is that for some reason tmux in contour (maybe only over ssh?) freezes, and if you're using the ssh feature of contour, then that triggers this decrypt failed error.

tldr; the quickest usability fix would be for the ssh feature to be more resilient, or try a reconnect, something like that.

@ferdinandyb
Copy link
Contributor Author

ferdinandyb commented Feb 19, 2024

Windows PowerShell.txt

The above is a Windows powershell dump, where I ran contour.exe --profile wsl --debug all (sorry guys, I find the non-dashed versions of the parameters unreadable), it doesnt have everything I'm afraid, but what I did was:

sudo apt update
sudo apt dist-upgrade
tmux

and again, did right when opening tmux.

@ferdinandyb
Copy link
Contributor Author

Here's another one, where I attached, detached and attached to tmux again:
Windows PowerShell.txt

@ferdinandyb
Copy link
Contributor Author

I'm now pretty sure that using contour "normally" (i.e. not via ssh, but in WSL), tmux/vim combo works as expected, so no crash and I don't even see any freezes.

@ferdinandyb
Copy link
Contributor Author

I managed to crash ssh-contour with vim inside aerc, so it's not only tmux.

@Yaraslaut Yaraslaut added the platform: windows topics that directly address Windows platform label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working platform: windows topics that directly address Windows platform
Projects
None yet
Development

No branches or pull requests

2 participants