KestrelHttpServer icon indicating copy to clipboard operation
KestrelHttpServer copied to clipboard

Reliability: Linux-HelloWorldMVC crash in few minutes of test run

Open sivagms opened this issue 10 years ago • 14 comments

HelloWorldMVC App
Azure A2 VM 80% CPU Usage 300 concurrent connections

4 hours of into the reliability test run The app crashes.

Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at Microsoft.AspNetCore.Server.Kestrel.Http.SocketOutput.ProducingStart() at Microsoft.AspNetCore.Server.Kestrel.Http.Frame.CreateResponseHeader(Byte[] statusBytes, Boolean appCompleted) at Microsoft.AspNetCore.Server.Kestrel.Http.Frame.ProduceStartAndFireOnStarting() at Microsoft.AspNetCore.Server.Kestrel.Http.Frame.d__120.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.AspNetCore.Server.Kestrel.Http.Frame.WriteAsyncAwaited(ArraySegment1 data, CancellationToken cancellationToken) at Microsoft.AspNetCore.Server.Kestrel.Http.Frame.WriteAsync(ArraySegment1 data, CancellationToken cancellationToken) at Microsoft.AspNetCore.Server.Kestrel.Http.FrameResponseStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) at Microsoft.AspNetCore.WebUtilities.HttpResponseStreamWriter.d__26.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.AspNetCore.WebUtilities.HttpResponseStreamWriter.FlushInternalAsync(Boolean flushEncoder) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.d__17.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, String contentType, Nullable1 statusCode) at Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ViewResultExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewResult viewResult) at Microsoft.AspNetCore.Mvc.ViewResult.<ExecuteResultAsync>d__26.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context) at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.<InvokeResultAsync>d__45.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.InvokeResultAsync(IActionResult result) at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.<InvokeResultFilterAsync>d__44.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.InvokeResultFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.d__44.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.InvokeResultFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.<InvokeAllResultFiltersAsync>d__43.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.InvokeAllResultFiltersAsync(IActionResult result) at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.<InvokeResourceFilterAsync>d__38.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.InvokeResourceFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.d__38.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.InvokeResourceFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.<InvokeAsync>d__33.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.InvokeAsync() at Microsoft.AspNetCore.Mvc.Internal.MvcRouteHandler.<InvokeActionAsync>d__8.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.AspNetCore.Mvc.Internal.MvcRouteHandler.InvokeActionAsync(HttpContext httpContext, ActionDescriptor actionDescriptor) at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.<Invoke>d__3.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Hosting.Internal.HostingApplication.ProcessRequestAsync(Context context) at Microsoft.AspNetCore.Server.Kestrel.Http.Frame1.d__2.MoveNext() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() at Microsoft.AspNetCore.Server.Kestrel.Infrastructure.LoggingThreadPool.<.ctor>b__4_0(Object o) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.QueueUserWorkItemCallbackDefaultContext.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() Aborted (core dumped)

sivagms avatar Apr 01 '16 22:04 sivagms

Is it 4 hours or a few minutes?

cesarblum avatar Apr 01 '16 22:04 cesarblum

it used to crash after 4 hours, but now with workstation GC it crashed within few mins

sivagms avatar Apr 02 '16 00:04 sivagms

@cesarbs let's investigate. We may need to move to 1.0.0, but it would be good to have a look at it now.

@sivagms Do you get the same crash with workstation GC and server GC (but with one happening much quicker?)

muratg avatar Apr 05 '16 15:04 muratg

I didn't see the crash with Server GC

sivagms avatar Apr 05 '16 16:04 sivagms

OK, cool. I was under the impression that it crashed also on Server GC but it took a longer time.

Punting further investigation to 1.0.0.

muratg avatar Apr 05 '16 16:04 muratg

@sivagms How long did you run with the server GC?

cesarblum avatar Apr 06 '16 04:04 cesarblum

24 hours and no crash.

sivagms avatar Apr 06 '16 05:04 sivagms

This seems to be the root cause of the issue: https://github.com/dotnet/coreclr/issues/4115

halter73 avatar Apr 06 '16 19:04 halter73

https://github.com/dotnet/coreclr/issues/4115 has been fixed. @sivagms can you verify that the crash is not taking place anymore?

cesarblum avatar Apr 11 '16 20:04 cesarblum

did we take this build with the fix yet. I think korebuild still uses older build 002279 which doesn't have the fix

sivagms avatar Apr 12 '16 00:04 sivagms

Ah yes, gotta wait for a new build.

cesarblum avatar Apr 12 '16 18:04 cesarblum

@sivagms Have you verified this against the latest CoreCLR builds we took?

cesarblum avatar Apr 19 '16 23:04 cesarblum

yes and this crash doesn't show up. @cesarbs

sivagms avatar Apr 20 '16 01:04 sivagms

Ok. I'll close the bug then.

cesarblum avatar Apr 20 '16 17:04 cesarblum