试图读取或写入受保护的内存。这通常表明其他内存已损坏 [英] Attempted to read or write protected memory. This is often an indication that other memory is corrupt

查看:862
本文介绍了试图读取或写入受保护的内存。这通常表明其他内存已损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望有人能赐教,以什么可能会导致此错误:

I'm hoping someone can enlighten me as to what could possibly be causing this error:

试图读取或写入受保护的内存。这通常表明其他内存已损坏。

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

我真的不能张贴code,因为这个错误似乎在任何随机领域中的应用的抛出。该应用程序将从12-48小时引发错误前,在任何地方运行。有时它会停在一个看似偶然的当场抛出上述错误,其他时候整个应用程序停止,我也得到一个屏幕,一个错误,指出沿的存在是...这可能是一个致命的错误的东西线臭虫在CLR或者......一些有关的PI​​nvoke或其它不相关的信息。当这种情况发生的所有主题显示终止,并且没有可用的调试信息。

I cannot really post code because this error seems to get thrown in any random area of the application. The application will run anywhere from 12-48 hours before throwing the error. Sometimes it will stop in a seemingly random spot and throw the above error, other times the entire application stops and I get a screen with an error that says something along the lines of "There was a fatal error in... This may be a bug in the CLR or..." something about PInvoke or other non relevant info. When this happens all threads show terminated and there is no debugging information available.

在简单地说,这是应用程序做什么:

In a nutshell this is what the application does:

它写在完全用C#多线程服务器应用程序。客户端通过插座连接到服务器。服务器运行一个虚拟的环境在这里他们可以彼此和环境交互的客户端。它消耗相当多的内存,但我没有看到它泄漏。它通常消耗约1.5GB。我不认为它泄漏,因为内存使用量保持相对稳定的应用程序运行的整个时间。它的不断磨合code来维持,即使客户没有做任何事情的环境。它不使用任何第三方软件或其他API。唯一的外部资源这个应用程序采用的是socket连接和SQL数据库连接。其运行的64位服务器上。我试图在VS2008和放大器的调试这一点; VS2010使用.NET 2.0,3.5和4.0,并在多个服务器上,但问题仍然出现,最终。

Its a multi-threaded server application written in entirely in C#. Clients connect to the server via socket. The server runs a virtual "environment" for the clients where they can interact with each other and the environment. It consumes quite a bit of memory but I do not see it leaking. It typically consumes about 1.5GB. I dont think its leaking because the memory usage stays relatively constant the entire time the application is running. Its constantly running code to maintain the environment even if the clients are not doing anything. It uses no 3rd party software or other APIs. The only outside resources this application uses is socket connections and SQL database connections. Its running on a 64bit server. I have tried debugging this in VS2008 & VS2010 using .net 2.0, 3.5, and 4.0 and on multiple servers and the problem still eventually occurs.

我试着关掉编译器优化和几个微软的补丁程序。一切似乎使这个问题消失。这将是AP preciated如果有谁知道任何可能的原因,或者某种方法来确定什么导致了问题。

I've tried turning off compiler optimizations and several microsoft hot-fixes. Nothing seems to make this issue go away. It would be appreciated if anyone knows any possible causes, or some kind of way to identify whats causing the problem.

推荐答案

终于跟踪下来使用WinDbg和SOS的帮助。访问冲突正在抛出一些未知的DLL。原来一个软件叫Nvidia的网络管理器所造成的问题。我读了无数遍如何这个问题可以通过防火墙或杀毒软件,无论是由本人使用,所以我驳回了这一想法引起的。另外,我的假设下,这是不环保,因为它使用不同的硬件发生在1个多服务器。原来我所测试的这对正在运行的NVIDIA网络管理器的机器。我相信,它与主板驱动程序的其他部分安装。

Finally tracked this down with the help of WinDBG and SOS. Access violation was being thrown by some unknown DLL. Turns out a piece of software called "Nvidia Network Manager" was causing the problems. I'd read countless times how this issue can be caused by firewalls or antivirus, neither of which I am using so I dismissed this idea. Also, I was under the assumption that it was not environmental because it occurs on more than 1 server using different hardware. Turns out all the machines I tested this on were running "NVidia Network Manager". I believe it installs with the rest of the motherboard drivers.

希望这可以帮助别人,因为这问题已困扰了很长一段时间我的应用程序。

Hopefully this helps someone as this issue was plaguing my application for a very long time.

这篇关于试图读取或写入受保护的内存。这通常表明其他内存已损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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