Thursday, September 30, 2010

How to debug a hanged process

Tip - It is possible to analyze threads and critical sections of process when it is in the hanged state.

Details - Follow the below steps.
1. Generate dump file of the hanged process using ProcDump(see References) utility.
2. Open the Dump file in Windbg
3. Using !locks WinDbg command,  we can list the critical sections in a dump, the thread ID of the thread owning the lock, and the number of threads waiting to acquire it.
4. Select lock owning thread View->Process and Threads menu of windbg
5. View the stack of selected thread using View->Call Stack
6. Using View menu, we can see the debug info like variables,…  of selected thread.
7. Thus we can analyze all threads that own lock

ProcDump -

Posted by - Binu Jose