Search This Blog

Wednesday, September 29, 2004

How to take the Windows Process Thread Dump

1. Download the Debugging Tools for Windows 32-bit Version from the URL

http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx

Install the 32-bit Debugging Tools for Windows.
The 32-bit version is the best choice unless you are debugging an application
on an Intel IA-64 processor. In this case you should use the 64-bit package.

2. After installing the above tool , download the pslist.exe from

http://www.sysinternals.com/ntw2k/freeware/pslist.shtml

3. Download the usedump.exe utility from the microsoft site ,

http://download.microsoft.com/download/win2000srv/Utility/3.0/NT45/EN-US/Oem3sr2.zip

Extract this to a directory say

c:\windebug

Now you have all the tools to take the dumps ,

Please follow the procedure below for taking the dumps ,

1. if you want to take take the Apache process dump ,

pslist -d Apache

PsList 1.23 - Process Information Lister
Copyright (C) 1999-2002 Mark Russinovich
Sysinternals - www.sysinternals.com

Thread detail for INDL224AD:


Apache 2000:
Tid Pri Cswtch State User Time Kernel Time Elapsed Time
2056 8 6755 Wait:UserReq 0:00:01.572 0:00:01.492 0:45:34.562
2060 8 3 Wait:UserReq 0:00:00.000 0:00:00.000 0:45:34.221

Apache 2528:
Tid Pri Cswtch State User Time Kernel Time Elapsed Time
2412 9 4218 Ready 0:00:00.600 0:00:00.090 0:28:55.535
2084 8 4 Wait:UserReq 0:00:00.000 0:00:00.000 0:28:55.505
2096 8 467 Wait:UserReq 0:00:00.000 0:00:00.000 0:28:54.914
2440 9 263 Wait:UserReq 0:00:00.000 0:00:00.000 0:28:54.814
1756 8 7 Wait:UserReq 0:00:00.000 0:00:00.000 0:28:54.804
2092 8 30 Wait:DelayExec 0:00:00.000 0:00:00.000 0:28:54.794
2112 8 10 Wait:UserReq 0:00:00.000 0:00:00.000 0:28:54.794
..........
....
..

In this case the first process is a parent process , we are not interested in this , we are more
bothered about the second process.

For the oracle.exe you can use the command ,

pslist -d oracle

2. Now go to the directory
c:\windebug\userdump and run the setup.exe ,

3. This will install the userdump.exe in C:\WINNT\system32
4. Now issue the command ,

userdump 2528 f:\temp1\apache.dmp

5. Now open the windbg tool , from

Start -> Program Files -> Debuuging Tool For Windows -> WinDbg

6. Now choose the option ,

File -> Open Crash Dump

And select the file f:\temp1\apache.dmp

6. After this select the menu option ,
View -> Call Stack and

View -> process and threads and select the each thread it will show what the thread was doing.


No comments: