System.AccessViolationException was unhandled
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source=System.Windows.Forms
StackTrace:
at System.Windows.Forms.UnsafeNativeMethods.PeekMessage(MSG& msg, HandleRef hwnd, Int32 msgMin, Int32 msgMax, Int32 remove)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at ABC.Program.Main() in C:\Documents and Settings\...\Program.cs:line 17
InnerException: 这很难重现异常,是非常不可预测的。我附加了我的visual调试器,并运行了7-10次测试,并且成功地捕获了这个堆栈跟踪。请注意,所有这些代码都不是我的代码,所以在windows级别上发生了一些可怕的事情。顺便说一句,我们使用PInvoke打开/关闭诸如iexplore、记事本等窗口。
经过一些-- 搜索 --并根据来自微软的那个家伙的建议,我尝试让ADPlus去分析内存转储& Windbg,但是我从windbg获得的信息比异常本身更加神秘。
This dump file has an exception of interest stored in it.
The stored exception information can be accessed via .ecxr.
(904.1cf4): Access violation - code c0000005 (first/second chance not available)
eax=003c4d10 ebx=00000000 ecx=00000000 edx=00000000 esi=003c4d2a edi=0012f1a0
eip=003c4b64 esp=0012f11c ebp=0012f138 iopl=0 nv up ei pl zr na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010246
003c4b64 8b410c mov eax,dword ptr [ecx+0Ch] ds:0023:0000000c=????????
0:000> .ecxr
eax=003c4d10 ebx=00000000 ecx=00000000 edx=00000000 esi=003c4d2a edi=0012f1a0
eip=003c4b64 esp=0012f11c ebp=0012f138 iopl=0 nv up ei pl zr na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010246
003c4b64 8b410c mov eax,dword ptr [ecx+0Ch] ds:0023:0000000c=????????可以有一些专家能够理解这些信息,我不能。
,那么,你们是怎么分析这些问题的呢?类似于.Net ?的“JVM堆转储分析器”之类的东西。
环境: Windows XP SP3完全访问,管理
发布于 2011-02-15 17:35:50
在Visual中,转到项目属性并启用“非托管代码脱钩”,然后启动调试器。
不确定是否需要以下步骤,但我只是在visual studio的即时窗口中执行了.load SOS.dll
I能够找到问题的根本原因--:对垃圾收集委托进行回调(类型为‘ABC.Form 1+SendMessageDelegate::Invoke’)。这可能会导致应用程序崩溃、损坏和数据丢失。当将委托传递给非托管代码时,托管应用程序必须使它们保持活动状态,直到保证它们永远不会被调用为止。
谢谢每一个发了回复或评论的人。
https://stackoverflow.com/questions/5006520
复制相似问题