如何解决.NET 2.0错误报告在事件消息日志? [英] How to troubleshoot .NET 2.0 Error Reporting messages in the event log?
问题描述
我叫上一个开放源码的产品配合使用 EVEMon 用C#编写面向.NET 2.0的平台,我有谁正在遭受一个用户从我们一直无法解决一个奇怪的.NET崩溃
事件类型:错误
事件来源:.NET运行库2.0错误报告
事件类别:无
事件ID:5000
日期:2009年4月29日
时间:下午10点58分10秒
的用户:N /一个
计算机:移除了这个
说明:
事件类型clr20r3,P1 evemon.exe,P2 1.2.7.1301,P3 49ea37c8,P4
System.Windows.Forms的,P5 2.0.0.0 ,P6 4889dee7,P7 6cd3,P8 18 P9
system.argumentexception,P10 NIL。
数据:上面说明
的
//十六进制表示
应用程序本身崩溃与出(尽管有一个错误处理用户界面)显示错误,上述消息被复制出来的Windows事件日志。最终用户已经重新安装了.NET和更新到最新版本。该.PDB文件与程序的每个发行版本分布在调试和测试,以帮助,与有关问题的用户有PDB文件EVEMon的正确版本的全套。
是否有分析和诊断这种类型的崩溃的一个特定的,久经考验的技术?如果是这样的工具和技术可以为调试提供帮助?
特别感谢
我想特别感谢斯特芬欧宝并强调的他的回答虽然没有直接回答我问的问题,解决更大的问题与我的代码库,全球错误处理缺少的一个重要组成部分。
这是我会怎么解决的一个碰撞一个最终用户的问题。
-
下载并安装在 http://www.microsoft调试的Windows工具。 COM / WHDC / devtools /调试/ default.mspx
-
一旦工具安装(他们最终去到C:\Program文件\默认情况下)启动命令行窗口
-
更改到包含ADPlus的目录(如C:\Program Files\Debugging工具视窗(86))。
-
运行follwing命令。这将启动应用程序,附加ADPlus的。
ADPlus的-crash -o C:\debug\ -FullOnFirst -sc C:\path\to\your\app.exe
块引用>
创建崩溃转储后
一旦应用程序崩溃开始的WinDbg和加载在C创建.dmp文件: \debug。 (文件 - >打开崩溃转储)。
执行这些命令查看堆栈跟踪和希望查找问题
要加载SOS进行调试
- 预.NET 4.0
.loadby索斯mscorwks
< /块引用>
- .NET 4.0
.loadby SOS CLR
块引用>
要看到的堆栈跟踪
!clrstack
要看到更多有用的堆栈跟踪
!clrstack -p
要捅内的object..perhaps看到什么导致异常
$ !b $ bDO<地址>
例如这是从与IO异常随机故障一个应用的结果。 。WinDbg中指出,如果要引用这是不正确的路径。
0:009> !做017f2b7c
名称:System.String
方法表:790fd8c4
EEClass:790fd824
尺寸:124(0x7c)字节
(C:\\\\WINDOWS\assembly \GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll)
字符串:\\server\path\\\
ot_here.txt
领域:
MT字段偏移类型VT的Attr值名称
79102290 4000096 4 System.Int32 1实例54 m_arrayLength
79102290 4000097 8 System.Int32 1实例53 m_stringLength
790ff328 4000098çSystem.Char 1实例5C m_firstChar
790fd8c4 4000099 10 System.String 0共享静态空
>>域名:值00161df8:790d884c<<
7912dd40 400009a 14 System.Char [] 0共享静态WhitespaceChars
>>域名:值00161df8:014113e8<<
I work on an open source product called EVEMon written in C# targeting the .NET 2.0 platform, I have one user who is suffering from a strange .NET crash that we have been unable to resolve.
Event Type: Error Event Source: .NET Runtime 2.0 Error Reporting Event Category: None Event ID: 5000 Date: 4/29/2009 Time: 10:58:10 PM User: N/A Computer: removed this Description: EventType clr20r3, P1 evemon.exe, P2 1.2.7.1301, P3 49ea37c8, P4 system.windows.forms, P5 2.0.0.0, P6 4889dee7, P7 6cd3, P8 18, P9 system.argumentexception, P10 NIL. Data: //hex representation of the above DescriptionThe application itself crashes with out displaying an error (despite having a error handling UI), the above messages was copied out of the Windows Event log. The end user has re-installed .NET and updated to the latest versions. The .PDB files are distributed with every release version of the program to aid in debugging and testing, the user with the problem in question has the full complement of PDB files for the correct version of EVEMon.
Is there a specific, tried and tested technique to analyse and diagnose this type of crash? and if so what tools and technologies are available to aid in debugging?
Special Thanks
I would like to give special thanks to Steffen Opel and highlight that his answer whilst not directly answering the question I was asking, addressed the bigger issue with my code base that the global error handling was missing an important component.
解决方案This is how I would tackle the problem for a end user with a crash.
Download and install Debugging Tools for Windows at http://www.microsoft.com/whdc/devtools/debugging/default.mspx
Once the tools are installed (they end up going to C:\Program Files\ by default) start a command line window.
Change to the directory which contains adplus (e.g "C:\Program Files\Debugging Tools for Windows (x86)").
Run the follwing command. This will start the application and attach adplus.
adplus -crash -o C:\debug\ -FullOnFirst -sc C:\path\to\your\app.exe
After the crash dump is created
Once the application crashes start WinDbg and load the .dmp file that is created in C:\debug. (File --> Open Crash Dump)
Execute these commands to see the stack trace and hopefully find the problem.
To load SOS for debugging
- Pre .NET 4.0
.loadby sos mscorwks
- .NET 4.0
.loadby sos clr
To see the stack trace
!clrstack
To see a more useful stack trace
!clrstack –p
To poke inside an object..perhaps see what caused the exception
!do <address>
e.g This is the result from a application that faulted randomly with an IO exception. WinDbg pointed out the path that was being referenced which was incorrect.
0:009> !do 017f2b7c Name: System.String MethodTable: 790fd8c4 EEClass: 790fd824 Size: 124(0x7c) bytes (C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll) String: \\server\path\not_here.txt Fields: MT Field Offset Type VT Attr Value Name 79102290 4000096 4 System.Int32 1 instance 54 m_arrayLength 79102290 4000097 8 System.Int32 1 instance 53 m_stringLength 790ff328 4000098 c System.Char 1 instance 5c m_firstChar 790fd8c4 4000099 10 System.String 0 shared static Empty >> Domain:Value 00161df8:790d884c << 7912dd40 400009a 14 System.Char[] 0 shared static WhitespaceChars >> Domain:Value 00161df8:014113e8 <<
这篇关于如何解决.NET 2.0错误报告在事件消息日志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!