A single server has started to sometime leave zombie w3wp.exe processes when trying to recycle. A new process is spawned properly and everything seems to work, except the old processes are still present and take up memory. Task manager reports there’s only a single thread left, far from the active ones that have between 40 and 70 threads usually. Using ProcDump I’ve taken a full memory dump to analyze further in WinDbg . The machine is a Server 2008 R2 x64 8 core machine as stated by WinDbg:
Windows 7 Version 7600 MP (8 procs) Free x64
After loading sos a printout of the managed threads reveals the following:
0 :000 > !threads
ThreadCount: 19
UnstartedThread: 0
BackgroundThread: 19
PendingThread: 0
DeadThread: 0
Hosted Runtime: no
PreEmptive Lock
ID OSID ThreadOBJ State GC GC Alloc Context Domain Count APT Exception
XXXX 1 9 d0 000000000209 b4c0 8220 Enabled 0000000000000000 :0000000000000000 000000000208e770 0 Ukn
XXXX 2 c60 00000000020 c3130 b220 Enabled 000000013 fbe5ed0:000000013 fbe7da8 000000000208e770 0 MTA (Finalizer)
XXXX 3 a24 00000000020 f0d60 880 a220 Enabled 0000000000000000 :0000000000000000 000000000208e770 0 MTA (Threadpool Completion Port)
XXXX 4 97 c 0000000002105180 80 a220 Enabled 0000000000000000 :0000000000000000 000000000208e770 0 MTA (Threadpool Completion Port)
XXXX 5 c28 000000000210 bfe0 1220 Enabled 0000000000000000 :0000000000000000 000000000208e770 0 Ukn
XXXX 6 d40 00000000053 f9080 180 b220 Enabled 00000001 bfe75d20:00000001 bfe767c8 000000000208e770 0 MTA (Threadpool Worker)
XXXX 7 c18 00000000053 f9b30 180 b220 Enabled 00000000 fff95880:00000000 fff97210 000000000208e770 0 MTA (Threadpool Worker)
XXXX 8 f7c 00000000053 fa5e0 180 b220 Enabled 000000011 fbea268:000000011 fbea920 000000000208e770 0 MTA (Threadpool Worker)
XXXX 9 91 c 00000000053 fb090 180 b220 Enabled 00000001 dfc39138:00000001 dfc39670 000000000208e770 0 MTA (Threadpool Worker)
XXXX a fb0 00000000053 fbd20 180 b220 Enabled 00000000 fff922b0:00000000 fff93210 000000000208e770 0 MTA (Threadpool Worker)
XXXX b fc8 00000000053 fc9b0 180 b220 Enabled 0000000160053 ea0:0000000160054778 000000000208e770 0 MTA (Threadpool Worker)
XXXX c 538 00000000053 fd460 180 b220 Enabled 000000017 fd8fc98:000000017 fd911f8 000000000208e770 0 MTA (Threadpool Worker)
XXXX d 604 00000000053 fdf10 180 b220 Enabled 000000019 fd7aa78:000000019 fd7c648 000000000208e770 0 MTA (Threadpool Worker)
0 f 2 cc 0000000005514 c60 220 Enabled 0000000000000000 :0000000000000000 000000000208e770 0 Ukn
XXXX 10 9 bc 00000000020 a90c0 220 Enabled 0000000000000000 :0000000000000000 000000000208e770 0 Ukn
XXXX 11 9 c0 00000000056 b7a00 220 Enabled 0000000000000000 :0000000000000000 000000000208e770 0 Ukn
XXXX e 9 d4 00000000056 b7fd0 220 Enabled 0000000000000000 :0000000000000000 000000000208e770 0 Ukn
XXXX 12 9 d8 00000000056 b85a0 220 Enabled 0000000000000000 :0000000000000000 000000000208e770 0 Ukn
XXXX 13 cb8 00000000056 b8b70 220 Enabled 0000000000000000 :0000000000000000 000000000208e770 0 Ukn
Of more interest however is probably the output of a stack backtrace for the single unmanaged thread remaining:
0 :000 > ~* kb 2000
. 0 Id: 85c.2cc Suspend: -1 Teb: 000007 ff`f ffd3000 Unfrozen
RetAddr : Args to Child : Call Site
000007 fe`f dcc1843 : 00000000 `0 0fd6b60 00000000 `0 0fd6b60 ffffffff`f fffffff 00000000 `7 7bc04a0 : ntdll!ZwClose+0 xa
00000000 `7 7ab2c41 : 00000000 `7 7bc1670 00000000 `0 0000000 00000000 `7 7bc04a0 7 fffffff`f fffffff : KERNELBASE!CloseHandle+0 x13
000007 fe`f 56537c6 : 00000000 `0 0000000 00000000 `0 0000000 00000000 `0 12da080 000007 fe`f 5442eac : kernel32!CloseHandleImplementation+0 x3d
000007 fe`f 54443d2 : 00000000 `0 0000007 000007 fe`f 5443d3c 00000000 `0 0000000 00000000 `7 7bc9997 : httpapi!HttpCloseRequestQueue+0 xa
000007 fe`f 54444c3 : 00000000 `0 0000000 00000000 `0 12e6900 00000000 `0 0000000 00000000 `7 7bd5afa : w3dt!UL_APP_POOL::Cleanup+0 x62
000007 fe`f 549384a : 00000000 `0 12da080 00000000 `0 0c93a28 00000000 `0 12e6900 00000000 `0 0000000 : w3dt!WP_CONTEXT::CleanupOutstandingRequests+0 x83
000007 fe`f 549417a : 00000000 `0 0000000 00000000 `0 000ffff 00000000 `0 0000000 00000000 `7 7bcf9fd : iiscore!W3_SERVER::StopListen+0 x4a
000007 fe`f 562b5bf : 00000000 `0 12d2f30 00000000 `0 0000000 00000000 `0 0000000 00000000 `0 000ffff : iiscore!IISCORE_PROTOCOL_MANAGER::StopListenerChannel+0 x5a
000007 fe`f 5626e8f : 00000000 `0 12d2f30 00000000 `0 0000000 00000000 `0 0424380 00000000 `0 0000000 : w3wphost!LISTENER_CHANNEL_STOP_WORKITEM::ExecuteWorkItem+0 x7b
00000000 `7 7bcf8eb : 00000000 `0 21782b0 00000000 `0 21782b0 00000000 `0 0000000 00000000 `0 0000001 : w3wphost!W3WP_HOST::ExecuteWorkItem+0 xf
00000000 `7 7bc9d9f : 00000000 `0 0000000 00000000 `0 12d2f30 00000000 `0 0424380 00000000 `0 10aa528 : ntdll!RtlpTpWorkCallback+0 x16b
00000000 `7 7aaf56d : 00000000 `0 0000000 00000000 `0 0000000 00000000 `0 0000000 00000000 `0 0000000 : ntdll!TppWorkerThread+0 x5ff
00000000 `7 7be3281 : 00000000 `0 0000000 00000000 `0 0000000 00000000 `0 0000000 00000000 `0 0000000 : kernel32!BaseThreadInitThunk+0 xd
00000000 `0 0000000 : 00000000 `0 0000000 00000000 `0 0000000 00000000 `0 0000000 00000000 `0 0000000 : ntdll!RtlUserThreadStart+0 x1d
From the stack trace it’s obvious that the w3wp process is trying to shut down and perform its cleanup tasks, but for some reason ntdll!ZwClose is hanging up. It’s been hung for several days without change - and without apparent side effects besides an increased amount of memory usage.
The w3wp processes do not hang up all the time, I have yet to find a reproducible pattern. In the meantime, any suggestions for further debugging?
Mark S. Rasmussen
I'm the CTO at
iPaper where I cuddle with databases, mold code and maintain the overall technical & team responsibility. I'm an avid speaker at user groups & conferences. I love life, motorcycles, photography and all things technical. Say hi on
Twitter , write me an
email or look me up on
LinkedIn .