发现System.AccessViolationException事业 [英] finding the cause of System.AccessViolationException

查看:265
本文介绍了发现System.AccessViolationException事业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的应用程序遇到了奇怪的致命System.AccessViolationException。我们看到这些,因为我们已经配置了AppDomain.CurrentDomain.UnhandledException事件记录异常。

Our application experiences the odd fatal System.AccessViolationException. We see these as we've configured the AppDomain.CurrentDomain.UnhandledException event to log the exception.

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

例外本身似乎并没有包含任何不是消息的详细信息尝试读取或写入受保护的内存。这通常指示其他内存已损坏。

  • 现在我们能采取什么措施来找到问题的原因是什么?
  • 有什么方法来确定导致崩溃的非法地址或指针值?
  • 我们可以找出本机库code是造成问题?
  • 是否有更多的调试/跟踪,我们可以启用?

更新

  • 难道这是由早期的非线程安全使用的WinForms的API?
  • 引起的

推荐答案

堆栈跟踪指向本地派遣使者的MSG参数错误的数据。你有没有尝试加载微软的符号和检查堆栈跟踪的参数。

The stack trace points to bad data in the MSG parameter of the native dispatch messenger. Have you tried loading the symbols from Microsoft and checking the parameters of that stack trace.

不知道你的用户界面,并已连接到任何事件的控制,这将是很难确定究竟是什么问题。

Without knowing the controls on your ui and whatever events you have connected to, it will be difficult to determine what exactly is the problem.

这篇关于发现System.AccessViolationException事业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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