应用程序崩溃时如何生成Windows内存转储? [英] How to generate windows memory dump when application crashes.?

查看:313
本文介绍了应用程序崩溃时如何生成Windows内存转储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种简便的方法来为崩溃的应用程序生成内存转储?

Is there an easy way of generating the memory dump for the crashed application?

我遇到这样的情况:客户收到了生成崩溃的代码,因为代码本身没有在中止时生成回溯的信号处理程序,所以我想知道是否有一种简单的方法来告诉Windows生成崩溃应用程序的内存转储。

I have a situation in which the customer received the code which is generating the crash, as the code itself has no signal handlers for the backtrace generation on abort I was wondering if there is an easy way of telling windows to generate the memory dump of the crashing application.

理想的解决方案不会涉及调试工具的安装(或代码修改),但是如果不可能,知道这将非常有帮助。

Ideal solution wouldn't involve the installation of the debug tools (or the code modification) but if this is not possible, it would be really helpful to know.

推荐答案


  1. 应用程序崩溃时转储内存的一种简单方法是使用Windows taskmanager。
    发生异常或应用程序错误时,Windows会弹出一个内存对话框并显示导致崩溃的地址位置。在消息框上单击确定之前,请打开任务管理器,然后右键单击崩溃的应用程序并选择创建转储文件。看下面的屏幕快照。
    选择文件

2)生成用户模式转储的另一种方法是添加以下注册表项

2)Another way of generating user mode dumps is by adding the following registry key


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows错误报告> ; \LocalDumps\application.exe
application.exe应该替换为扫描仪下的应用程序名称。

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting >\LocalDumps\application.exe application.exe should be replaced by the application name which is under scanner.

可以添加以下值


DumpFolder

转储文件的存储路径。如果不使用默认路径,请确保该文件夹包含ACL,这些ACL允许崩溃的进程将数据写入该文件夹。
对于服务崩溃,转储将根据使用的服务帐户写入服务特定的配置文件文件夹。例如,系统服务的配置文件文件夹是%WINDIR%\System32\Config\SystemProfile。对于网络和本地服务,该文件夹是%WINDIR%\ServiceProfiles。

The path where the dump files are to be stored. If you do not use the default path, then make sure that the folder contains ACLs that allow the crashing process to write data to the folder. For service crashes, the dump is written to service specific profile folders depending on the service account used. For example, the profile folder for System services is %WINDIR%\System32\Config\SystemProfile. For Network and Local Services, the folder is %WINDIR%\ServiceProfiles.


DumpCount

文件夹中转储文件的最大数量。当超过最大值时,文件夹中最旧的转储文件将被新的转储文件替换。

The maximum number of dump files in the folder. When the maximum value is exceeded, the oldest dump file in the folder will be replaced with the new dump file.


DumpType

指定以下转储类型之一:
0:自定义转储
1:小型转储
2:完全转储

Specify one of the following dump types: 0: Custom dump 1: Mini dump 2: Full dump


CustomDumpFlags

自定义转储选项使用。仅当DumpType设置为0时,才使用此值。
选项是MINIDUMP_TYPE枚举值的按位组合。

The custom dump options to be used. This value is used only when DumpType is set to 0. The options are a bitwise combination of the MINIDUMP_TYPE enumeration values.

这篇关于应用程序崩溃时如何生成Windows内存转储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆