Windows – PuTTY crashes on exit and requires computer reboot

crashputtysshssh-tunnelwindows 7

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.

server exit status 0

Here is a screenshot of my port tunnelling settings, in case that's relevant:

port tunnel D9090

Here is the Windows error box, which identifies the type of error as "AppHangB1":

enter image description here

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


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

Impact of this lock: 25.00% of threads blocked (Threads 2)

The following functions are trying to enter this critical section


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.

Best Answer

  • In the configuration settings of PuTTY, the setting of "Close window on exit" may take part in the problem, so try to test its other available settings.

    You may also try an alternative free product, one of : KiTTY, MobaXterm, or Bitvise.

    If one of the alternatives works for you, then first you have a workaround for the problem. Second, the problem itself is then probably some difficulty in the communication protocol of PuTTY with the remote computer, and you should report the problem to the developers.

    However, if none of the alternatives works for you, then the problem is probably not on your side. You should examine the setup of the SSH server on the remote computer, try to debug it, and post here the trace logs if you would like us to have a look. If you do not have control of the remote computer, report the problem to its administrator.

  • Related Question