How to Create Dump File for Applications
使用WinDBG这个工具,可以在应用程序异常终止或者无响应时获取它的尸体,以用来解剖研究。
Creating Dump File
在Vista环境中抓取Dump文件很方便,在task manager(Ctrl-Shift-Esc)中,选中要生成dump文件的进程,点击context menu中的"Creat Dump File"就可以了.
通常,使用WinDBG目录下(C:/Program Files/Debugging Tools for Windows (x86))的adplus.vbs来抓取dump file.
adplus -hang -p 2960 //当进程2960失去响应时生成dump
adplus -crash -pn w3wp.exe //在w3wp.exe终止或被回收时生成dump
adplus -crash -pn w3wp.exe -NoDumpOnFirst //同上,不对 first chance exceptions生成dump
adplus是一个vb script文件,运行CDB(就是命令行下的WinDBG),负责监视系统中将要发生的异常.
Adplus参数设置
| -huang |
进程运行时,随时可以使用-hang参数得到一个Dump文件, 而不需要考虑线程是否真的处于死锁中,用于诊断高内存使用率, 高CPU使用率。 |
| -crash | 在进程异常终止时抓取dump file. 进程异常终止有3种情况: 1.unhandled的exception 2.asp.net进程由于iis reset或recycle而终止. 3.出现heap毁坏,栈溢出,内存不足等错误,进程必须退出 |
| -pn | 指定要分析的进程名。使用多个“-pn process name”开关来指定多个进程。 |
| -o |
dump file的存储路径,缺省为adplus所在路径 |
| -FullOnFirst | create full dumps on first chance exceptions |
| -MiniOnSecond | |
| -NoDumpOnFirst | 如果exception被try-catch block处理,使用这个参数就不会生成dump file |
| -NoDumpOnSecond | |
| -quiet | No dialog boxes will be displayed |
什么是First Chance Exception 和 Second Chance Exception?
当程序抛出异常(.net 或 native exception),此时这个exception为1st chance exception,如果这个exception 没有被 try-catch block处理,这个exception就会成为2nd chance exception (unhandled exception) 当前进程随后终止.
什么是Mini Dump 和Full Dump?
user-mode Mini Dump,保存了进程crash时virtual memory的部分内容.有些SOS的命令在Mini Dump上不能工作.Mini Dump的内容和大小和被dump的程序有关.Mini Dump所包含的信息并不一定比Full Dump少.
Full User-Mode Dumps包含了进程的整个内存空间,程序的image,handle table等调试信息.
Adplus的输出
adplus.vbs所在的路径下生成一个目录,形如<crash或 huang>_Mode__Date_07-22-2008__Time_10-35-1212,目录中包含
- CDBScripts - 包含用来通知windbg/cdb运行什么命令的配置文件的文件夹。
- ADPlus_report.txt - 记录adplus Attach到进程以后的信息
- PID-<进程ID>__<进程 名>.EXE__Date_07-18-2008__Time_14-55-0505.log - adplus的运行时日志,在hang模式下,这个文件里包括堆栈里所有线程、已经加载的模块的信息和等同于执行!runaway命令的输出结果。如果内 存转储文件创建失败,可以到这个文件的底部去查找原因。
- PID-<进程ID>__<进程 名>.EXE__full_1c38_2008-07-18_14-59-08-005_1618.dmp - 就是dump file
- Process_List.txt - tlist.exe 的输出,显示在生成内存转储文件的时候,系统中有多少进程在同时运行。
如果程序由于unhandled exception而终止,会得到多个dump,比如
PID-4588__ASPNET_WP.EXE__1st_chance_AccessViolation__mini_15b8_2008-07-22_10-35-28-827_11ec.dmp
PID-4588__ASPNET_WP.EXE__1st_chance_Process_Shut_Down__full_15b8_2008-07-22_10-35-36-609_11ec.dmp
PID-4588__ASPNET_WP.EXE__2nd_chance_NET_CLR__full_15b8_2008-07-22_10-35-29-420_11ec.dmp
PID-4588__ASPNET_WP.EXE__Date_07-22-2008__Time_10-35-1212.log
Process_List.txt
这些dump文件表明:
首先发生了一个非法访问,也许就是一个NullReferenceException,adplus捕获到这个Exception,生成一个mini dump(1st_chance_AccessViolation__mini)
这个Exception没有被处理,就接着产生CLR exception 对应的dump(2nd_chance_NET_CLR__full)
然后进程终止,产生dump file: 1st_chance_Process_Shut_Down__full
真正用来解决问题的是2nd Chance CLR Exception 对应的dump file
如果只得到一个dump,就可以证明crash不是由于unhandled exception引起的
Adplus的高级用法
可以给adplus指定配置文件,在某个特定的Exception发生时生成dump file,并把dump file存在特定目录下
adplus -c myconfig.cfg -pn w3wp.exe
| myconfig.cfg |
|
<ADPlus> |
http://blog.csdn.net/harbinzju/article/details/5844752
How to Create Dump File for Applications的更多相关文章
- Debug program crash with dump file.
1. Task manager, -> find the process for the program which crashed. 2. Right click the process -& ...
- Debug Dump file
dump file is a snapshot of the processs memeory. to debug it, we need use its corresponding executiv ...
- HOWTO: Create native-looking iPhone/iPad applications from HTML, CSS and JavaScript
HOWTO: Create native-looking iPhone/iPad applications from HTML, CSS and JavaScript Though it's not ...
- javax.imageio.IIOException: Can't create cache file!
javax.imageio.IIOException: Can't create cache file! at javax.imageio.ImageIO.createImageInputStream ...
- Couldn't create temporary file to work with
Ubuntu中当你编译安装软件的时候可能会出现Couldn't create temporary file to work with,原因可能是: 1.权限问题 2.根目录下没有tmp文件夹 解决办 ...
- MySQL [Warning] Can’t create test file xxx lower-test(转)
add by zhj:修改的数据库的datadir,然后数据库就无法启动了,错误如下 2014-12-11 16:22:57 26309 [Warning] Can't create test fil ...
- linux,安装软件报错cannot create regular file '/usr/local/man/man1': No such file or directory
make install时报错,如下 install: cannot create regular file '/usr/local/man/man1': No such file or direct ...
- mysql 无法启动的原因Can't start server: can't create PID file: No space left on device
一大早来到公司,看到了一个噩梦,后台总是登录不上,登录就出错,还以为被黑客入侵了.经过1个小时的排错原因如下: 我的服务器是linux的,mysql的报错日志路径是/var/log/,经过查看日志发现 ...
- 网页验证码出不来,读取验证码时出错:javax.imageio.IIOException: Can't create cache file!
版权声明:本文为博主原创文章,仅作为学习交流使用 转载请注明出处 https://www.cnblogs.com/linck/p/10593053.html 今天打开项目时,发现登陆界面的验证码出不来 ...
随机推荐
- 挺有意思的HBase日志+Splunk
如题,转载自: http://hi.baidu.com/harry_lime/item/10cf2c174853c7ea39cb3042 如何模拟拔盘操作 Linux has a nifty way ...
- HDU2084:数塔(DP)
Problem Description 在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的: 有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大 ...
- MySQL Cluster-备份恢复初步测试
参考文档 http://blog.chinaunix.net/uid-20639775-id-1617795.html http://xxtianxiaxing.iteye.com/blog/5 ...
- cocos2d-x游戏开发系列教程-超级玛丽10-怪物与马里奥冲突检测
在超级玛丽游戏中,马里奥在移动,怪物也在移动,当他们遇见时,需要判断是马里奥身亡还是怪物身亡. 这个判断的代码在怪物类的检测函数实现中. 比如蘑菇怪的冲突检测函数: bool CMMonsterMus ...
- 1298 The Hardest Problem Ever
题目链接:http://poj.org/problem?id=1298 思路分析:水题,字符偏移求解,注意字符串输入问题即可. 代码如下: #include <iostream> #inc ...
- 最全的LBS手机定位技术说明
随着手机技术的发展定位方式也发生了非常大的变化.获取手机位置有非常多种方式. 第一种:CELL-ID定位原理 通过移动网络获取设备当前所在的Cell信息来获取设备当前位置.当设备位置更新设备会向当前服 ...
- Android 一个绚丽的loading动效分析与实现!
http://blog.csdn.net/tianjian4592/article/details/44538605 前两天我们这边的头儿给我说,有个 gif 动效很不错,可以考虑用来做项目里的loa ...
- 【Tomcat】本地域名访问设置
原路径:localhost:8080/tidyko 1.去掉8080端口 打开%TOMCAT_HOME%/conf/server.xml 修改里面的 <Connector connectionT ...
- CentOS 安装easy_install、pip的方法
CentOS 安装easy_install的方法: wget -q http://peak.telecommunity.com/dist/ez_setup.py python ez_setup.py ...
- ORACLE存储过程笔记1
ORACLE存储过程笔记1 一.基本语法(以及与informix的比较) create [or replace] procedure procedure_name (varible {IN|OUT ...