windbg 找到异常所在的代码行


我想定位异常到指定的代码行,发现第五步存在问题。希望解答。

步骤:

一、 Symbol file path: srv*;D:\github\MoltenPoolTrack\Bulid\Release\release

        其中D:\github\MoltenPoolTrack\Bulid\Release\release是pdb文件的路径

二、 Source path: D:\github\MoltenPoolTrack

        其中D:\github\MoltenPoolTrack是源文件的路径

三、 Open crash dump

四、  !analyze -v,下面可以看出是CMyProcess::run+0x45处出现了0xc0000005的异常。

*******************************************************************************
*                                                                             *
*                        Exception Analysis                                   *
*                                                                             *
*******************************************************************************

*** WARNING: Unable to verify checksum for zmotion.dll

KEY_VALUES_STRING: 1

    Key  : AV.Dereference
    Value: NullPtr

    Key  : AV.Fault
    Value: Write

    Key  : Analysis.CPU.mSec
    Value: 4296

    Key  : Analysis.DebugAnalysisManager
    Value: Create

    Key  : Analysis.Elapsed.mSec
    Value: 14125

    Key  : Analysis.Init.CPU.mSec
    Value: 30984

    Key  : Analysis.Init.Elapsed.mSec
    Value: 672437

    Key  : Analysis.Memory.CommitPeak.Mb
    Value: 291

    Key  : Timeline.Process.Start.DeltaSec
    Value: 3

    Key  : WER.OS.Branch
    Value: co_release

    Key  : WER.OS.Timestamp
    Value: 2021-06-04T16:28:00Z

    Key  : WER.OS.Version
    Value: 10.0.22000.1


FILE_IN_CAB:  crash.dmp

CONTEXT:  (.ecxr)
eax=00000000 ebx=050c03a8 ecx=00000000 edx=00000000 esi=01602b10 edi=050c03a8
eip=00c77615 esp=04d7fae0 ebp=04d7fcf4 iopl=0         nv up ei ng nz na po nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010282
MoltenPoolTrack!CMyProcess::run+0x45:
00c77615 c70001000000    mov     dword ptr [eax],1    ds:002b:00000000=????????
Resetting default scope

EXCEPTION_RECORD:  (.exr -1)
ExceptionAddress: 00c77615 (MoltenPoolTrack!CMyProcess::run+0x00000045)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 00000001
   Parameter[1]: 00000000
Attempt to write to address 00000000

PROCESS_NAME:  MoltenPoolTrack.exe

WRITE_ADDRESS:  00000000 

ERROR_CODE: (NTSTATUS) 0xc0000005 - 0x%p            0x%p                    %s

EXCEPTION_CODE_STR:  c0000005

EXCEPTION_PARAMETER1:  00000001

EXCEPTION_PARAMETER2:  00000000

STACK_TEXT:  
04d7fcf4 02128c8c     137c01cd 02128b30 02128b30 MoltenPoolTrack!CMyProcess::run+0x45
WARNING: Stack unwind information not available. Following frames may be wrong.
04d7fd18 76bc6939     01602b51 76bc6920 04d7fd80 Qt5Core!QThread::start+0x31c
04d7fd28 77c28fd2     050c03a8 ba1fd999 00000000 kernel32!BaseThreadInitThunk+0x19
04d7fd80 77c28f9d     ffffffff 77c590f9 00000000 ntdll!__RtlUserThreadStart+0x2b
04d7fd90 00000000     02128b30 050c03a8 00000000 ntdll!_RtlUserThreadStart+0x1b


SYMBOL_NAME:  MoltenPoolTrack!CMyProcess::run+45

MODULE_NAME: MoltenPoolTrack

IMAGE_NAME:  MoltenPoolTrack.exe

STACK_COMMAND:  ~20s; .ecxr ; kb

FAILURE_BUCKET_ID:  NULL_POINTER_WRITE_c0000005_MoltenPoolTrack.exe!CMyProcess::run

OS_VERSION:  10.0.22000.1

BUILDLAB_STR:  co_release

OSPLATFORM_TYPE:  x86

OSNAME:  Windows 10

FAILURE_ID_HASH:  {643d38a7-3c1d-4916-5cf1-e595a5ee4454}

Followup:     MachineOwner

五、 kb,无法定位到指定代码行

# ChildEBP RetAddr      Args to Child              
00 04d7e39c 77c10ffe     00027000 74c14000 74bf00f8 ntdll!NtGetContextThread+0xc
01 04d7e704 77c34cdc     04d7e850 77c3d210 c904d499 ntdll!LdrpResSearchResourceMappedFile+0x5e3
02 04d7e72c 76970d16     04d7e83c 00000000 769f5404 ntdll!NtQueryValueKey+0xc
03 04d7e818 77bf9f95     ba1fcc55 00000001 01577be8 KERNELBASE!BaseRegQueryValueInternal+0x396
04 00000000 00000000     00000000 00000000 00000000 ntdll!LdrpDecrementNodeLoadCountLockHeld+0xc

https://blog.csdn.net/shaosheng2008/article/details/126748258

windows系统中用windbg收集程序崩溃信息
如有帮助,望采纳
https://blog.csdn.net/shaosheng2008/article/details/126748258