-
Notifications
You must be signed in to change notification settings - Fork 527
System.ArgumentOutOfRangeException: Non-negative number required #579
Comments
Can you provide a repro? |
More detailed stack trace with line numbers:
|
And stack trace for same scenario when running a Debug configuration (
|
@halter73 We should revert the commit if it turns out this is actually a regression caused by it (Which it seems to be). |
On "detailed stack trace with numbers" does the Universe build add any code? As |
D'oh - thank you, was looking at the PR |
Writing some extra tests in this area (large multi-block, multi-write, chunked+unchunked) |
Awesome, thanks! |
Thanks @benaadams. Extra tests around this would be be great. I reverted the change since it was blocking @dougbu. |
@benaadams I found the proximate cause of the Basically we didn't set the KestrelHttpServer/src/Microsoft.AspNet.Server.Kestrel/Infrastructure/MemoryPoolBlock2.cs Line 95 in ce61282
We should also look into why blocks aren't properly being returned in the first place. |
O_o - K, I'd have never have gone there. Might have idea - will IM you. |
The commit that introduced this bug has been reverted. #585 does address this issue if we decide to reintroduce it, but that will probably be post 1.0. The fix isn't the easiest thing to unit test since it involves a finalizer. We could probably call |
Writing a test that would require a finalizer to pass would eventually lead to random CI failures, so better leave it as it is. |
With the latest CI DEV package, we are getting the following when calling the a simple Web API controller.
An unhandled exception was thrown by the application.
System.ArgumentOutOfRangeException: Non-negative number required.
Parameter name: count
at System.Buffer.BlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count)
at Microsoft.AspNet.Server.Kestrel.Infrastructure.MemoryPoolIterator2.CopyFrom(Byte[] data, Int32 offset, Int32 count)
at Microsoft.AspNet.Server.Kestrel.Infrastructure.MemoryPoolIterator2.CopyFrom(ArraySegment
1 buffer) at Microsoft.AspNet.Server.Kestrel.Http.SocketOutput.WriteAsync(ArraySegment
1 buffer, Boolean immediate, Boolean chunk, Boolean socketShutdownSend, Boolean socketDisconnect)at Microsoft.AspNet.Server.Kestrel.Http.SocketOutput.Microsoft.AspNet.Server.Kestrel.Http.ISocketOutput.Write(ArraySegment
1 buffer, Boolean immediate, Boolean chunk) at Microsoft.AspNet.Server.Kestrel.Http.Frame.WriteChunked(ArraySegment
1 data)at Microsoft.AspNet.Server.Kestrel.Http.Frame.Write(ArraySegment
1 data) at Microsoft.AspNet.Server.Kestrel.Http.FrameResponseStream.Write(Byte[] buffer, Int32 offset, Int32 count) at Microsoft.AspNet.Mvc.HttpResponseStreamWriter.FlushInternal(Boolean flushEncoder) at Microsoft.AspNet.Mvc.HttpResponseStreamWriter.Dispose(Boolean disposing) at System.IO.TextWriter.Dispose() at Microsoft.AspNet.Mvc.Infrastructure.JsonResultExecutor.ExecuteAsync(ActionContext context, JsonResult result) at Microsoft.AspNet.Mvc.Controllers.FilterActionInvoker.<InvokeResultAsync>d__44.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNet.Mvc.Controllers.FilterActionInvoker.<InvokeResultFilterAsync>d__43.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNet.Mvc.Controllers.FilterActionInvoker.<InvokeAllResultFiltersAsync>d__42.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNet.Mvc.Controllers.FilterActionInvoker.<InvokeResourceFilterAsync>d__37.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNet.Mvc.Controllers.FilterActionInvoker.<InvokeAsync>d__32.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNet.Mvc.Infrastructure.MvcRouteHandler.<InvokeActionAsync>d__8.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNet.Builder.RouterMiddleware.<Invoke>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNet.Cors.Infrastructure.CorsMiddleware.<Invoke>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNet.IISPlatformHandler.IISPlatformHandlerMiddleware.<Invoke>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNet.Hosting.Internal.RequestServicesContainerMiddleware.<Invoke>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNet.Server.Kestrel.Http.Frame
1.d__3.MoveNext()The text was updated successfully, but these errors were encountered: