由于 RAM 故障,是否会发生 System.AccessViolationException?

发布于 2024-08-04 23:08:55 字数 1587 浏览 4 评论 0原文

我有一个网站,我已经工作了大约一年了。 最近,它开始时不时地在我的开发机器上抛出 System.AccessViolationException,大多数情况下,当我离开机器时......

我已经几周没有更改服务器代码上的任何内容,因为我已经工作了 100 % 在 Javascript 部分,这个错误最近开始出现。

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

现在,我已经使用这台新机器几个月了,它并没有 100% 正常工作。例如,每隔 2 或 3 天我就会出现蓝屏。我还没有时间正确诊断它,但我怀疑我的 RAM 芯片可能有故障。

RAM 故障是否可能导致 AccessViolationException?
或者我有一个应该调查的实际问题吗? (除了我的 RAM)


更新:

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

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

至于memtest,是的,我要做类似的事情,我只是希望尽快有一些时间来做这件事,但同时我想知道这是否可以解释这个问题。


更新2:

在事件日志中发现此...

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

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)

有什么想法吗?
谢谢
丹尼尔

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...

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.

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...

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.

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)


UPDATE:

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.

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.


UPDATE 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

爱已欠费 2024-08-11 23:08:55

有故障的 RAM 是否有可能导致 AccessViolationException?

是的,这是可能的。如果进程的底层内存行为不符合预期,那么它可能会导致许多不同类型的应用程序错误,包括 AccessViolationException。

有故障的 RAM 是否可能导致 AccessViolationException?

我想说,更有可能的是您调用的程序或库中存在错误。不过,第一步是找出发生 AccessViolationException 的原因,或更重要的是找出发生的位置。尝试附加一个调试器,在 AccessViolationExceptions 上中断并查看实际发生的情况。

Ben S 的建议也是快速排除 RAM 情况的一个好建议。

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.

Is in likely that faulty RAM is leading to an AccessViolationException?

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.

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

滿滿的愛 2024-08-11 23:08:55

如果您对 RAM 故障有疑问,只需运行 memtest86

但如果错误总是发生在同一个调用中,则可能不是 RAM。

If you ever have doubts about faulty RAM, just run memtest86.

But if the error always happens in the same call, it's probably not RAM.

软糯酥胸 2024-08-11 23:08:55

这仅发生在您的开发机器上吗?如果是,那么 RAM/硬盘(页面文件)很可能出现故障。您可能还需要重新安装 .NET Framework,以防其中一个库(可能是本机映像 DLL 之一)已损坏。

简而言之:

如果错误每次都发生在代码的不同部分,则很好地表明整个系统存在问题。

另一方面,如果错误在同一段代码中重复出现,那么几乎可以肯定是那段代码有问题。

正如之前的答案所述,使用 Memtest86+ 来确认您的记忆力是否良好。

Does this only happen on your dev machine? If yes then faulty RAM/hard disk (page file) is very possible. You may also want to reinstall the .NET Framework in case one of the libraries (perhaps one of the Native Image DLLs) has become corrupted.

Simply put:

If the error occurs in different sections of code each time, that's a good indicator that something's wrong with your system as a whole.

On the other hand, if the error repeatedly occurs in the same piece of code, then it's almost certainly that piece of code that's at fault.

As a previous answer noted, use Memtest86+ to confirm that your memory is good or not.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文