我如何走好崩溃转储的.NET? [英] How do I take a good crash dump for .NET?
问题描述
我已抓获我在64位Windows操作系统上运行32位.NET应用程序崩溃转储。在分析过程中有人发现我有一个64位转储,并告诉我,这是不可能的这个转储分析由于错误的位数。
I have captured a crash dump of my 32 bit .NET application running on a 64 bit Windows operating system. During the analysis somebody found out that I have a 64 bit dump and told me that it is not possible to analyze this dump due to wrong bitness.
在使用Windows任务管理器来创建转储,我不知道,我是做错了什么。这一直工作了32位操作系统。
When using Windows Task Manager to create the dump, I was not aware that I was doing something wrong. This always worked for 32 bit operating systems.
我怎么能带好转储.NET,特别是与正确的位数?
推荐答案
的位数事项.NET应用程序,原因如下:
Why is bitness relevant here?
The bitness matters for .NET applications for the following reasons:
- 正确位数的DAC(数据访问控制)库(mscordakwks.dll)是必要的。有没有跨位数的DAC提供。
- 在调试器需要能够加载正确的位数 的SOS调试扩展
- a DAC (data access control) library (mscordakwks.dll) of the correct bitness is needed. There's no cross-bitness DAC available.
- the debugger needs to be able to load the SOS debugging extension of the correct bitness
有不可能转储转换64位到32位,虽然在理论上它应包含所有必要的信息。
It is not possible to convert a dump from 64 bit to 32 bit, although in theory it should contain all necessary information.
如果你感到幸运的话,你也可以尝试一些指令反正
If you're feeling lucky, you can also try some of the instructions anyway
- <一个href="http://blogs.msdn.com/b/alejacma/archive/2008/07/18/how-to-use-windbg-to-debug-a-dump-of-a-32bit-.net-app-running-on-a-x64-machine.aspx">How使用WinDbg到64位机 在调试一个32位的.net应用程序运行的转储
- How to use Windbg to debug a dump of a 32bit .NET app running on a x64 machine
如果您不知道位数,你可以找到它出来是这样的:
If you don't know the bitness, you can find it out like this:
Windows 7的任务管理器显示 * 32
上的进程:
Windows 7 Task Manager shows *32
on processes:
在Windows 8的任务管理器,转到详细信息
标签并添加一个名为平台
列:
In Windows 8 task manager, go to the Details
tab and add a column named Platform
:
Visual Studio中显示的位数附加到进程时:
Visual Studio shows the bitness when attaching to the process:
进程资源管理器可以被配置为显示图像类型
列:
Process Explorer can be configured to show the Image Type
column:
方案,其中位数自动检测:
Programs which detect bitness automatically:
- 的Process Explorer
- ProcDump
- 在微软的Visual Studio
- Windows错误报告<一href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb787181%28v=vs.85%29.aspx">LocalDumps
- Process Explorer
- ProcDump
- Microsoft Visual Studio
- Windows Error Reporting LocalDumps
工具,捕获特定位数转储:
Tools which capture a dump with specific bitness:
- 64位:默认的任务管理器在64位操作系统
- 32位:从%WINDIR任务管理器运行%\ Syswow64资料\的TaskMgr.exe在64位操作系统
- 64位: ProcDump 与
运行-64
命令行开关 - 32位:WinDbg的x86版本
- 64位:WinDbg的x64版本的
- 32位:DebugDiag资料x86版本
- 64位:DebugDiag资料64版
- 32位:ADPlus的x86版本
- 64位:ADPlus的x64版本的
- 64 Bit: default Task Manager on a 64 bit OS
- 32 Bit: Task manager run from %windir%\SysWOW64\taskmgr.exe on a 64 Bit OS
- 64 Bit: ProcDump run with the
-64
command line switch - 32 Bit: WinDbg x86 version
- 64 Bit: WinDbg x64 version
- 32 Bit: DebugDiag x86 version
- 64 Bit: DebugDiag x64 version
- 32 Bit: ADPlus x86 version
- 64 Bit: ADPlus x64 version
只是根据你的应用程序,而不是根据操作系统选择的位数。
Just choose the bitness according to your application, not according the OS.
对于.NET,你需要一个完整的内存转储,否则你无法找出对象的内容。要包括完整的内存,请执行以下操作:
For .NET you need a full memory dump, otherwise you cannot figure out the content of the objects. To include full memory, do the following:
- 在WinDbg中,指定
/马
时做使用.dump
- 在进程资源管理器,选择创建完全转储(虽然在技术上,其结果是还是一个小型转储)
- 在 ProcDump ,适用
-ma
命令行开关 - 在Visual Studio中,选择小型转储与堆
- 在任务管理器将始终创建完全内存转储
- 对于Windows错误报告<一href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb787181%28v=vs.85%29.aspx">LocalDumps设置
DumpType
到2
- in WinDbg, specify
/ma
when doing.dump
- in Process Explorer, choose "Create full dump" (although technically, the result is still a minidump)
- in ProcDump , apply the
-ma
command line switch - in Visual Studio, choose "Minidump with heap"
- Task Manager will always create a dump with full memory
- For Windows Error Reporting LocalDumps set
DumpType
to2
我发现许多开发人员甚至不知道的Visual Studio可以创建转储。的原因可能就是菜单是看不见的很长一段时间。这些步骤如下:
I found out that many developers aren't even aware that Visual Studio can create dumps. The reason probably is that the menu is invisible for a long time. These are the steps:
- 在启动Visual Studio:菜单是无形
- 附加到一个进程:菜单仍然看不到
- 突破:菜单显示(发现它在调试/另存为转储)
也许只是调试了WoW64层本身。
Probably just for debugging the WoW64 layer itself.
这篇关于我如何走好崩溃转储的.NET?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!