5
1
PuTTY crashes when the program tries to exit. When it crashes, the window will freeze and will not close no matter what. Force close will not work, the task manager will not work. pskill
from pstools (using administrator command prompt) has no effect-- it says the process has been killed, but it remains. Nothing will make the window go away except for a computer reboot.
This has been happening for a few weeks, possibly caused by a recent Windows update, but that's just a guess. It doesn't happen every time, but maybe 50% of the time. It crashes whether it is a manual exit invoked by typing "exit" or "logout", or when it exits itself because the computer has gone to sleep.
It only happens when I use port tunneling. I always have several PuTTY windows open, and the only one that crashes is the one with a port tunnel open.
Before the most recent crash, I opened the PuTTY log to see what it said. The final line was "Server sent command exit status 0", which seems normal.
Here is a screenshot of my port tunnelling settings, in case that's relevant:
Here is the Windows error box, which identifies the type of error as "AppHangB1":
Google has given me zero results. Searches for this type of crash have told me that it's often caused by a buggy driver, so that's one possible avenue, if anyone knows what I should try to update/roll back.
I updated PuTTY to the most recent version to no effect. I have not tried updating the remote computer (which I control) or my router, but I'd hope that neither of them are related to this kind of crash, which seems related to Windows itself.
Windows 7
Update
I ran the debugging tools suggested, which generated a memory dump and an analysis of it. It's quite a lot of information, so I pasted into a jsfiddle you can see here. I quoted the summary below, but please see that page for the full report, because it's quite a lot of information.
Description: Detected possible blocking or leaked critical section at 0x041916d8 owned by thread 0 in putty.exe__PID__7768__Date__08_14_2018__Time_02_26_52PM__311__Manual Dump.dmp
Impact of this lock: 25.00% of threads blocked (Threads 2)
The following functions are trying to enter this critical section
mswsock!SockAsyncSelectCompletion+2a
The following module(s) are involved with this critical section:
C:\WINDOWS\System32\mswsock.dll from Microsoft Corporation
Update 3 weeks later
It has been nearly a month without a crash, and in that time there has been another Windows update. The timing is too coincidental; I think this must have been caused by a Windows update in the summer, probably July, and fixed in the August update.
Have you tried uninstalling and reinstalling the most recent version of PuTTY (not upgrade, but actually uninstall, reboot, re-install)? If so, have you tried the Snapshot version? Have you filed a Bug Report on PuTTY's site?
– JW0914 – 2018-08-06T04:37:39.060Try to type
enter ~.
(enter-tilde-dot) before enteringexit
or when PuTTY is hang. Questions: How exactly are you exiting PuTTY and do you use theexit
command? What is your MTU on both sides? – harrymc – 2018-08-06T06:24:06.547@harrymc: The crash happens whether I type
exit
,logout
, or when PuTTY closes on its own because the computer goes to sleep. Typically I useexit
. I don't know what my MTU is; I'm not familiar with the term.enter ~.
is not a command recognized by the server, – felwithe – 2018-08-06T10:48:56.300While I'm not all that familiar with port tunneling, is there anything on the "other end" that is relying on the connection that you sever when you issue the "exit" or "logout" command? Maybe putty is encountering an error because when you exit the client from the putty POV, the "other end" is trying to recconect which causes an issue. (Just a thought as I work with putty, just not port tunneling.) Also just for clarification by port tunneling to you mean port forwarding? – RickwhoPrograms – 2018-08-06T13:41:54.927
I suggested the combination of
enter ~.
since it's used by ssh to locally drop the connection. It's evident that the local putty is hung on the connection, probably because the other side isn't correctly closing it. Could you please tell us which software is on the other side and what version are both sides. – harrymc – 2018-08-06T14:00:42.613Suggestion: In the configuration settings, try to change the setting of "Close window on exit". You may also try an alternative : KiTTY, MobaXterm, Bitvise.
– harrymc – 2018-08-06T14:21:26.950I assume you using tunnel as SOCKS according to your screenshots. Did you close application that use tunnel (browser) before you exiting? Do you use some antivirus ? – Alex – 2018-08-06T17:20:24.307
@Alex Yes, I close the browser before exiting (Firefox). When PuTTY closes because the computer went to sleep, Firefox has been closed for at least an hour at that point, so I don't think it could still be using a connection. – felwithe – 2018-08-06T23:42:32.283
@harrymc According to the PuTTY log, it's
– felwithe – 2018-08-06T23:52:22.640Server version: SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.10
. Is that what you're looking for? Interestingly, the next line isWe believe remote version has SSH-2 channel request bug
. Here is a screenshot (which unfortunately cuts off the ends of the sentences): https://i.imgur.com/lGRwcZe.pngSince you're connecting to a Linux server, you should also try exiting via
Ctrl+D
, as this acts as EOF in Linux and thus the connection will be severed. – 3D1T0R – 2018-08-08T00:05:18.733I would also recommend that you try with KiTTY as well, as it's a fork of PuTTY. – 3D1T0R – 2018-08-08T00:06:05.757
See also: This known PuTTY bug, which may or may not be related... unclean-close-crash: Reports of crashes on unclean close (related to port forwarding?)
– 3D1T0R – 2018-08-08T00:27:29.450@JW0914, I tried uninstalling, rebooting, and reinstalling, and was getting hopeful because there had been no crash for a couple days, but then it happened again last night. – felwithe – 2018-08-10T11:19:13.107
@JW0914, when I reinstalled PuTTY, I noticed that it still had my old settings, which I think means that its registry values were not uninstalled. Is there a way to uninstall it including its registry values? (Or does that not matter? I'm trying everything I can think of.) – felwithe – 2018-08-10T12:13:42.453
@RickwhoPrograms I actually don't know the difference between port forwarding and tunneling very well. I followed a guide to using Firefox through a proxy server. I first connect to the server with PuTTY, using the settings in the screenshot above (Connection/SSH/tunnels tab, port 9090 dynamic, or D9090). Firefox then uses this connection with its proxy settings, which are SOCKS host 127.0.0.1, port 9090. Here is a screenshot: https://i.imgur.com/0Wqb6zR.png
– felwithe – 2018-08-10T12:29:34.210@felwithe All the PuTTY registry values contain are your saved profiles, Session Jumplists, and saved Host public keys... Registry location:
– JW0914 – 2018-08-11T12:36:09.440HKCU\Software\SimonTatham\PuTTY
. If you believe you've changed the default profile settings, and want to reset the default profile to default, then delete any keys withinSessions
containing "default" in the key name. I'd also recommend filing a bug report on PuTTY's site.@felwithe Do you have any third-party firewall or virus-checking software installed? This behaviour sounds like something trying to hook network connections in the kernel but not handling this case well... – Anon – 2018-08-11T16:55:27.467
@Anon 4 Only Malwarebytes. – felwithe – 2018-08-11T21:05:43.427
@felwithe If you temporarily disable Malwarebytes does the problem get any better? – Anon – 2018-08-13T05:50:12.763
1There certainly are people whom know more about Windows debugging than I do but ... It's stuck at "ws2_32!closesocket+cd" called from: "putty+a1050" - notice that the 'putty+....." has no Function name, you would want to compile Putty with debugging symbols so that you are told the Function name and Line number. It *looks* like you have a call to close a Socket, and it's not returning. Without the Source it's a guess what the problem is. If you're a wiz at asm language and Window's calls you can load Putty.exe into the debugger and look at the code leading up to the call at
a1050 . – Rob – 2018-08-14T21:37:05.630