LINQ查询原因System.AccessViolationException [英] linq query cause System.AccessViolationException

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

问题描述

我有一个奇怪的异常,它执行一个简单的linq查询,该查询以VB.NET表示(对不起.).例外是,如标题所示:"System.AccessViolationException",完整的异常消息链是

I have a strange exception executing a simple linq query, the query is expressed in VB.NET (sorry..). The exception is, as the title says: "System.AccessViolationException", the full exception message chain is

"System.Web.HttpUnhandledException:类型的异常 引发了"System.Web.HttpUnhandledException". ---> System.AccessViolationException:尝试读取或写入受保护 记忆.这通常表明其他内存已损坏. "

"System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. "

奇怪的行为是:

  1. 该异常是随机抛出的
  2. 仅在生产服务器上而不是在同一测试服务器上抛出异常
  3. 使用LinqPad针对生产数据库执行的查询非常有效

这是完整的异常堆栈跟踪:

This is the full exception stack trace:

在堆栈跟踪中,擦除的方法调用使用Single()linq方法进行查询.

In the stack trace the erased methods calls makes a query using the Single() linq method.

我们认为该问题与通过Windows Update在生产服务器上安装的KB有关,但很明显,我们并不完全知道

We think the issue is related to a KB installed on the production server with windows update, but it's clear, we dont't know it exactly

任何想法可能是真正的问题吗? 预先感谢

Any idea what could be the real issue? Thanks in advance

推荐答案

所有症状都表明服务器上的存储卡损坏或其他硬件问题(过热/超频).也可能是由病毒引起的.当内存中的指针损坏并最终引用受保护的内存区域时,就会发生访问冲突.我建议您将映像完全转移到另一台物理计算机上,并在服务器上运行完整的MEMTEST86,并彻底清洁外壳,更换旧风扇,等等.如果不是通过这种方法隔离问题,则重新安装产品从头开始在新的驱动器上安装服务器.

All the symptoms points to a bad memory stick on the server, or other hardware issues (overheating/overclocking). It could also be caused by a virus. Access violations happen when a pointer in memory gets corrupted and ends up referencing a protected memory area. I would recommend you transfer the image to another physical machine altogether and run a full MEMTEST86 run on the server, and give the housing a thorough cleaning, replace old fans, etc... If the problem is not isolated this way then reinstall the production server from scratch on a fresh drive.

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

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