xc8tlik / puttycyg

Automatically exported from code.google.com/p/puttycyg
0 stars 1 forks source link

When Cygwin SSH disconnects, puttycyg seems to hang #20

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Sometimes I work locally on my PC, then ssh somewhere else and forget the
connection. When the remote end disconnects, puttycyg seems to hang. My
only option is to close the window. I expect to continue locally.

Original issue reported on code.google.com by nal...@gmail.com on 20 Feb 2009 at 10:41

GoogleCodeExporter commented 8 years ago
Is this accurate?

Steps to reproduce:

1. Run PuTTYcyg with standard (bash) login shell.
2. Use Cygwin ssh to connect to a remote site.
3. Wait for remote site to timeout/disconnect.

If so, have you tried the ssh disconnect escape sequence ~.  (tilde, dot) ?

Original comment by medgar123 on 20 Feb 2009 at 10:46

GoogleCodeExporter commented 8 years ago
Yes this is accurate.

No, I didn't try the ssh disconnect escape sequence. I tried the telnet escape
sequence. (I know this does not make sense). I am going to try it and post a 
comment.

With the DOS console disconnection is smooth and I can continue locally.

Original comment by nal...@gmail.com on 20 Feb 2009 at 11:00

GoogleCodeExporter commented 8 years ago
It works after the ssh disconnect escape sequence, but only after about a 
minute I
can continue locally. See transcript:

---
user@WINHOST ~
$ ssh user@kirchhoff.xxx
Linux kirchhoff 2.4.27-2-386 #1 Wed Aug 17 09:33:35 UTC 2005 i686

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
No mail.
Last login: Fri Feb 20 09:14:53 2009 from gw.xxx
user@kirchhoff:~$ Read from remote host kirchhoff.xxx: Connection reset by peer
Connection to kirchhoff.xxx closed.

user@WINHOST ~
$
---

Personally I think I can live with this quirk.

Original comment by nal...@gmail.com on 20 Feb 2009 at 3:48

GoogleCodeExporter commented 8 years ago
I have not been able to duplicate this issue.  I strongly suspect that it has 
nothing
to do with PuTTYcyg, and everything to do with your local ssh version.  I have
"OpenSSH_5.1p1, OpenSSL 0.9.8j 07 Jan 2009" -- what version do you have (ssh 
-v)?

Do you get the same behavior when using the standard Cygwin.bat file (Windows
Console)?  If so, then this issue is most likely not related to PuTTYcyg.  Try
debugging it by using ssh -v kirchhoff.xxx.  How is the remote end configured 
such
that it disconnects you?  What is disconnecting you, the remote sshd or some 
network
router along the path or something else?  It may be related to the local (or 
remote)
TCPKeepAlive option being turned off.

Original comment by medgar123 on 23 Feb 2009 at 11:12

GoogleCodeExporter commented 8 years ago
Timeout disconnection works as expected with the Windows Console. With puttycyg
tilde-dot escape is neccessary, then after a few seconds I can continue locally.

I am using a special setup with cygwin keychain. This setup allows me to start 
remote
connection immediately from the start menu AND working locally. Perhaps this is
interfering with ssh disconnection.

In the transcript I accidentally connected to yet another host. I left the 
transcript
as is because of the transfer messsages. Just ignore the login attempt.

As already said, I can live with it. However, if you want to investigate, I am
willing to help you and give you the information you need. You tell me.

Original comment by nal...@gmail.com on 23 Feb 2009 at 4:46

Attachments:

GoogleCodeExporter commented 8 years ago
i have been having a similar problem and it's been driving me insane...  
basically, i
run cygwin on a notebook that goes to sleep and hibernates and then sometimes 
cygwin
hangs in the networking stack...  

IPC is screwed up as well.  my bashrc runs ssh-add, which hangs in 
_cygtls::remove
when I examine the process with strace...

reading from there, i find that there are quirks to process startup that must be
considered when invoking a cygwin dll from outside the cygwin environment, so 
yeah, i
can well imagine that my underpowered netbook could be susceptible to race 
conditions
in that starup process...and thus not be garbage-collecting tcp/ip connection 
slots...

i notice there's a new BETA and i'll try it out.

thanks for puttycyg!  i am grateful...

-- stig

Original comment by stig.hac...@gmail.com on 2 Mar 2009 at 12:55

GoogleCodeExporter commented 8 years ago
the  puttycyg beta has survived a few sleeps and hibernations without falling 
into
the connection-hanging pattern yet...  so far, so good...  

Original comment by stig.hac...@gmail.com on 3 Mar 2009 at 5:40

GoogleCodeExporter commented 8 years ago
Ummmmmmm, belay that last comment.  putting my notebook to sleep repeatedly
eventually clobbers cygwin's ability to open network connections...including 
local
connections to other processes (eg:  ssh-agent & ssh-add)...

Hmmmmmmm...  opening a normal bash shell & connecting from there seems to maybe
garbage collect some cygwin resources properly because then the formerly-hosed
putty-based cygwin session can connect...

would anyone else like to tickle the bug this way to see if i've noted something
worth noting?

Original comment by stig.hac...@gmail.com on 4 Mar 2009 at 9:38