本文介绍了System.AccessViolationException 是否会因为 RAM 故障而发生?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,我已经开发了大约一年了.最近,它开始时不时地抛出 System.AccessViolationException,在我的开发机器上,主要是当我离开机器时......

I have a website that i've been working on for about a year now.Recently, it's started throwing System.AccessViolationException every now and then, in my dev machine, mostly, when I was away from the machine...

我已经数周没有对服务器代码进行任何更改,因为我一直在 100% 的 Javascript 部分工作,而且这个错误最近开始出现.

I haven't changed anything on the server code in weeks, since I've been working 100% on the Javascript part, and this error started appearing recently.

另外,我正在做的代码是 100% 托管的.我没有做任何互操作,调用奇怪的 DLL,什么都没有.它是纯 VB.Net,所以我不知道如何自己生成其中之一...

Also, the code I'm doing is 100% managed. I'm not doing any interop, calling strange DLLs, nothing. It's pure VB.Net, so I don't see how I could be generating one of these myself...

现在,我已经使用这台新机器几个月了,但它并没有 100% 正确工作.例如,每 2 或 3 天我就会出现一次蓝屏.我还没来得及正确诊断,但我怀疑我的 RAM 芯片可能有问题.

Now, I've been using this new machine for a couple of months, and it's not working 100% right. Every 2 or 3 days I'm getting a blue screen for example. I haven't had time to diagnose it properly, but I'm suspecting I may have a faulty RAM chip.

错误的 RAM 是否有可能导致 AccessViolationException?
或者我有什么应该研究的实际问题?(除了我的内存)

Is it possible that faulty RAM could lead to an AccessViolationException?
Or do I have an actual problem I should be looking into? (besides my RAM)

更新:

我真的无法找到错误发生的地方,真的.
我收到未处理的异常,你想调试吗?"对话框,当我附加调试器时,我有线程列表,其中包含所有 ASP.Net 线程,还有 3 个我自己创建.
对于这 3 个,我有一个 Call Stack ,它们都在 Sleep() 调用处停止(这是可以预期的).
对于所有其他线程,包括 VS 指出的问题之一,我没有调用堆栈.我也没有任何关于异常的详细信息.

I'm not really being able to find WHERE the error occurs, really.
I get the "unhandled exception, do you want to debug?" dialog, and when I attach the debugger, I have the Threads list, where I have all the ASP.Net threads, and 3 I create myself.
For these 3 I have a Call Stack , and they're all stopped at a Sleep() call (which is expectable).
For all the other threads, including the one that VS points to as the problem one, I have no Call Stack. I also have no details about the exception whatsoever.

所以我不知道它是否每次都发生在同一个地方.

So I don't know whether it happens every time in the same place or not.

至于 memtest,是的,我打算做类似的事情,我只是希望尽快有时间去做,但同时我想知道这是否可以解释这个问题.

As for memtest, yes, I'm going to do something like that, I'm just hoping to have SOME time to do it soon, but I wanted to know, in the meantime, whether this could explain this problem.

更新 2:

在事件日志中找到了这个...

Found this in the event log...

发生未处理的异常,进程终止.

An unhandled exception occurred and the process was terminated.

Application ID: DefaultDomain
Process ID: 6632
Exception: System.AccessViolationException

Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

StackTrace:    at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

对此有何想法?
谢谢
丹尼尔

Any ideas what to make of this?
Thanks
Daniel

推荐答案

RAM 故障是否可能导致 AccessViolationException?

是的,这是可能的.如果进程的底层内存无法预测,那么是的,它可能会导致许多不同类型的应用程序错误,包括 AccessViolationException.

Is it possible that faulty RAM could lead to an AccessViolationException?

Yes this is possible. If the underlying memory of a process is not behaving predictably then yes it could lead to many different types of application faults including an AccessViolationException.

我会说很可能是您调用的程序或库中的错误有问题.不过,第一步是找出发生 AccessViolationException 的原因或更重要的地方.尝试附加调试器,中断 AccessViolationExceptions 并查看实际发生的情况.

I would say it's much more likely that a fault in your program or library you call is at fault. The first step though is finding out why or more importantly where the AccessViolationException is occurring. Try attaching a debugger, break on AccessViolationExceptions and see what is actually happening.

此外,Ben S 的建议是一个很好的建议,可以快速排除 RAM 问题.

Also Ben S's suggestion is a good one to rule out the RAM case fast.

这篇关于System.AccessViolationException 是否会因为 RAM 故障而发生?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-29 02:04
查看更多