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

SSH from bash can freeze the console when non regular characters are outputed. #53

Closed
MarcMagnin opened this issue Jan 25, 2018 · 11 comments
Labels
Area-VT Virtual Terminal sequence support Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. Product-WSL Issue that should probably go to Microsoft/WSL

Comments

@MarcMagnin
Copy link

Hi!

  • Your Windows build number:
    Microsoft Windows [Version 10.0.16299.192]

  • What you're doing and what's happening:
    Run an Ubuntu VM (mine is v16) with Golang 1.9.3 installed on it (with Virtualbox for instance).
    SSH from Windows bash onto that VM and run the following golang program:

package main

import (
	"math"
	"fmt"
)

func main() {

	var tt float32 = 1
	for j := 0; j < 5000; j++ {
		bits := uint64(math.Float32bits(tt))
		tt++
		byteCount := 4
		var bb []byte
		bb = make([]byte, 0, byteCount)
		for i := 0; i < byteCount; i++ {
			bb = append(bb, byte(bits&255))
			bits = bits >> 8
		}
		fmt.Print(string(bb))
	}
}

go run <filename>.go

  • What's wrong / what should be happening instead:
    It starts outputing some characters and then freeze.
    Characters outputed:
  ?   @  @@  @  @  @  @   A  �A   A  0A  @A  PA  `A  pA  A  A  A  A  A  A  A  A  A  A  A  A  A  A  A  A   B  �B B  B  �B  �B  �B  �B   B  $B  (B  ,
B  0B  4B  8B  <B  @B  DB  HB  LB  PB  TB  XB  \B  `B  dB  hB  lB  pB  tB  xB  |B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B
B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B   C  �C  �C  �C  �C  ��
C  C C          C
C  �C  �C  �C  �C  �C  �C  �C  �C  �C  �C  �C  �C  �C     �C  �C  �C  �C   C  !C  "C  #C  $C  %C  &C  'C  (C  )C  *C  +C  ,C  -C  .C  /C  0C  1C  2
3C  4C  5C  6C  7C  8C  9C  :C  ;C  <C  =C  >C  ?C  @C  AC  BC  CC  DC  EC  FC  GC  HC  IC  JC  KC  LC  MC  NC  OC  PC  QC  RC  SC  TC  UC  VC  WC
XC  YC  ZC  [C  \C  ]C  ^C  _C  `C  aC  bC  cC  dC  eC  fC  gC  hC  iC  jC  kC  lC  mC  nC  oC  pC  qC  rC  sC  tC  uC  vC  wC  xC  yC  zC  {C  |C
}C  ~C  �C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C
C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C
C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C
C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C
C C  C C  C C  C C  C C  C C  C C  C C  C C  C C  C C   D @ D  D  D  �D @�D �D �D  �D @�D �D �D  �D @�D �D �D  �D @�D �D �D  �D @�D �D �D  �D @�D ��
D  D @D D D D DDD       D @     D       D       D
D @
D
D
D  �D @�D �D �D  �D @�D �D �D  �D @�D �D �D  �D @�D �D �D  �D @�D �D �D  �D @�D �D �D  �D @�D �D �D  �D @�D �D �D  �D @�D �D �D  �D @�D �D �D  �D @�
D �D �D  �D @�D �D �D  �D @�D �D �D    �D @�D �D �D  �D @�D �D �D  �D @�D �D �D  �D @�D �D �D   D @ D  D  D  !D @!D !D !D  "D @"D "D "D  #D @#D #D #
D  $D @$D $D $D  %D @%D %D %D  &D @&D &D &D  'D @'D 'D 'D  (D @(D (D (D  )D @)D )D )D  *D @*D *D *D  +D @+D +D +D  ,D @,D ,D ,D  -D @-D -D -D  .D @.
D .D .D  /D @/D /D /D  0D @0D 0D 0D  1D @1D 1D 1D  2D @2D 2D 2D  3D @3D 3D 3D  4D @4D 4D 4D  5D @5D 5D 5D  6D @6D 6D 6D  7D @7D 7D 7D  8D @8D 8D 8D
9D @9D 9D 9D  :D @:D :D :D  ;D @;D ;D ;D  <D @<D <D <D  =D @=D =D =D  >D @>D >D >D  ?D @?D ?D ?D  @D @@D @D @D  AD @AD AD AD  BD @BD BD BD  CD @CD C
D CD  DD @DD DD DD  ED @ED ED ED  FD @FD FD FD  GD @GD GD GD  HD @HD HD HD  ID @ID ID ID  JD @JD JD JD  KD @KD KD KD  LD @LD LD LD  MD @MD MD MD  N
@ND ND ND  OD @OD OD OD  PD @PD PD PD  QD @QD QD QD  RD @RD RD RD  SD @SD SD SD  TD @TD TD TD  UD @UD UD UD  VD @VD VD VD  WD @WD WD WD  XD @XD XD X
D  YD @YD YD YD  ZD @ZD ZD ZD  [D @[D [D [D  \D @\D \D \D  ]D @]D ]D ]D  ^D @^D ^D ^D  _D @_D _D _D  `D @`D `D `D  aD @aD aD aD  bD @bD bD bD  cD @c
D cD cD  dD @dD dD dD  eD @eD eD eD  fD @fD fD fD  gD @gD gD gD  hD @hD hD hD  iD @iD iD iD  jD @jD jD jD  kD @kD kD kD  lD @lD lD lD  mD @mD mD mD
nD @nD nD nD  oD @oD oD oD  pD @pD pD pD  qD @qD qD qD  rD @rD rD rD  sD @sD sD sD  tD @tD tD tD  uD @uD uD uD  vD @vD vD vD  wD @wD wD wD  xD @xD x
D xD  yD @yD yD yD  zD @zD zD zD  {D @{D {D {D  |D @|D |D |D  }D @}D }D }D  ~D @~D ~D ~D  �D @�D �D

This works perfectly fine on powershell (running the program from Windows) or within the Ubuntu native terminal (from Virtualbox interface).

Regards

@zadjii-msft
Copy link
Member

Does this work if you take SSH out of the equation?

What happens when you run the above go script directly in WSL?

If this works in powershell (running Go on Windows), but not in bash (running Go on WSL), then I'd be inclined to believe this is a WSL bug, not a console issue.

@MarcMagnin
Copy link
Author

Yes this works fine everywhere without SSH.

@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label May 17, 2019
@miniksa miniksa added Area-VT Virtual Terminal sequence support Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. Product-WSL Issue that should probably go to Microsoft/WSL labels May 29, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label May 29, 2019
@miniksa
Copy link
Member

miniksa commented May 29, 2019

This has been a long time, so we should probably try to re-repro this.

@SvenBrunk
Copy link

SvenBrunk commented Jul 14, 2021

I might be facing the same issue. For me the Windows Terminal freezes when I type "ls -l" on a RHEL server that outputs links as "->".
At least that is my working theory. I first thought it might be an SSH bug related to certain ACLs, but with kitty (putty clone) I can view the directories just fine.
Might of course also be the colors:
image
or one of these permission issues:
lsattr: Permission denied While reading flags on ./config.inc.php
lsattr: Operation not supported While reading flags on ./export

@zadjii-msft
Copy link
Member

I'm honestly kind of shocked that this 3 year old issue is still open without any traction. If this was more widespread, I'm sure we would have seen more hits...

@SvenBrunk What Terminal version are you using, what ssh are you using? Could you get a debug tap trace of the terminal when it freezes? That could help ID the string of text that triggers this.

@miniksa
Copy link
Member

miniksa commented Jul 15, 2021

You could also attempt to tee the output to a file and attach it so we can reproduce it hopefully at-will with a cat.

I also wonder if #10653 will help this. Perhaps its the display that's freezing up and @lhecker's ticket lock will help.

@SvenBrunk
Copy link

I am using
Windows Terminal
Version: 1.8.1521.0

SSH: OpenSSH_8.2p1 Ubuntu-4ubuntu0.2, OpenSSL 1.1.1f 31 Mar 2020

Unfortunately when I tried today from the office it didn't happen. I will try again when I am in Homeoffice today. Maybe there is an issue in conjunction to the VPN connection. 🤔
Which would also explain that not many people face that issue.
(Well... or someone messed up the server configuration and now cleaned it up silently)

@zadjii-msft
Copy link
Member

tbh, given the way OP responded

Yes this works fine everywhere without SSH.

then this should have probably been moved to https://github.com/PowerShell/Win32-OpenSSH/ a long time ago 😕

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jul 20, 2021
@SvenBrunk
Copy link

It IS connected to the VPN-connection. In Homeoffice the connection stalls.
Unfortunately the output in the debug tap is completely none:
$␛[1Cllss␣␣--llaa␍␍␊␍
(I pressed return again... )

@DHowett
Copy link
Member

DHowett commented Jul 23, 2021

As a test... when the connection stalls, can you press Enter ~ .? What happens?

@ghost ghost added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Jul 27, 2021
@ghost
Copy link

ghost commented Jul 27, 2021

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost ghost closed this as completed Jul 30, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-VT Virtual Terminal sequence support Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. Product-WSL Issue that should probably go to Microsoft/WSL
Projects
None yet
Development

No branches or pull requests

5 participants