dump分析流程

一、前言

在实际工作中,我们不能保证发布出去的产品是完美的,就算经过测试没有发现问题,有可能在用户环境就出现了,这也是正常的。如果在用户那边产品崩溃了我们可以怎么检查崩溃的原因呢?下面就简单的记录一下。

二、步骤

1、首先要拿到dump文件,最好是非minidump

2、打开windbg

3、运行命令!analyze -v

显示当前异常相关信息,内容如下:

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

*** ERROR: Symbol file could not be found.  Defaulted to export symbols for QaxEngPluginManager.dll - 
*** WARNING: Unable to verify checksum for Test.exe
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for Test.exe - 
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for IPCManager32.dll - 
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for QKEntDATPBDCtrl32.dll - 
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for QKEntDATPCtrl32.dll - 
Failed calling InternetOpenUrl, GLE=12029

FAULTING_IP: 
KERNELBASE!RaiseException+58
75b6b760 c9              leave

EXCEPTION_RECORD:  ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 75b6b760 (KERNELBASE!RaiseException+0x00000058)
   ExceptionCode: e06d7363 (C++ EH exception)
  ExceptionFlags: 00000001
NumberParameters: 3
   Parameter[0]: 19930520
   Parameter[1]: 0017ede0
   Parameter[2]: 656546f8

DEFAULT_BUCKET_ID:  APPLICATION_FAULT

PROCESS_NAME:  Test.exe

ERROR_CODE: (NTSTATUS) 0xe06d7363 - <Unable to get error code text>

EXCEPTION_CODE: (NTSTATUS) 0xe06d7363 - <Unable to get error code text>

EXCEPTION_PARAMETER1:  19930520

EXCEPTION_PARAMETER2:  0017ede0

EXCEPTION_PARAMETER3:  656546f8

MOD_LIST: <ANALYSIS/>

NTGLOBALFLAG:  0

APPLICATION_VERIFIER_FLAGS:  0

FAULTING_THREAD:  0000046c

PRIMARY_PROBLEM_CLASS:  APPLICATION_FAULT

BUGCHECK_STR:  APPLICATION_FAULT_APPLICATION_FAULT

LAST_CONTROL_TRANSFER:  from 6560a043 to 75b6b760

STACK_TEXT:  
0017ed98 6560a043 e06d7363 00000001 00000003 KERNELBASE!RaiseException+0x58
0017edd0 656079a5 0017ede0 656546f8 6563b2e0 Rule32!_CxxThrowException+0x48 [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\throw.cpp @ 161]
0017edec 65597c55 ded84442 0017f8ac 691837b0 Rule32!operator new+0x64 [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp @ 63]
0017ee04 655967f2 6f6c2221 00000000 0017f6c0 Rule32!std::_Allocate<wchar_t>+0x45 [c:\program files (x86)\microsoft visual studio 9.0\vc\include\xmemory @ 43]
0017ee18 655973b4 6f6c2221 65617437 0017f630 Rule32!std::allocator<wchar_t>::allocate+0x12 [c:\program files (x86)\microsoft visual studio 9.0\vc\include\xmemory @ 145]
0017f63c 65596709 6f6c2220 00000000 0017f658 Rule32!std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::_Copy+0xd4 [c:\program files (x86)\microsoft visual studio 9.0\vc\include\xstring @ 2097]
0017f654 6559655a 6f6c2220 00000000 0017f6c0 Rule32!std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::_Grow+0x39 [c:\program files (x86)\microsoft visual studio 9.0\vc\include\xstring @ 2123]
0017f668 6559d575 20200a7b 6f6c2220 0017f6c0 Rule32!std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::assign+0x4a [c:\program files (x86)\microsoft visual studio 9.0\vc\include\xstring @ 1074]
0017f680 6559c95d 20200a7b 6f6c2220 b8793bcb Rule32!std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >+0x35 [c:\program files (x86)\microsoft visual studio 9.0\vc\include\xstring @ 640]
0017f72c 691a9b6a 00f342d8 009da020 00000000 Rule32!QKMatchWhiteRule::DoAction+0xbd [c:\jenkins\workspace\scc\client_eilcode_exportinterfacelayer@2\code\modules\matchwhiterule\qkmatchwhiterule.cpp @ 115]
WARNING: Stack unwind information not available. Following frames may be wrong.
0017f7f0 691a62ec 00f342d8 009da020 00000000 QaxEngPluginManager!boost::serialization::singleton<CGetEnglog>::get_mutable_instance+0x1fa9a
0017f844 00e93d39 00f342d8 009da020 00000000 QaxEngPluginManager!boost::serialization::singleton<CGetEnglog>::get_mutable_instance+0x1c21c
0017f8d8 774e8424 0000000e 00000008 07192c94 Test!boost::serialization::singleton_module::is_locked+0x1e69
0017f974 774e8662 0017f990 4a78a2bd fffffffe sechost!ScDispatcherLoop+0x4a6
0017f9b4 00e93745 0017f9c4 00f4ce60 009df150 sechost!StartServiceCtrlDispatcherW+0xb0
0017f9d4 00e9c881 4a075889 009d9f08 0000002e Test!boost::serialization::singleton_module::is_locked+0x1875
0017fa98 00e9caa3 0017fb24 ffffffff 00000024 Test!boost::serialization::singleton<CGetEnglog>::get_mutable_instance+0x8021
0017fb44 00effc8e 00e90000 00000000 0034172a Test!boost::serialization::singleton<CGetEnglog>::get_mutable_instance+0x8243
0017fbd4 773e3c45 7ffdd000 0017fc20 778137f5 Test!boost::serialization::singleton<CGetEnglog>::get_mutable_instance+0x6b42e
0017fbe0 778137f5 7ffdd000 77814858 00000000 kernel32!BaseThreadInitThunk+0xe
0017fc20 778137c8 00effcf9 7ffdd000 ffffffff ntdll!__RtlUserThreadStart+0x70
0017fc38 00000000 00effcf9 7ffdd000 00000000 ntdll!_RtlUserThreadStart+0x1b


STACK_COMMAND:  ~0s; .ecxr ; kb

FOLLOWUP_IP: 
Rule32!operator new+64 [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp @ 63]
656079a5 cc              int     3

FAULTING_SOURCE_CODE:  
No source found for 'f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp'


SYMBOL_STACK_INDEX:  2

SYMBOL_NAME:  rule32!operator new+64

FOLLOWUP_NAME:  MachineOwner

MODULE_NAME: Rule32

IMAGE_NAME:  Rule32.dll

DEBUG_FLR_IMAGE_TIMESTAMP:  607947d6

FAILURE_BUCKET_ID:  APPLICATION_FAULT_e06d7363_Rule32.dll!operator_new

BUCKET_ID:  APPLICATION_FAULT_APPLICATION_FAULT_rule32!operator_new+64

WATSON_STAGEONE_URL:  http://watson.microsoft.com/StageOne/Test_exe/2_0_0_23/608ac54d/KERNELBASE_dll/6_1_7601_17514/4ce7b8f0/e06d7363/0000b760.htm?Retriage=1

Followup: MachineOwner
---------

4、点击MODULE_NAME显示的蓝色模块名,获取异常模块的信息

或者使用命令lmvm 模块名查询模块信息

5、设置符号和代码路径

根据Timestamp和File version获取到对应的pdb文件和代码

1)设置代码路径
点击windbg的File——Source File Path——输入模块代码所在路径——点击ok;
或者Ctrl+P打开

2)设置符号表路径
点击windbg的File——Symbol File Path——输入模块pdb文件路径——点击reload——点击ok;
或者直接Ctrl+S打开设置pdb文件路径;
也可以在windbg窗口输入.reload加载pdb文件

3)运行命令!analyze -v
同上

4)执行STACK_COMMAND的命令
如下:

eax=022f0000 ebx=06971020 ecx=00000007 edx=777f70b4 esi=06970fe0 edi=0017c5d4
eip=777f70b4 esp=0017c294 ebp=0017c2a4 iopl=0         nv up ei pl zr na pe nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000246
ntdll!KiFastSystemCallRet:
777f70b4 c3              ret
eax=0017ed48 ebx=65597398 ecx=00000003 edx=00000000 esi=6565f424 edi=0017f630
eip=75b6b760 esp=0017ed48 ebp=0017ed98 iopl=0         nv up ei pl nz ac pe nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000216
KERNELBASE!RaiseException+0x58:
75b6b760 c9              leave
  *** Stack trace for last set context - .thread/.cxr resets it
ChildEBP RetAddr  Args to Child              
0017ed98 6560a043 e06d7363 00000001 00000003 KERNELBASE!RaiseException+0x58
0017edd0 656079a5 0017ede0 656546f8 6563b2e0 Rule32!_CxxThrowException+0x48 [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\throw.cpp @ 161]
0017edec 65597c55 ded84442 0017f8ac 691837b0 Rule32!operator new+0x64 [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp @ 63]
0017ee04 655967f2 6f6c2221 00000000 0017f6c0 Rule32!std::_Allocate<wchar_t>+0x45 [c:\program files (x86)\microsoft visual studio 9.0\vc\include\xmemory @ 43]
0017ee18 655973b4 6f6c2221 65617437 0017f630 Rule32!std::allocator<wchar_t>::allocate+0x12 [c:\program files (x86)\microsoft visual studio 9.0\vc\include\xmemory @ 145]
0017f63c 65596709 6f6c2220 00000000 0017f658 Rule32!std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::_Copy+0xd4 [c:\program files (x86)\microsoft visual studio 9.0\vc\include\xstring @ 2097]
0017f654 6559655a 6f6c2220 00000000 0017f6c0 Rule32!std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::_Grow+0x39 [c:\program files (x86)\microsoft visual studio 9.0\vc\include\xstring @ 2123]
0017f668 6559d575 20200a7b 6f6c2220 0017f6c0 Rule32!std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::assign+0x4a [c:\program files (x86)\microsoft visual studio 9.0\vc\include\xstring @ 1074]
0017f680 6559c95d 20200a7b 6f6c2220 b8793bcb Rule32!std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >+0x35 [c:\program files (x86)\microsoft visual studio 9.0\vc\include\xstring @ 640]
0017f72c 691a9b6a 00f342d8 009da020 00000000 Rule32!QKMatchWhiteRule::DoAction+0xbd [c:\jenkins\workspace\scc\client_eilcode_exportinterfacelayer@2\code\modules\matchwhiterule\qkmatchwhiterule.cpp @ 115]
WARNING: Stack unwind information not available. Following frames may be wrong.
0017f7f0 691a62ec 00f342d8 009da020 00000000 Test!boost::serialization::singleton<CGetEnglog>::get_mutable_instance+0x1fa9a
0017f844 00e93d39 00f342d8 009da020 00000000 Test!boost::serialization::singleton<CGetEnglog>::get_mutable_instance+0x1c21c
0017f8d8 774e8424 0000000e 00000008 07192c94 Test!boost::serialization::singleton_module::is_locked+0x1e69
0017f974 774e8662 0017f990 4a78a2bd fffffffe sechost!ScDispatcherLoop+0x4a6
0017f9b4 00e93745 0017f9c4 00f4ce60 009df150 sechost!StartServiceCtrlDispatcherW+0xb0
0017f9d4 00e9c881 4a075889 009d9f08 0000002e Test!boost::serialization::singleton_module::is_locked+0x1875
0017fa98 00e9caa3 0017fb24 ffffffff 00000024 Test!boost::serialization::singleton<CGetEnglog>::get_mutable_instance+0x8021
0017fb44 00effc8e 00e90000 00000000 0034172a Test!boost::serialization::singleton<CGetEnglog>::get_mutable_instance+0x8243
0017fbd4 773e3c45 7ffdd000 0017fc20 778137f5 Test!boost::serialization::singleton<CGetEnglog>::get_mutable_instance+0x6b42e
0017fbe0 778137f5 7ffdd000 77814858 00000000 kernel32!BaseThreadInitThunk+0xe
0017fc20 778137c8 00effcf9 7ffdd000 ffffffff ntdll!__RtlUserThreadStart+0x70
0017fc38 00000000 00effcf9 7ffdd000 00000000 ntdll!_RtlUserThreadStart+0x1b

5)执行knL

0:000> knL
  *** Stack trace for last set context - .thread/.cxr resets it
 # ChildEBP RetAddr  
00 0017ed98 6560a043 KERNELBASE!RaiseException+0x58
01 0017edd0 656079a5 Rule32!_CxxThrowException+0x48
02 0017edec 65597c55 Rule32!operator new+0x64
03 0017ee04 655967f2 Rule32!std::_Allocate<wchar_t>+0x45
04 0017ee18 655973b4 Rule32!std::allocator<wchar_t>::allocate+0x12
05 0017f63c 65596709 Rule32!std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::_Copy+0xd4
06 0017f654 6559655a Rule32!std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::_Grow+0x39
07 0017f668 6559d575 Rule32!std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::assign+0x4a
08 0017f680 6559c95d Rule32!std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >+0x35
09 0017f72c 691a9b6a Rule32!Rule::DoAction+0xbd
WARNING: Stack unwind information not available. Following frames may be wrong.
0a 0017f7f0 691a62ec Test!boost::serialization::singleton<CGetEnglog>::get_mutable_instance+0x1fa9a
0b 0017f844 00e93d39 Test!boost::serialization::singleton<CGetEnglog>::get_mutable_instance+0x1c21c
0c 0017f8d8 774e8424 Test!boost::serialization::singleton_module::is_locked+0x1e69
0d 0017f974 774e8662 sechost!ScDispatcherLoop+0x4a6
0e 0017f9b4 00e93745 sechost!StartServiceCtrlDispatcherW+0xb0
0f 0017f9d4 00e9c881 Test!boost::serialization::singleton_module::is_locked+0x1875
10 0017fa98 00e9caa3 Test!boost::serialization::singleton<CGetEnglog>::get_mutable_instance+0x8021
11 0017fb44 00effc8e Test!boost::serialization::singleton<CGetEnglog>::get_mutable_instance+0x8243
12 0017fbd4 773e3c45 Test!boost::serialization::singleton<CGetEnglog>::get_mutable_instance+0x6b42e
13 0017fbe0 778137f5 kernel32!BaseThreadInitThunk+0xe
14 0017fc20 778137c8 ntdll!__RtlUserThreadStart+0x70
15 0017fc38 00000000 ntdll!_RtlUserThreadStart+0x1b

6)执行.frame 9
由5)可知,在线程9开始异常(也可以在执行STACK_COMMAND的命令时按顺序从00开始,获取对应序号值);
若代码和pdb匹配,执行命令后会跳转到代码对应位置

7)查看该接口的参数值
点击windbg菜单的Locals或者Alt+3
在这里插入图片描述
之后出现下图弹窗:
在这里插入图片描述
到这里,我们就可以查看参数值,判断为什么崩溃了,由堆栈信息可知,是在申请空间的时候崩溃了,结合代码发现,需申请
在这里插入图片描述
这么大的空间,但是内存空间不足,同时没有异常处理机制,所以崩溃了。

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: Dump文件是指操作系统或应用程序在出现错误或崩溃时生成的一种二进制文件,用于记录程序运行时的内存和寄存器状态等重要信息。在分析dump文件时,我们可以通过各种工具和技术进行在线分析。 首先,我们可以使用调试器来加载和分析dump文件。调试器是一种可以查看和修改程序的运行状态的工具,它可以帮助我们理解程序在崩溃时的情况。通过调试器,我们可以查看程序的调用栈、变量值和寄存器状态等,从而找到导致程序崩溃的原因。 另外,还有一些专门用于分析dump文件的工具。例如,Windbg是一种强大的调试工具,它可以加载和分析Windows系统生成的dump文件。通过Windbg,我们可以查看程序的内存使用情况,跟踪程序的执行流程,并分析崩溃时的堆栈信息。此外,还有一些第三方工具如WinDbgX、DumpChk等也可以帮助我们对dump文件进行分析。 在线分析dump文件的好处在于可以直接在操作系统或云平台上进行,无需将dump文件下载到本地。这样可以节省时间和网络带宽,并提高分析效率。同时,在线分析还能够利用云平台的计算资源,加快分析速度,特别是当dump文件较大或分析复杂时。 综上所述,通过调试器和专业工具,在线分析dump文件可以帮助我们定位和解决程序的错误和崩溃问题,提高软件质量和稳定性。在线分析还具有高效快捷的特点,适用于各种规模和类型的应用程序。 ### 回答2: dump文件分析在线是指通过在线工具或平台对dump文件进行分析和解析。dump文件是指计算机系统在运行时出现异常或崩溃时生成的一种二进制文件,其中包含了系统状态、内存数据、寄存器值等关键信息,利用这些信息可以进行相关故障排查和问题分析。 在线分析工具通常提供了一系列功能,包括自动解析和显示dump文件的内容,提供基本的系统状态信息,如进程、线程、模块等,以及其他相关调试信息。它们还可以显示内存转储的内容和分析错误的原因。 通过在线分析工具,我们可以深入分析dump文件并识别问题的根源。例如,可以显示当前运行的进程和线程状态、调用堆栈(stack trace)信息、异常代码等。这些功能可以帮助开发人员定位并解决系统异常或崩溃的问题。 在线分析dump文件的好处包括方便快捷、无需下载安装额外软件,同时也保证了数据的安全性,防止机密信息泄露。此外,一些在线工具还提供了数据导出功能,便于进一步分析和处理。 总而言之,dump文件分析在线是指通过利用在线工具或平台对dump文件进行分析和解析,以便于开发人员和系统管理员快速定位和解决计算机系统异常或崩溃问题。 ### 回答3: dump文件分析是指对运行中的程序产生的崩溃文件或转储文件进行解读和调试的过程。这些dump文件中包含了程序在崩溃或异常时的内存状态和代码执行轨迹等关键信息,通过分析这些信息可以帮助开发人员定位和解决程序的问题。 在线的dump文件分析平台提供了一种方便快捷的方式来进行dump文件的分析。用户可以将dump文件上传至该平台,然后平台会对文件进行解析和分析,提取出关键信息并进行可视化展示。 通过在线dump文件分析,用户可以获得以下几方面的帮助: 首先,分析平台可以快速定位崩溃的原因。通过解析dump文件中的信息,平台可以提供详细的调用堆栈和错误信息,帮助开发人员准确定位问题代码。 其次,分析平台可以提供运行时内存状态的可视化。开发人员可以查看dump文件中的内存快照,了解程序在崩溃之前的内存分配情况和对象状态,有助于深入理解问题出现的原因。 此外,分析平台还可以提供相关的建议和解决方案。基于对dump文件的分析,平台可以向用户提供类似问题的解决方案或者给出可能的线索,帮助开发人员更快地解决问题。 总之,在线dump文件分析是一种方便、高效的调试辅助工具,通过它开发人员可以更快地定位和解决程序的问题,提高开发效率。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值