W3wp accidentally crashes with AccessViolationException and TargetInvocationException serving a WCF call

We observe random (once every 1-5 days) IIS exceptions in EventLog.
Server - Windows Server 2012 R2.

  • The first of these is a violation of access rights (more often):

Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was aborted due to an unhandled exception.
Exception Information: System.AccessViolationException
Stack:

There is no additional data for this.

  • The other is the target call (less commonly):

Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was aborted due to an unhandled exception.
Exception Information: System.Reflection.TargetInvocationException
Stack:
in System.RuntimeMethodHandle.InvokeMethod (System.Object, System.Object [], System.Signature, Boolean)
in System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal (System.Object, System.Object [], System.Object [])
in System.Delegate.DynamicInvokeImpl (System.Object [])
... (hereinafter stack trace) ...

We did some debugging with several variants of this TargetInvocationException and forcibly throwing an exception in a specific place, we could repeat one of the stack traces, but it had an internal exception (this is not the case here) + that didn’t fail IIS and usually returned error for a client wrapped in a FaultException.

Do you think this could be due to changes in .NET 4.0 with a corrupted process state? https://msdn.microsoft.com/en-us/library/system.runtime.exceptionservices.handleprocesscorruptedstateexceptionsattribute(v=vs.110).aspx

+5
source share

Source: https://habr.com/ru/post/1211712/


All Articles