Hi Guys,
Lately I got to know about the windbg tool and currently am working on application hung issue so to understand the tool i wrote sample piece of code like below
#include "stdafx.h"#include <iostream>
using namespace std;
int main()
{
int *p = NULL;
cout<<"This is start";
*p = 10;
cout<<"This is an end";
return 0;
}
I have installed windbg and windows toolkit in my machine .
I have also followed the below steps
when the application is hung:------------------------------
1.get the process id of the application(you can see the id in the task manager)
2.Open the command prompt (example:visual studio)
3.Type the command below
c:\Program Files\Debugging Tools for Windows (x64)>windbg.exe -p (process Id of the application)
4.Then you will see the windebugger opens (press F10 this is suggested).
5.in the command line of the windebugger application type the following command
.dump /ma c:\temp.dmp
6. it will create the temp.dmp file int the location c:\
7.Now stop debugging in the debugger.
8.now open the symbolfile tab under the file tab and copy paste the below line
SRV*c:\websymbols*http://msdl.microsoft.com/download/symbols
//(two paths can be separated by a ;)
9.in the same tab you have to give the path for the .pdb file location.
10.now under the file tab in source file tab give the path to the source file location
11.Under the file tab in the image file path give the path where the exe path.
12.now open the dump file using the opent the dump file tab under the file tab.
it will show where exactly the execution is stuck.
so when dump loaded in windbg and clicked on "!analyze -v" am not able to see the hung details like the code snippet where it is hanging which i come to know by seeing the documents online
after giving !analyse -v am getting below details
WARNING: Non-directory path: 'D:\Hung\UnmanagedAppHung\Debug\UnmanagedAppHung.pdb'WARNING: Non-directory path: 'D:\Hung\UnmanagedAppHung\UnmanagedAppHung\UnmanagedAppHung.cpp'
Loading Dump File [C:\temp.dmp]
User Mini Dump File with Full Memory: Only application data is available
WARNING: Non-directory path: 'D:\Hung\UnmanagedAppHung\Debug\UnmanagedAppHung.pdb'
Symbol search path is: SRV*c:\websymbols*http://msdl.microsoft.com/download/symbols;D:\Hung\UnmanagedAppHung\Debug\UnmanagedAppHung.pdb
Executable search path is: C:\SampleProj\ApplicationHang\ApplicationHang\bin\Debug\;SRV*c:\websymbols*http://msdl.microsoft.com/download/symbols
Windows 7 Version 7601 (Service Pack 1) MP (4 procs) Free x64
Product: WinNt, suite: SingleUserTS
Machine Name:
Debug session time: Thu Apr 30 09:16:56.000 2015 (GMT+6)
System Uptime: 0 days 13:07:26.771
Process Uptime: 0 days 0:00:48.000
...........WARNING: MSVCP100D overlaps MSVCR100D
.
wow64cpu!CpupSyscallStub+0x9:
00000000`75152e09 c3 ret
0:000> !analyze -v
*******************************************************************************
* *
* Exception Analysis *
* *
*******************************************************************************
*** WARNING: Unable to verify checksum for UnmanagedAppHung.exe
*** WARNING: symbols timestamp is wrong 0x4df2bcc6 0x4df2be44 for MSVCP100D.dll
*** WARNING: symbols timestamp is wrong 0x4df2bcc6 0x4df2be37 for MSVCR100D.dll
*** WARNING: symbols timestamp is wrong 0x4ce7c496 0x4ce7b73e for apphelp.dll
*************************************************************************
*** ***
*** ***
*** Your debugger is not using the correct symbols ***
*** ***
*** In order for this command to work properly, your symbol path ***
*** must point to .pdb files that have full type information. ***
*** ***
*** Certain .pdb files (such as the public OS symbols) do not ***
*** contain the required information. Contact the group that ***
*** provided you with these symbols if you need this command to ***
*** work. ***
*** ***
*** Type referenced: kernel32!pNlsUserInfo ***
*** ***
*************************************************************************
*************************************************************************
*** ***
*** ***
*** Your debugger is not using the correct symbols ***
*** ***
*** In order for this command to work properly, your symbol path ***
*** must point to .pdb files that have full type information. ***
*** ***
*** Certain .pdb files (such as the public OS symbols) do not ***
*** contain the required information. Contact the group that ***
*** provided you with these symbols if you need this command to ***
*** work. ***
*** ***
*** Type referenced: kernel32!pNlsUserInfo ***
*** ***
*************************************************************************
FAULTING_IP:
+0
00000000`00000000 ?? ???
EXCEPTION_RECORD: ffffffffffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 0000000000000000
ExceptionCode: 80000003 (Break instruction exception)
ExceptionFlags: 00000000
NumberParameters: 0
FAULTING_THREAD: 0000000000001084
DEFAULT_BUCKET_ID: STATUS_BREAKPOINT
PROCESS_NAME: UnmanagedAppHung.exe
ERROR_CODE: (NTSTATUS) 0x80000003 - {EXCEPTION} Breakpoint A breakpoint has been reached.
EXCEPTION_CODE: (HRESULT) 0x80000003 (2147483651) - One or more arguments are invalid
NTGLOBALFLAG: 0
APPLICATION_VERIFIER_FLAGS: 0
PRIMARY_PROBLEM_CLASS: STATUS_BREAKPOINT
BUGCHECK_STR: APPLICATION_FAULT_STATUS_BREAKPOINT
LAST_CONTROL_TRANSFER: from 000000007515283e to 0000000075152e09
STACK_TEXT:
00000000`0013e918 00000000`7515283e : 00000000`752b73ff 00000000`751c0023 00000000`00000246 00000000`0031e9bc : wow64cpu!CpupSyscallStub+0x9
00000000`0013e920 00000000`751cd286 : 00000000`00000000 00000000`75151920 ffffffff`fc5f0000 00000000`7764ccf1 : wow64cpu!WaitForMultipleObjects32+0x3b
00000000`0013e9e0 00000000`751cc69e : 00000000`00000000 00000000`00000000 00000000`751c4b10 00000000`7ffe0030 : wow64!RunCpuSimulation+0xa
00000000`0013ea30 00000000`7765fc36 : 00000000`00164330 00000000`00000000 00000000`7774b670 00000000`7771e910 : wow64!Wow64LdrpInitialize+0x42a
00000000`0013ef80 00000000`776baa3d : 00000000`00000000 00000000`7765f4b1 00000000`0013f530 00000000`00000000 : ntdll!LdrpInitializeProcess+0x17e3
00000000`0013f470 00000000`7764a35e : 00000000`0013f530 00000000`00000000 00000000`7efdf000 00000000`00000000 : ntdll! ?? ::FNODOBFM::`string'+0x22ff0
00000000`0013f4e0 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!LdrInitializeThunk+0xe
STACK_COMMAND: ~0s; .ecxr ; kb
FOLLOWUP_IP:
wow64cpu!CpupSyscallStub+9
00000000`75152e09 c3 ret
SYMBOL_STACK_INDEX: 0
SYMBOL_NAME: wow64cpu!CpupSyscallStub+9
FOLLOWUP_NAME: MachineOwner
MODULE_NAME: wow64cpu
IMAGE_NAME: wow64cpu.dll
DEBUG_FLR_IMAGE_TIMESTAMP: 5507b7e3
FAILURE_BUCKET_ID: STATUS_BREAKPOINT_80000003_wow64cpu.dll!CpupSyscallStub
BUCKET_ID: X64_APPLICATION_FAULT_STATUS_BREAKPOINT_wow64cpu!CpupSyscallStub+9
WATSON_STAGEONE_URL: http://watson.microsoft.com/StageOne/UnmanagedAppHung_exe/0_0_0_0/5541a304/unknown/0_0_0_0/bbbbbbb4/80000003/00000000.htm?Retriage=1
Followup: MachineOwner
---------
WARNING: Non-directory path: 'D:\Hung\UnmanagedAppHung\Debug\UnmanagedAppHung.pdb'
WARNING: Non-directory path: 'D:\Hung\UnmanagedAppHung\UnmanagedAppHung\UnmanagedAppHung.cpp'
0:000> .exr 0xffffffffffffffff
ExceptionAddress: 0000000000000000
ExceptionCode: 80000003 (Break instruction exception)
ExceptionFlags: 00000000
NumberParameters: 0
so please help me in resolving this.