WinDbgのスレッドが謎

WinDbgをsos拡張入れて !threads するとこんな出力が出る。

0:006> !threads
ThreadCount: 319
UnstartedThread: 0
BackgroundThread: 10
PendingThread: 0
DeadThread: 4
Hosted Runtime: no

このうち、DeadThreadが謎すぎる。続く詳細情報の、

XXXX    4    0 000000001bd54af0      9820 Enabled  0000000000000000:0000000000000000 0000000002078a90     0 Ukn
XXXX    5    0 000000001bd73c90      9820 Enabled  0000000000000000:0000000000000000 0000000002078a90     0 MTA

というような XXXX ではじまるもののことを指しているみたいなんだけど、XXXXってなんやねん。(本来はスレッド番号みたいなものが入る。)

どうやら、OSスレッドは終わっているが、.NETスレッドとしては終わっていない、というスレッドが DeadThread になるらしい。どこかから System.Threading.Thread への参照があってリークしてるのかなあ。でも勝手にガベコレされたりもするので良く分からない。

 

http://blogs.msdn.com/b/johan/archive/2007/11/13/getting-started-with-windbg-part-i.aspx

ここにはリサイクル予定ってかいてあるな。


The threads with an ID of XXXX have ended and are waiting to be recycled. We can also see that the finalizer thread has an ID of 22. So if we'd seen an unhealthy amount of activity on thread 22 when we ran the !runaway-command we would now have known that we had a finalizer-issue on our hands.

良く分からん。。。