AccessViolationException, IIS

1

we are 4 developers (not professional server administrators) and running 2 servers with IIS 8.5 (Windows server 2012 R2) and ASP.NET 4.

Multiple times per day we get this exception in the windows event log:

Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
   at System.Web.Hosting.UnsafeIISMethods.MgdIsLastNotification(IntPtr, System.Web.RequestNotificationStatus)
   at System.Web.Hosting.UnsafeIISMethods.MgdIsLastNotification(IntPtr, System.Web.RequestNotificationStatus)
   at System.Web.HttpRuntime.FinishRequestNotification(System.Web.Hosting.IIS7WorkerRequest, System.Web.HttpContext, System.Web.RequestNotificationStatus ByRef)
   at System.Web.HttpRuntime.OnRequestNotificationCompletionHelper(System.IAsyncResult)
   at System.Web.HttpRuntime.OnRequestNotificationCompletion(System.IAsyncResult)
   at System.Web.HttpApplication+PipelineStepManager.ResumeSteps(System.Exception)
   at System.Web.HttpApplication+CallHandlerExecutionStep.OnAsyncHandlerCompletion(System.IAsyncResult)
   at System.Threading.Tasks.Task.Execute()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.ExecuteEntry(Boolean)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

The next entry in the event log is this:

Faulting application name: w3wp.exe, version: 8.5.9600.16384, time stamp: 0x5215df96
Faulting module name: iiscore.dll, version: 8.5.9600.17224, time stamp: 0x53b1e5a1
Exception code: 0xc0000005
Fault offset: 0x0000000000002c44
Faulting process id: 0x257c
Faulting application start time: 0x01d05f0c93813e6e
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\Windows\system32\inetsrv\iiscore.dll
Report Id: 073f9a19-cb13-11e4-80c3-0cc47a02ce53
Faulting package full name: 
Faulting package-relative application ID: 

The always occur as a pair. I spent hours with google but have no idea if this is a problem in our code or in an external module and how to solve is. The main problem is that one of our servers stops responding from time to time, so I am really interested if this problems belong together.

We log all exceptions, but I cannot find it in our log. I also tried to attach the remote debugger, but I dont get the exception and the debugging really slows down the website.


Edit: I checked all sources to catch exceptions in m application:

  • AppDomain.CurrentDomain.UnhandledException
  • TaskScheduler.UnobservedTaskException
  • Custom Owin Middleware

But I could not find this exception. The next thing I am gonna try is a custom http module. Lets see.

I also found some not warnings in the event log like:

Exception type: HttpException 
Exception message: The remote host closed the connection. The error code is 0x80070057.

or

Exception type: HttpException 
Exception message: A potentially dangerous Request.Path value was detected from the client (:).

These can happen very often, I am confused why they are added to the event log.

windows-server-2008-r2
iis-8.5
asked on Server Fault Mar 15, 2015 by SebastianStehle • edited Mar 18, 2015 by SebastianStehle

2 Answers

0

It may be an ASPNET access problem.

Right-click "Computer" --> "Manage"--> "Local Users and Groups" --> "Groups"

Find the "DB2ADMNS" and "DB2USERS" groups.

Add the "ASPNET" user to each of those groups.

answered on Server Fault Mar 17, 2015 by Overmind
0

I wouldn't be concerned about

Exception type: HttpException Exception message: The remote host closed the connection. The error code is 0x80070057.

That just means that the remote side went away (crashed? lost connectivity? who knows) while it was receiving data.

I also wouldn't worry about

Exception type: HttpException Exception message: A potentially dangerous Request.Path value was detected from the client (:).

That just means your URL includes a colon, which isn't allowed.

So that leaves the top two error messages. The problem is somewhere in your custom app.

Exception code: 0xc0000005

is an access violation. Either your application's account doesn't have access to everything it needs (application pool? files?) or it attempted to access protected memory. (Someone on this question suggested the problem might also be faulty memory.) Debug Diag (and/or a memory testing utility) can probably help you track down what's causing the issue.

Good luck!

answered on Server Fault Mar 24, 2015 by Katherine Villyard • edited Apr 13, 2017 by Community

User contributions licensed under CC BY-SA 3.0