LinQ Attempted to read or write protected memory. This is often an indication that other memory is corrupt
开发者_开发知识库I am getting the memory access violation error:
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Thread information:
Thread ID: 5
Thread account name: IIS APPPOOL\OpenSpanServerAppPool
Is impersonating: False
Stack trace: at System.Linq.Enumerable.WhereEnumerableIterator1.Select[TResult](Func
2 selector)
at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable1 source, Func
2 selector)
at System.Web.Mvc.MvcHandler.RemoveOptionalRoutingParameters()
at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory)
at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state)
at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
I am using asp.net MVC, NHibernate and my site is hosted in IIS with its own pool , DB is SQL Server 2005 sp3.
Did you see something related to this issue?
I think it is related maybe to MS SQL idle disconnection...
Any idea?
I would appreciate your help.
We've hit the same issue from time-to-time. I think Sam hit the answer, our problem appears to be because we late evaluating our database read and the connection had timed out. The problem appears to have been resolved by putting a ToList call in our data layer to make sure the conversion happens earlier.
I hit this same error in a Linq expression. I was able to resolve it by checking the State of the DB Connection. If the State is closed, the error comes up. So open up the connection if it's closed.
精彩评论