我们的应用程序遇到奇怪的致命System.AccessViolationException。我们看到了这些,因为我们配置了AppDomain.CurrentDomain.UnhandledException事件来记录异常。找到System.AccessViolationException的原因
Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr 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 Bootstrap.Run() in e:\build-dir\src\Bootstrap.cs:line 25
例外本身似乎并没有包含任何不是消息更多信息“尝试读取或写入受保护的内存。这通常是指示其他内存已损坏。”
- 我们现在可以采取哪些措施来解决问题的原因?
- 有没有什么办法可以确定导致崩溃的非法地址或指针值?
- 我们可以找出本机库代码导致问题的原因吗?
- 是否有更多的调试/跟踪,我们可以启用?
UPDATE
- 难道这由早期非线程使用的WinForms的API造成的?
您是否尝试过上附加一个调试运行此,也有足够的符号加载给一个有用的callstack? – 2012-04-20 01:52:51