4

Since re-installing Windows 7 Ultimate 64-bit SP1, sometimes processes take a long time to close. This happens most frequently when launching them from VS2010, but it's not limited to that. A common case is a Windows app with a console (/SUBSYSTEM:console) that appears to close correctly, but the console remains open for seconds or minutes. Eventually the "press any key to close" message appears on the console, and the process can be terminated.

How can I diagnose this problem?

  • I installed Windows 7 Ultimate 64-bit SP1, but this time the vanilla (not N) version
  • The only driver I manually installed is the NVIDIA display driver, but I've tried multiple WHQL versions
  • The symptoms closely match the question at Visual studio debug console sometimes stays open and is impossible to close Even non-console apps are affected, however.
  • Both native and managed applications suffer from this.
  • WRONG: I believed only 32-bit processes were affected, but 64-bit ones also suffer.
  • if a debugger is already attached, and I break while the process is waiting, the debugger says:

The process appears to be deadlocked (or is not running any
user-mode code). All threads have been stopped.

  • I can't attach a debugger to a process while its in this state
  • I can't kill these zombie processes from Task Manager or ProcessExplorer, even when closing all handles that refer to said processes. (I can't close lsass.exe's handles, though)

  • ProcessExplorer says that the hanging function of the only thread that the each hung process has is ntdll!RtlDosSearchPath_Ustr.

  • Most of the time I have to close Visual Studio completely to allow the zombie processes to close.
  • The last event that Process Monitor sees at the hang in each case is a Thread Exit, which succeeds, and it looks like the exit takes the normal amount of time. When the process finally closes, no events show up.
  • LiveKd doesn't show anything when I follow the steps outlined at http://blogs.technet.com/b/markrussinovich/archive/2005/08/17/unkillable-processes.aspx

It seems like a bad driver is the culprit, so I'm going to reinstall Windows soon.

Community
  • 1
  • 1
Cat Zimmermann
  • 1,422
  • 2
  • 21
  • 38
  • Odd. The only advice I can offer would be to check the logs in Event Viewer when the problems occur to see if there are any obvious conflicts etc. – Aaron Newton Jan 16 '12 at 03:52
  • it is a problem with the content of your `PATH` environment variable and/or some HW (most likely HDD) and/or the communication of the OS with your HDD (possibly a chipset-specific driver). – Yahia Jan 16 '12 at 15:53
  • @Yahia, could you elaborate on how you came to that conclusion? – Cat Zimmermann Jan 16 '12 at 19:30
  • @CatZimmermann I have seen processes doing similar things to what you describe although that was not Windows 7 and basically the options I listed were the ones is boiled down to... since I am not sure that is really the reason in your case I posted it as a comment instead of an answer... – Yahia Jan 16 '12 at 19:47
  • Well, I'll accept your answer if you create one. :) – Cat Zimmermann Jan 16 '12 at 20:57

0 Answers0