{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/621","repository_url":"https://api.github.com/repos/aspnet/KestrelHttpServer","labels_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/621/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/621/comments","events_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/621/events","html_url":"https://github.com/aspnet/KestrelHttpServer/issues/621","id":132784536,"number":621,"title":"AV in Kestrel during long haul with Ngnix.","user":{"login":"SajayAntony","id":1821104,"avatar_url":"https://avatars.githubusercontent.com/u/1821104?v=3","gravatar_id":"","url":"https://api.github.com/users/SajayAntony","html_url":"https://github.com/SajayAntony","followers_url":"https://api.github.com/users/SajayAntony/followers","following_url":"https://api.github.com/users/SajayAntony/following{/other_user}","gists_url":"https://api.github.com/users/SajayAntony/gists{/gist_id}","starred_url":"https://api.github.com/users/SajayAntony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SajayAntony/subscriptions","organizations_url":"https://api.github.com/users/SajayAntony/orgs","repos_url":"https://api.github.com/users/SajayAntony/repos","events_url":"https://api.github.com/users/SajayAntony/events{/privacy}","received_events_url":"https://api.github.com/users/SajayAntony/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aspnet/KestrelHttpServer/labels/stress","name":"stress","color":"fad8c7"}],"state":"open","locked":false,"assignee":{"login":"yuwaMSFT","id":16964440,"avatar_url":"https://avatars.githubusercontent.com/u/16964440?v=3","gravatar_id":"","url":"https://api.github.com/users/yuwaMSFT","html_url":"https://github.com/yuwaMSFT","followers_url":"https://api.github.com/users/yuwaMSFT/followers","following_url":"https://api.github.com/users/yuwaMSFT/following{/other_user}","gists_url":"https://api.github.com/users/yuwaMSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/yuwaMSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuwaMSFT/subscriptions","organizations_url":"https://api.github.com/users/yuwaMSFT/orgs","repos_url":"https://api.github.com/users/yuwaMSFT/repos","events_url":"https://api.github.com/users/yuwaMSFT/events{/privacy}","received_events_url":"https://api.github.com/users/yuwaMSFT/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2016-02-10T18:44:14Z","updated_at":"2016-02-17T18:28:00Z","closed_at":null,"body":"```\r\nUnhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.\r\n   at Microsoft.AspNetCore.Server.Kestrel.Http.SocketOutput.ProducingStart()\r\n   at Microsoft.AspNetCore.Server.Kestrel.Http.Frame.CreateResponseHeader(Byte[] statusBytes, Boolean appCompleted)\r\n   at Microsoft.AspNetCore.Server.Kestrel.Http.Frame.ProduceStartAndFireOnStarting()\r\n   at Microsoft.AspNetCore.Server.Kestrel.Http.Frame.<WriteAsyncAwaited>d__121.MoveNext()\r\n   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Microsoft.AspNetCore.Server.Kestrel.Http.Frame.WriteAsyncAwaited(ArraySegment`1 data, CancellationToken cancellationToken)\r\n   at Microsoft.AspNetCore.Server.Kestrel.Http.Frame.WriteAsync(ArraySegment`1 data, CancellationToken cancellationToken)\r\n   at Microsoft.AspNetCore.Server.Kestrel.Http.FrameResponseStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)\r\n   at Microsoft.AspNetCore.WebUtilities.HttpResponseStreamWriter.<FlushInternalAsync>d__26.MoveNext()\r\n   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Microsoft.AspNetCore.WebUtilities.HttpResponseStreamWriter.FlushInternalAsync(Boolean flushEncoder)\r\n   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.<ExecuteAsync>d__17.MoveNext()\r\n   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, String contentType, Nullable`1 statusCode)\r\n   at Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ViewResultExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewResult viewResult)\r\n   at Microsoft.AspNetCore.Mvc.ViewResult.<ExecuteResultAsync>d__26.MoveNext()\r\n   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context)\r\n   at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.<InvokeResultAsync>d__44.MoveNext()\r\n   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.InvokeResultAsync(IActionResult result)\r\n   at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.<InvokeResultFilterAsync>d__43.MoveNext()\r\n   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.InvokeResultFilterAsync()\r\n   at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.<InvokeResultFilterAsync>d__43.MoveNext()\r\n   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.InvokeResultFilterAsync()\r\n   at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.<InvokeAllResultFiltersAsync>d__42.MoveNext()\r\n   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.InvokeAllResultFiltersAsync(IActionResult result)\r\n   at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.<InvokeResourceFilterAsync>d__37.MoveNext()\r\n   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.InvokeResourceFilterAsync()\r\n   at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.<InvokeResourceFilterAsync>d__37.MoveNext()\r\n   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.InvokeResourceFilterAsync()\r\n   at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.<InvokeAsync>d__32.MoveNext()\r\n   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Microsoft.AspNetCore.Mvc.Internal.FilterActionInvoker.InvokeAsync()\r\n   at Microsoft.AspNetCore.Mvc.Internal.MvcRouteHandler.<InvokeActionAsync>d__8.MoveNext()\r\n   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Microsoft.AspNetCore.Mvc.Internal.MvcRouteHandler.InvokeActionAsync(HttpContext httpContext, ActionDescriptor actionDescriptor)\r\n   at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()\r\n   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)\r\n   at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.<Invoke>d__3.MoveNext()\r\n   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.Invoke(HttpContext httpContext)\r\n   at Microsoft.AspNetCore.Hosting.Internal.HostingApplication.ProcessRequestAsync(Context context)\r\n   at Microsoft.AspNetCore.Server.Kestrel.Http.Frame`1.<RequestProcessingAsync>d__3.MoveNext()\r\n   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Microsoft.AspNetCore.Server.Kestrel.Http.Frame`1.RequestProcessingAsync()\r\n   at System.Threading.Tasks.Task`1.InnerInvoke()\r\n   at System.Threading.Tasks.Task.Execute()\r\n   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)\r\n   at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)\r\n   at System.Threading.ThreadPoolWorkQueue.Dispatch()\r\nAborted (core dumped)\r\n```\r\n\r\n@yuwaMSFT is currently working on getting a coredump for this. \r\nRan with **500-1000 clients** against it for 10 hours. (It may happen in just 2 to 3 hours).\r\n\r\n\r\n1. Install dnvm and DNX, and libuv\r\n  https://docs.asp.net/en/latest/getting-started/installing-on-linux.html\r\n\r\n  sudo apt-get install unzip curl\r\n  curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | DNX_BRANCH=dev sh && source ~/.dnx/dnvm/dnvm.sh\r\n\r\n  sudo apt-get install libunwind8 gettext libssl-dev libcurl4-openssl-dev zlib1g libicu-dev uuid-dev\r\ndnvm upgrade -r coreclr\r\n\r\n  sudo apt-get install make automake libtool curl\r\n  curl -sSL https://github.com/libuv/libuv/archive/v1.8.0.tar.gz | sudo tar zxfv - -C /usr/local/src\r\n  cd /usr/local/src/libuv-1.8.0\r\n  sudo sh autogen.sh\r\n  sudo ./configure\r\n  sudo make\r\n  sudo make install\r\n  sudo rm -rf /usr/local/src/libuv-1.8.0 && cd ~/\r\n  sudo ldconfig\r\n\r\n2. Install Mono if needed:\r\nhttp://www.mono-project.com/docs/getting-started/install/linux/\r\n\r\n3. Create a ASP.Net application\r\n4. Run application on specific port, say http://localhost:5000\r\n5. Install Nginx\r\nsudo apt-get install nginx\r\n6. Create and enable a site\r\n    a. Create a configuration file for a new site and enable reverse proxy:\r\n    /etc/nginx/sites-available/mysite\r\n```\r\n    server {\r\n            listen 8080;\r\n        \r\n            location / {\r\n                    proxy_set_header    Host $host;\r\n                    proxy_set_header    X-Real-IP   $remote_addr;\r\n                    proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;\r\n                    proxy_pass  http://localhost:5000;\r\n            }\r\n    }```    \r\n    b. Link the configuration as enabled site:\r\n    ln -s /etc/nginx/sites-available/mysite /etc/nginx/sites-enabled/mysite\r\n    c. Restart nginx\r\n    sudo service nginx restart"},"comment":{"url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/comments/185338582","html_url":"https://github.com/aspnet/KestrelHttpServer/issues/621#issuecomment-185338582","issue_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/621","id":185338582,"user":{"login":"SajayAntony","id":1821104,"avatar_url":"https://avatars.githubusercontent.com/u/1821104?v=3","gravatar_id":"","url":"https://api.github.com/users/SajayAntony","html_url":"https://github.com/SajayAntony","followers_url":"https://api.github.com/users/SajayAntony/followers","following_url":"https://api.github.com/users/SajayAntony/following{/other_user}","gists_url":"https://api.github.com/users/SajayAntony/gists{/gist_id}","starred_url":"https://api.github.com/users/SajayAntony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SajayAntony/subscriptions","organizations_url":"https://api.github.com/users/SajayAntony/orgs","repos_url":"https://api.github.com/users/SajayAntony/repos","events_url":"https://api.github.com/users/SajayAntony/events{/privacy}","received_events_url":"https://api.github.com/users/SajayAntony/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T18:28:00Z","updated_at":"2016-02-17T18:28:00Z","body":"/cc @Eilon I believe @yuwaMSFT provided the core dump is someone looking at this?"}}