Getting the right Exception Context from a Memory dump Fixed
吃饭回来,看到Share Source CLI团队的rss聚合上面Debug团队的juqiang发了一篇文章,说抓了一个minidump出现了:
WARNING: Unable to verify timestamp for mscorwks.dll的错误。上次我在查看一个mini Dump的时候,ntdll.dll好像也出现过这个问题,当时把符号文件重新加载了一次就OK了。这次看到他出现了同样的问题,忍不住要看看到底是什么原因导致这个问题,很幸运在Junfeng Zhang's Windows Programming Notes上面找到了一个完整的相同比较经典的案例,才贴上去的就被我找到了,:),贴出来一看就知道了:
When debug a memory dump, the dump may not in the right exception context when it is first loaded in the debugger. However, we can figure out the right context from the dump. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Let's load the dump.
c:\debuggers>cdb -z c:\temp\foo.dmp
Symbol search path is: *** Invalid ***
****************************************************************************
* Symbol loading may be unreliable without a symbol search path. *
* Use .symfix to have the debugger choose a symbol path. *
* After setting your symbol path, use .reload to refresh symbol locations. *
****************************************************************************
Executable search path is:
Windows XP Version 2600 (Service Pack 2) MP (4 procs) Free x86 compatible
Product: WinNt, suite: SingleUserTS
Debug session time: Tue Feb 26 07:14:42.000 2008 (GMT-8)
System Uptime: not available
Process Uptime: 0 days 2:07:05.000
......................................
This dump file has an exception of interest stored in it.
The stored exception information can be accessed via .ecxr.
(8c4.3d8): Wake debugger - code 80000007 (first/second chance not available)
eax=00000000 ebx=7c884700 ecx=0006ee6c edx=7c90eb94 esi=00000000 edi=0006f40c
eip=7c90eb94 esp=0006ee78 ebp=0006f528 iopl=0 nv up ei pl zr na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246
*** WARNING: Unable to verify timestamp for ntdll.dll
*** ERROR: Module load completed but symbols could not be loaded for ntdll.dll
ntdll+0xeb94:
7c90eb94 c3 ret
Let’s load symbols first.
0:000> .sympath SRV*c:\websymbols*http://msdl.microsoft.com/download/symbols
Symbol search path is: SRV*c:\websymbols*http://msdl.microsoft.com/download/symbols
0:000> .reload
......................................
Unfortunately .ecxr did not give us the right context.
0:000> .ecxr
eax=00000000 ebx=7c884700 ecx=0006ee6c edx=7c90eb94 esi=00000000 edi=0006f40c
eip=7c90eb94 esp=0006ee78 ebp=0006f528 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:
7c90eb94 c3 ret
0:000> kb
ChildEBP RetAddr Args to Child
0006ee74 7c90e273 7c863487 d0000144 00000004 ntdll!KiFastSystemCallRet
0006ee78 7c863487 d0000144 00000004 00000000 ntdll!NtRaiseHardError+0xc
//这个Filter是dbghelp.dll里面的MiniDumpWriteDump()方法来处理的。
0006f528 77c32f0f 0006f578 00000000 00000000 kernel32!UnhandledExceptionFilter+0x653
0006f544 01006484 80000003 0006f578 01009818 msvcrt!_XcptFilter+0x161
WARNING: Stack unwind information not available. Following frames may be wrong.
0006ffc0 7c816fd7 00000016 03d7f12c 7ffd6000 foo+0x6484
0006fff0 00000000 0100660c 00000000 00000000 kernel32!BaseProcessStart+0x23
However, Kernel32!UnhandledExceptionFilter is on the stack. UnhandledExceptionFilter takes an EXCEPTION_POINTERS structure as its parameter, which contains the exception context.
0:000> dc 0006f578
0006f578 0006f69c 0006f6bc 01013ea4 00000001 .........>......
0006f588 fffffffe 0006f5b0 0006f5b0 01009c32 ............2...
0006f598 01015100 010066ff 0006f69c 0006ffb0 .Q...f..........
0006f5a8 0006f6bc 0006f670 0006f5d4 7c9037bf ....p........7.|
0006f5b8 0006f69c 0006ffb0 0006f6bc 0006f670 ............p...
0006f5c8 0006fd4c 7c9037d8 0006ffb0 0006f684 L....7.|........
0006f5d8 7c90378b 0006f69c 0006ffb0 0006f6bc .7.|............
0006f5e8 0006f670 01009c12 00000001 0006f69c p...............
We can change to the exception context.
0:000> .cxr 0006f6bc
eax=0006a1fa ebx=6a803bd8 ecx=00353ee8 edx=00080608 esi=6a8043d8 edi=6a8045c0
eip=7c901230 esp=0006f988 ebp=0006fca4 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!DbgBreakPoint:
7c901230 cc int 3
Now we have the correct exception context.
0:000> k
*** Stack trace for last set context - .thread/.cxr resets it
ChildEBP RetAddr
0006f984 6a870952 ntdll!DbgBreakPoint
WARNING: Stack unwind information not available. Following frames may be wrong.
0006fca4 6a8755f9 bar+0x70952
0006fcd4 6a8757ae bar+0x755f9
0006fcf0 6a86f49e bar+0x757ae
0006fcfc 6a86fc06 bar+0x6f49e
0006fd5c 7c9011a7 bar+0x6fc06
0006fd7c 7c923f31 ntdll!LdrpCallInitRoutine+0x14
0006fe00 7c81cd76 ntdll!LdrShutdownProcess+0x14f
0006fef4 7c81cdee kernel32!_ExitProcess+0x42
0006ff08 77c39d45 kernel32!ExitProcess+0x14
0006ff14 77c39e78 msvcrt!__crtExitProcess+0x32
0006ff24 77c39e90 msvcrt!_cinit+0xee
0006ff38 0100645e msvcrt!exit+0x12
0006ffc0 7c816fd7 foo+0x645e
0006fff0 00000000 kernel32!BaseProcessStart+0x23
Getting the right Exception Context from a Memory dump Fixed相关推荐
- qualcomm memory dump 抓取方法
Memory dump是系统出现crash时常用的分析故障原因的方法,qualcomm 各子系统运行时,为方便debug,都会开辟ram log和debug variable用于保存各系统运行信息及健 ...
- 计算机蓝屏分析报告,报告蓝屏: 如何提供内存转储(Memory Dump)文件
如果您在使用我们的软件产品时遇到蓝屏或自动重启的问题,我们的技术支持可能要求提供蓝屏相关的内存转储文件以便分析.请参照以下步骤提供内存转储文件. 步骤 1. 禁止自动重启 在控制面板打开系统,在高级页 ...
- IDA memory dump
0x00 前言 这几天有个需求,要用ida dump内存,我的是ida7.7,在吾爱破解上下载的.百度了一下,发现网上的都用不了,然后整理了一下,供大家使用 0x01 IDC脚本 ida中,按 Shi ...
- Plugin: Memory Dump by aeon update 12.10
http://bbs.pediy.com/showthread.php?t=56364
- 系统诊断概述-如何通过windbg来dump特定process的memory.
关键字:系统异常system exception 内存dump (信息转储),windbg工具. 1.为什么需要dump 内存 系统经常出现各种各样的问题,这些问题,可能是本身程序设计的时候 ...
- Context与ContextImpl
Context在Android应用开发中占据了绝对重要的地位,不管是Framework提供给我们的四大组件还是应用级别的Application,还是负责View展现层的View相关类,甚至连我们很多时 ...
- Meltdown: Reading Kernel Memory from User Space论文翻译
Meltdown: Reading Kernel Memory from User Space翻译 摘要(Abstract) The security of computer systems fund ...
- 深入理解计算机系统——第九章 Virtual Memory
深入理解计算机系统--第九章 Virtual Memory 9.1 Physical and Virtual Addressing 9.2 Address Spaces 9.3 VM as a Too ...
- Which one is faster: Java heap or native memory?
2019独角兽企业重金招聘Python工程师标准>>> Which one is faster: Java heap or native memory? 11-29-2012 by ...
最新文章
- flash写保护原理_一种基于flash写保护的防止flash被意外篡改的方法与流程
- 在线图表编辑工具 draw.io 10.6.2 版本发布
- jQuery刻度尺滚动滑块插件
- 武汉火神山医院正式交付,华为提供多项技术支持
- 【AI视野·今日CV 计算机视觉论文速览 第173期】Wed, 25 Dec 2019
- matlab关于向量的基本操作
- cloudare mysql 密码修改_CentOS7.3 LAMP环境搭建私有云NextCloud过程记录
- 【BZOJ 3681】Arietta
- 免费图书借阅+php源码,开源php图书管理系统
- php怎么画五星红旗,php基于GD库画五星红旗的方法
- missing privilege separation directory /var/empty/sshd问题解决
- 今晚与小妹亚美合作了一把qq游戏,大获全胜!
- 提高医疗信息化或是解决看病难看病贵的有效助剂
- macbook 终端命令怎么使用_苹果MAC系统怎么使用ping命令打开终端?
- 记账分享:如何记录收支明细,并分析、打印保存。
- pat1034Head of a Gang (30)
- Java 数据结构与算法
- 倒计时3天!第二届数字孪生城市建设与产业发展高峰论坛不见不散
- 计算摄影:基于深度学习的畸变校正
- C语言交通灯数码管,51单片机数码管交通灯程序
热门文章
- hdu-6165(tarjan+topusort)
- SQL Server:SQL Like 通配符特殊用法:Escape
- 使用Instant Client配置PL/SQL Developer
- 【循序渐进学Python】14.数据库的支持
- [19/04/23-星期二] GOF23_创建型模式(工厂模式、抽象工厂模式)
- DPDK helloworld 源码阅读
- JavaScript 详说事件机制之冒泡、捕获、传播、委托
- GCPC2014 C Bounty Hunter
- 线程类C++多线程框架(一)--------- new一下就启动一个线程
- 分清DB_NAME、INSTANCE_NAME、ORACLE_SID、SERVICE_NAME、DB_DOMAIN和GLOBAL_DB_NAME