I got a thread that is just banishing.. i\'d like to know who is killing my thread and why.
It occurs to me my thread is being killed by the OS, but i\'d like to
A potential way to get more information: attach a debugger and break on thread termination. Depending on how your thread is being terminated, this might not work.
sxe et
to enable breaking on thread exit.loadby sos mscorsvr
, .loadby sos mscorwks
, or .loadby sos clr
should work), then run !clrstack
(see !help
for other sos commands)If you get a lot of noise from other threads exiting, script windbg to continue after breaking if it's not the thread ID you care about.
Edit: If you think the thread is being terminated from within your process, you can also set a breakpoint on TerminateThread
(bp kernel32!TerminateThread
) and ExitThread
(bp kernel32!ExitThread
) to catch the stack of the killer.