From the code at the bottom of the post, I get the following backtrace under a stress test:
1: Error Description: Object reference not set to an instance of an object. 1: Source: System.Web 1: Stack Trace: at System.Web.HttpApplication.get_CurrentModuleContainer() 1: at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error) 1: at System.Web.HttpApplication.ResumeStepsFromThreadPoolThread(Exception error) 1: at System.Web.HttpApplication.CallHandlerExecutionStep.ResumeStepsWithAssert(Exception error) 1: at System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) 1: at MyAsyncResult.Complete(Boolean completedSynchronously, Exception e) in f:\cvs\fproot\test\File.ashx:line 54 1: at AsyncCopy.Finish(Exception e) in f:\cvs\fproot\test\File.ashx:line 87 1: at AsyncCopy.ReadCompleted(IAsyncResult result) in f:\cvs\fproot\test\File.ashx:line 115 1: at System.Runtime.Remoting.Messaging.AsyncResult.SyncProcessMessage(IMessage msg) 1: at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink) 1: at System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(Object o) 1: at System.Threading.ExecutionContext.runTryCode(Object userData) 1: at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) 1: at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 1: at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack) 1: at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state) 1: Target Site: System.Web.PipelineModuleStepContainer get_CurrentModuleContainer()
I can grab it in the debugger at this point, but I can't really see what's going on. This only seems to occur if HttpResponse.BufferOutput = false.
The boiled down test code is below. I can't find a bug in it (that's not to say there isn't one!) -- so this looks like an IIS issue to me. Can anyone point out my mistake/confirm that this is a bug? I have reproduced this in IIS7 on Windows Server 2008
and IIS7.5 on Windows 7. The actual code that was boiled down ran for about 2 years on IIS6 on Windows Server 2003 without an issue.
For /test/test.txt I used http://www.gutenberg.org/dirs/etext94/shaks12.txt, but I think anything will do. For load, I used the venerable old Web Application Stress Tool with 512 concurrent connections.
Thanks,
Mark
<%@ WebHandler Language="C#" Class="File" %> using System; using System.IO; using System.Web; class MyAsyncResult : IAsyncResult { #region IAsyncResult Members public object AsyncState { get { return m_asyncState; } } public System.Threading.WaitHandle AsyncWaitHandle { get { throw new NotImplementedException(); } } public bool CompletedSynchronously { get { return m_completedSynchronously; } } public bool IsCompleted { get { return m_completed; } }
Would it be possible for you to check if the problem goes away on the new .NET v4.0? We recently found and fixed (in v4.0) a bug in ASP.NET integrated pipeline that leads to an AV at the same place.
If trying the new v4.0 is out of question we might be able to suggest other workarounds.
Thanks,
Konst
ASP.NET
"This posting is provided "AS IS" with no warranties, and confers no rights."
I am using .net 4.0 and can reproduce what may be this same error. Others have written about it here: http://stackoverflow.com/questions/3712598/httpmodule-init-safely-add-httpapplication-beginrequest-handler-in-iis7-integra I would love any assistance possible.
In my case it's happening a few times a day and crashing my app, all after I moved some code from application_beginrequest in global.asax to listen to onbeginrequest in a module. Same code, only now it occasionally throws this error. Thanks, Tom
There's a similar thread here: http://forums.asp.net/t/1327102.aspx Looks like the poster just gave up and started using Global.asax instead of attaching events. Seems like there is a real issue here. The stack traces have only Microsoft code in them, so it's
tough to decipher what is going wrong.
mdw211
1 Post
IHttpAsyncHandler -- bug in IIS?
Feb 13, 2010 02:21 AM|LINK
From the code at the bottom of the post, I get the following backtrace under a stress test:
I can grab it in the debugger at this point, but I can't really see what's going on. This only seems to occur if HttpResponse.BufferOutput = false.
The boiled down test code is below. I can't find a bug in it (that's not to say there isn't one!) -- so this looks like an IIS issue to me. Can anyone point out my mistake/confirm that this is a bug? I have reproduced this in IIS7 on Windows Server 2008 and IIS7.5 on Windows 7. The actual code that was boiled down ran for about 2 years on IIS6 on Windows Server 2003 without an issue.
For /test/test.txt I used http://www.gutenberg.org/dirs/etext94/shaks12.txt, but I think anything will do. For load, I used the venerable old Web Application Stress Tool with 512 concurrent connections.
Thanks,
Mark
asp.net async
KKonst
1 Post
Re: IHttpAsyncHandler -- bug in IIS?
Apr 17, 2010 02:33 AM|LINK
Hi Mark,
Would it be possible for you to check if the problem goes away on the new .NET v4.0? We recently found and fixed (in v4.0) a bug in ASP.NET integrated pipeline that leads to an AV at the same place.
If trying the new v4.0 is out of question we might be able to suggest other workarounds.
Thanks,
Konst
ASP.NET
twrx
6 Posts
Re: IHttpAsyncHandler -- bug in IIS?
Feb 23, 2011 07:50 AM|LINK
twrx
6 Posts
Re: IHttpAsyncHandler -- bug in IIS?
Feb 23, 2011 06:13 PM|LINK