简体   繁体   English

IIS 中的 AccessViolationException (w3wp.exe)

[英]AccessViolationException in IIS (w3wp.exe)

We have an ASP.Net MVC application running on IIS 8.5 (Windows Server 2012 R2) Sometimes (about once a day) it crashes with AccessViolationException and without StackTrace.我们有一个在 IIS 8.5 (Windows Server 2012 R2) 上运行的 ASP.Net MVC 应用程序有时(大约每天一次)它会因 AccessViolationException 而没有 StackTrace 崩溃。

EventLog short info:事件日志简短信息:

<Event
xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
    <Provider Name="Windows Error Reporting" />
    <EventID Qualifiers="0">1001</EventID>
    <Level>4</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2017-03-23T07:34:19.000000000Z" />
    <EventRecordID>5204</EventRecordID>
    <Channel>Application</Channel>
    <Computer>WebKassaApp01</Computer>
    <Security />
</System>
<EventData>
    <Data />
    <Data>0</Data>
    <Data>CLR20r3</Data>
    <Data>Нет данных</Data>
    <Data>0</Data>
    <Data>w3wp.exe</Data>
    <Data>8.5.9600.16384</Data>
    <Data>5215df96</Data>
    <Data>System.Core</Data>
    <Data>4.0.30319.33440</Data>
    <Data>5200436c</Data>
    <Data>3a4</Data>
    <Data>54</Data>
    <Data>System.AccessViolationException</Data>
    <Data />
    <Data />
    <Data>C:\ProgramData\Microsoft\Windows\WER\ReportQueue\AppCrash_w3wp.exe_9ef793f5de646625877423c14a0d0c91ad3196_9e3fd63b_cb043ca8</Data>
    <Data />
    <Data>0</Data>
    <Data>1ec4b5d9-0f9b-11e7-80c7-000c29473f66</Data>
    <Data>4100</Data>
    <Data />
</EventData>

Yesterday I have installed Microsoft Debugging Tool(DebugDiag) and run an Analysis of memory dump file (memory.hdmp).昨天我安装了 Microsoft 调试工具 (DebugDiag) 并运行了内存转储文件 (memory.hdmp) 的分析。 It show me Stack Trace of thrown AccessViolationException:它向我展示了抛出的 AccessViolationException 的堆栈跟踪:

System.Linq.Enumerable+WhereSelectEnumerableIterator`2[[System.__Canon, mscorlib],[System.Decimal, mscorlib]].MoveNext() 
System.Linq.Enumerable.Sum(System.Collections.Generic.IEnumerable`1) 
System.Linq.Queryable.Sum[[System.__Canon, mscorlib]](System.Linq.IQueryable`1, System.Linq.Expressions.Expression`1>) 
WebCash.Web.WebCashService.ToModel(System.Linq.IQueryable`1) 
WebCash.Web.WebCashService.GetLastReport(Int64, Int64, WebCash.Constants.Enums.ReportTypeEnum, Boolean) 
WebCash.Web.WebCashService.CreateXReport(WebCash.ServiceContracts.Request.XReportRequest) 
WebCash.Common.ParallelHelper.RunInMutex[[System.__Canon, mscorlib]](System.String, System.Func`1) 
WebCash.Web.Controllers.Api.BaseApiController.ExecuteAuthorizedOperation[[System.__Canon, mscorlib]](System.__Canon, System.Func`2) 
DynamicClass.lambda_method(System.Runtime.CompilerServices.Closure, System.Object, System.Object[]) 
System.Web.Http.Controllers.ReflectedHttpActionDescriptor+ActionExecutor+<>c__DisplayClass10.b__9(System.Object, System.Object[]) 
System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(System.Web.Http.Controllers.HttpControllerContext, System.Collections.Generic.IDictionary`2, System.Threading.CancellationToken) 
System.Web.Http.Controllers.ApiControllerActionInvoker+d__0.MoveNext() 
System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.Web.Http.Controllers.ApiControllerActionInvoker+d__0, System.Web.Http]](d__0 ByRef) 
System.Web.Http.Controllers.ApiControllerActionInvoker.InvokeActionAsyncCore(System.Web.Http.Controllers.HttpActionContext, System.Threading.CancellationToken) 
System.Web.Http.Controllers.ActionFilterResult+d__2.MoveNext() 
System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.Web.Http.Controllers.ActionFilterResult+d__2, System.Web.Http]](d__2 ByRef) 
System.Web.Http.Controllers.ActionFilterResult.ExecuteAsync(System.Threading.CancellationToken) 
System.Web.Http.Dispatcher.HttpControllerDispatcher+d__1.MoveNext() 
System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.Web.Http.Dispatcher.HttpControllerDispatcher+d__1, System.Web.Http]](d__1 ByRef) 
System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsync(System.Net.Http.HttpRequestMessage, System.Threading.CancellationToken) 
System.Net.Http.HttpMessageInvoker.SendAsync(System.Net.Http.HttpRequestMessage, System.Threading.CancellationToken) 
System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(System.Net.Http.HttpRequestMessage, System.Threading.CancellationToken) 
System.Web.Http.HttpServer+d__0.MoveNext() 
System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.Web.Http.HttpServer+d__0, System.Web.Http]](d__0 ByRef) 
System.Web.Http.HttpServer.SendAsync(System.Net.Http.HttpRequestMessage, System.Threading.CancellationToken) 
System.Net.Http.HttpMessageInvoker.SendAsync(System.Net.Http.HttpRequestMessage, System.Threading.CancellationToken) 
System.Web.Http.WebHost.HttpControllerHandler+d__0.MoveNext() 
System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.Web.Http.WebHost.HttpControllerHandler+d__0, System.Web.Http.WebHost]](d__0 ByRef) 
System.Web.Http.WebHost.HttpControllerHandler.ProcessRequestAsyncCore(System.Web.HttpContextBase) 
System.Web.TaskAsyncHelper.BeginTask(System.Func`1, System.AsyncCallback, System.Object) 
System.Web.HttpApplication+CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
System.Web.HttpApplication.ExecuteStep(IExecutionStep, Boolean ByRef) 
System.Web.HttpApplication+PipelineStepManager.ResumeSteps(System.Exception) 
System.Web.HttpApplication.BeginProcessRequestNotification(System.Web.HttpContext, System.AsyncCallback) 
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(System.Web.Hosting.IIS7WorkerRequest, System.Web.HttpContext) 
System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr, IntPtr, IntPtr, Int32) 
System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr, IntPtr, IntPtr, Int32)

Here full memory analysis log file. 这里是完整的内存分析日志文件。 So, as i can understood, exception is thrown from .Net LINQ implementation.所以,正如我所理解的,异常是从 .Net LINQ 实现中抛出的。 Can anybody help to understand the cause of this error and how to avoid it?任何人都可以帮助了解此错误的原因以及如何避免它?

EDIT编辑

I have tried install OS updates, but exception still occurred.我尝试安装操作系统更新,但仍然发生异常。 So today I was rewrite this chunk of code.所以今天我正在重写这段代码。 But today the error appeared in another place:但是今天错误出现在另一个地方:

 System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Object[], System.Signature, Boolean) 
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object, System.Object[], System.Object[]) 
   System.Delegate.DynamicInvokeImpl(System.Object[]) 
   NHibernate.Linq.DefaultQueryProvider.ExecuteQuery(NHibernate.Linq.NhLinqExpression, NHibernate.IQuery, NHibernate.Linq.NhLinqExpression) 
   NHibernate.Linq.DefaultQueryProvider.Execute(System.Linq.Expressions.Expression) 
   NHibernate.Linq.DefaultQueryProvider.Execute[[System.Nullable`1[[System.Int64, mscorlib]], mscorlib]](System.Linq.Expressions.Expression) 
   System.Linq.Queryable.SingleOrDefault[[System.Nullable`1[[System.Int64, mscorlib]], mscorlib]](System.Linq.IQueryable`1>) 
   WebCash.DAL.Entities.EntitiesExtensions.HasActiveLicense(WebCash.DAL.Entities.Cashbox) 

通过将 .Net 框架版本更新到 4.6 解决了问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM