Skip to content

3.1 ASP.NET core app, with runtime 3.1.3, randomly crashing w3wp.exe #21477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jmatheti opened this issue May 4, 2020 · 15 comments
Closed

3.1 ASP.NET core app, with runtime 3.1.3, randomly crashing w3wp.exe #21477

jmatheti opened this issue May 4, 2020 · 15 comments
Assignees
Labels
area-identity Includes: Identity and providers External This is an issue in a component not contained in this repository. It is open for tracking purposes.

Comments

@jmatheti
Copy link

jmatheti commented May 4, 2020

We have an application migrated from 2.1 to 3.1 which is working fine but failing randomly in production and UAT able to reproduce using ZAP scan. The stdout files are empty. The ANCM diagnostic log file does not have much information about the issue. Application log does not have any errors or warnings when the crash happens.

I have the dump file to share but that's over 500MB .

To use kestrel, outofprocess hosting model, we are hitting the port collision issue with 502.3 ANCM startup failure with empty stdout and one warning in the event viewer -
failed to start process with commandline 'dotnet .\App.dll' at stage 'PostStartCheck', ErrorCode = '0x8027025a', assigned port 25442, retryCounter '0'.

###Exception

Event viewer -
Faulting application name: w3wp.exe, version: 10.0.14393.0, time stamp: 0x57899b8a
Faulting module name: KERNEL32.DLL, version: 10.0.14393.2969, time stamp: 0x5ccd17c9
Exception code: 0xc00000fd
Fault offset: 0x000000000001183d
Faulting process id: 0x1c7c
Faulting application start time: 0x01d6192b72f91477
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\Windows\System32\KERNEL32.DLL
Report Id: 8fac1967-f339-40d6-97ad-41e1cc2dc473

ANCM diagnostic log

[aspnetcorev2.dll] Initializing logs for 'C:\Program Files\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll'. Process Id: 65008.. File Version: 13.1.20018.2. Description: IIS ASP.NET Core Module V2. Commit: c3acdca.
[aspnetcorev2.dll] Resolving hostfxr parameters for application: 'dotnet' arguments: '.\DCA.Auth.Server.dll' path: 'E:\App'
[aspnetcorev2.dll] Known dotnet.exe location: ''
[aspnetcorev2.dll] Process path 'dotnet.exe' is dotnet, treating application as portable
[aspnetcorev2.dll] Resolving absolute path to dotnet.exe from 'dotnet.exe'
[aspnetcorev2.dll] Invoking where.exe to find dotnet.exe
[aspnetcorev2.dll] where.exe invocation returned: 'C:\Program Files\dotnet\dotnet.exe
C:\Program Files (x86)\dotnet\dotnet.exe
'
[aspnetcorev2.dll] Current process bitness type detected as isX64=1
[aspnetcorev2.dll] Processing entry 'C:\Program Files\dotnet\dotnet.exe'
[aspnetcorev2.dll] Binary type 6
[aspnetcorev2.dll] Found dotnet.exe via where.exe invocation at 'C:\Program Files\dotnet\dotnet.exe'
[aspnetcorev2.dll] Resolving absolute path to hostfxr.dll from 'C:\Program Files\dotnet\dotnet.exe'
[aspnetcorev2.dll] hostfxr.dll located at 'C:\Program Files\dotnet\host\fxr\3.1.2\hostfxr.dll'
[aspnetcorev2.dll] Converted argument '.\App.dll' to 'E:\App.\App.dll'
[aspnetcorev2.dll] Parsed hostfxr options: dotnet location: 'C:\Program Files\dotnet\dotnet.exe' hostfxr path: 'C:\Program Files\dotnet\host\fxr\3.1.2\hostfxr.dll' arguments:
[aspnetcorev2.dll] Argument[0] = 'C:\Program Files\dotnet\dotnet.exe'
[aspnetcorev2.dll] Argument[1] = 'E:\App.\App.dll'
[aspnetcorev2.dll] Loading hostfxr from location C:\Program Files\dotnet\host\fxr\3.1.2\hostfxr.dll
[aspnetcorev2.dll] Canceling standard stream pipe reader
[aspnetcorev2.dll] Loading request handler: 'C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\aspnetcorev2_inprocess.dll'
[aspnetcorev2.dll] Creating handler application
[aspnetcorev2_inprocess.dll] Initializing logs for 'C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\aspnetcorev2_inprocess.dll'. Process Id: 65008.. File Version: 13.1.20018.2. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: c3acdca.
[aspnetcorev2_inprocess.dll] Waiting for initialization
[aspnetcorev2_inprocess.dll] Starting in-process worker thread
[aspnetcorev2_inprocess.dll] Resolving hostfxr parameters for application: 'dotnet' arguments: '.\App.dll' path: 'E:\App'
[aspnetcorev2_inprocess.dll] Known dotnet.exe location: 'C:\Program Files\dotnet\dotnet.exe'
[aspnetcorev2_inprocess.dll] Process path 'dotnet.exe' is dotnet, treating application as portable
[aspnetcorev2_inprocess.dll] Resolving absolute path to hostfxr.dll from 'C:\Program Files\dotnet\dotnet.exe'
[aspnetcorev2_inprocess.dll] hostfxr.dll located at 'C:\Program Files\dotnet\host\fxr\3.1.2\hostfxr.dll'
[aspnetcorev2_inprocess.dll] Converted argument '.\App.dll' to 'E:\App.\App.dll'
[aspnetcorev2_inprocess.dll] Parsed hostfxr options: dotnet location: 'C:\Program Files\dotnet\dotnet.exe' hostfxr path: 'C:\Program Files\dotnet\host\fxr\3.1.2\hostfxr.dll' arguments:
[aspnetcorev2_inprocess.dll] Argument[0] = 'C:\Program Files\dotnet\dotnet.exe'
[aspnetcorev2_inprocess.dll] Argument[1] = 'E:\App.\App.dll'
[aspnetcorev2_inprocess.dll] Setting environment variable ASPNETCORE_IIS_HTTPAUTH=anonymous;
[aspnetcorev2_inprocess.dll] Setting environment variable ASPNETCORE_IIS_PHYSICAL_PATH=E:\App
[aspnetcorev2_inprocess.dll] Loading hostfxr from location C:\Program Files\dotnet\host\fxr\3.1.2\hostfxr.dll
[aspnetcorev2_inprocess.dll] Initial Dll directory: '', current directory: 'c:\windows\system32\inetsrv'
[aspnetcorev2_inprocess.dll] Setting dll directory to c:\windows\system32\inetsrv
[aspnetcorev2_inprocess.dll] Setting current directory to E:\App
[aspnetcorev2_inprocess.dll] In-process callbacks set
[aspnetcorev2_inprocess.dll] Event Log: 'Application 'E:\App' started successfully.'
End Event Log Message.
[aspnetcorev2_inprocess.dll] Starting app_offline monitoring in application 'E:\App'
[aspnetcorev2_inprocess.dll] Adding request. Total Request Count 1
[aspnetcorev2_inprocess.dll] Adding request. Total Request Count 2
[aspnetcorev2_inprocess.dll] Adding request. Total Request Count 3
[aspnetcorev2_inprocess.dll] Starting file watcher thread

From dump debug - exception

at compareinfo.windows.cs ,line 143
Unhandled exception at 0x00007FFCD58E183D (kernel32.dll) in w3wp.exe.14184.dmp: 0xC00000FD: Stack overflow (parameters: 0x0000000000000001, 0x000000213BE736C8).

Describe the bug

  • Application is going down after the 5 failures, as per the IIS app pool rapid-fail protection configuration.

  • Application errors in event viewer - IIS worker process crash

  • From the dump file stack over flow exception (see below)
    image

To Reproduce

We don't know the exact scenario but when doing ZAP scan (with insane strength), we are able to reproduce the issue on UAT server.

Further technical details

  • ASP.NET Core version -3.1
  • Include the output of dotnet --info - Issue exists with 2.1.9 and 3.1.3 runtime installed, even after removing 2.1.9 runtime.
  • Windows server 2016, IIS 10.
@jmatheti jmatheti changed the title IIS worker process crash - .Net core 3.1 app - 3.1.3 runtime - core clr stackoverflow exception Randomly crashing w3wp.exe with empty stdout and crash report in event viewer May 4, 2020
@jmatheti jmatheti changed the title Randomly crashing w3wp.exe with empty stdout and crash report in event viewer Randomly crashing w3wp.exe with a crash report in event viewer May 4, 2020
@jmatheti jmatheti changed the title Randomly crashing w3wp.exe with a crash report in event viewer 3.1 core app, with runtime 3.1.3, randomly crashing w3wp.exe May 4, 2020
@jmatheti jmatheti changed the title 3.1 core app, with runtime 3.1.3, randomly crashing w3wp.exe 3.1 ASP.NET core app, with runtime 3.1.3, randomly crashing w3wp.exe May 4, 2020
@GrabYourPitchforks
Copy link
Member

@Janidbest - thanks for the report! I am interested in looking at your dump file. Can you host the dump file somewhere and email me directly a link to access it? My email address is levib [at] microsoft.com.

If you don't have a place to host it let me know and I can dig one up for you.

@Tratcher Tratcher added area-servers feature-iis Includes: IIS, ANCM labels May 4, 2020
@jmatheti
Copy link
Author

jmatheti commented May 4, 2020

@GrabYourPitchforks Thanks for looking into. I have emailed the link.

@pranavkm pranavkm added area-identity Includes: Identity and providers and removed area-servers feature-iis Includes: IIS, ANCM labels May 5, 2020
@pranavkm
Copy link
Contributor

pranavkm commented May 5, 2020

@HaoK parking this on your plate to resolve.

@HaoK
Copy link
Member

HaoK commented May 5, 2020

Are you able to share the source code of your app @Janidbest ?

@jmatheti
Copy link
Author

jmatheti commented May 6, 2020

@HaoK We can not share the source code. I will try to create a similar sample app for you, can you let me know your findings so I will ensure to have those interested services the DI and see if I could reproduce the issue before I share it with you. Since its now area-identity, FYI, we have configuration driven CustomUserStore, by adding the service to DI (loading the assembly dropped, using reflection, finding the implementation). Then the calls have been made to finduserbyId, finduserbyname ..... in this particular case, the custom user store implementation is a .NetStandard 2.0 class library using the dapper and some of the 2.1 packages. Like wise we also have custom password algorithm support.

@HaoK
Copy link
Member

HaoK commented May 7, 2020

If you look at the callstack in the crash, there appears to be recursion in the cookie validation paths,

DCA_Auth_Server!DCA.Auth.Server.Customize.CustomLabelService..ctor(IdentityServer4.Services.IIdentityServerInteractionService, Microsoft.AspNetCore.Http.IHttpContextAccessor, DCA.Auth.Server.Cache.CacheManager)+0x168

1d 00000021`3be752f0 00007ffc`30cc4627 Microsoft_Extensions_DependencyInjection!DynamicClass.ResolveService(ILEmitResolverBuilderRuntimeContext, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope)+0xe8f

1e 00000021`3be75580 00007ffc`30cc414f Microsoft_Extensions_DependencyInjection!DynamicClass.ResolveService(ILEmitResolverBuilderRuntimeContext, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope)+0x1d7

1f 00000021`3be75660 00007ffc`30cc3dcf Microsoft_Extensions_DependencyInjection!DynamicClass.ResolveService(ILEmitResolverBuilderRuntimeContext, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope)+0xbf

20 00000021`3be75770 00007ffc`30cc3ba9 Microsoft_Extensions_DependencyInjection!DynamicClass.ResolveService(ILEmitResolverBuilderRuntimeContext, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope)+0xbf

21 00000021`3be75860 00007ffc`b27bbdf9 Microsoft_Extensions_DependencyInjection!DynamicClass.ResolveService(ILEmitResolverBuilderRuntimeContext, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope)+0xd9

22 00000021`3be75900 00007ffc`b27bc00a Microsoft_Extensions_DependencyInjection!Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(System.Type, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope)+0x79 [/_/src/DependencyInjection/DI/src/ServiceLookup/ServiceProviderEngine.cs @ 88]

23 00000021`3be75950 00007ffc`ba02b036 Microsoft_Extensions_DependencyInjection!Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(System.Type)+0x2a [/_/src/DependencyInjection/DI/src/ServiceLookup/ServiceProviderEngineScope.cs @ 34]

24 00000021`3be75990 00007ffc`ba02b101 Microsoft_Extensions_DependencyInjection_Abstractions!Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(System.IServiceProvider, System.Type)+0x56 [/_/src/DependencyInjection/DI.Abstractions/src/ServiceProviderServiceExtensions.cs @ 56]

25 00000021`3be759d0 00007ffc`8e528276 Microsoft_Extensions_DependencyInjection_Abstractions!Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[[System.__Canon, System.Private.CoreLib]](System.IServiceProvider)+0x41 [/_/src/DependencyInjection/DI.Abstractions/src/ServiceProviderServiceExtensions.cs @ 79]

26 00000021`3be75a20 00007ffc`8e5281f5 Microsoft_AspNetCore_Identity!Microsoft.AspNetCore.Identity.SecurityStampValidator.ValidateAsync[[System.__Canon, System.Private.CoreLib]](Microsoft.AspNetCore.Authentication.Cookies.CookieValidatePrincipalContext)+0x76 [/_/src/Identity/Core/src/SecurityStampValidator.cs @ 174]

27 00000021`3be75a60 00007ffc`8e4fd1a0 Microsoft_AspNetCore_Identity!Microsoft.AspNetCore.Identity.SecurityStampValidator.ValidatePrincipalAsync(Microsoft.AspNetCore.Authentication.Cookies.CookieValidatePrincipalContext)+0x15 [/_/src/Identity/Core/src/SecurityStampValidator.cs @ 156]

28 00000021`3be75a90 00007ffc`8e500540 Microsoft_AspNetCore_Authentication_Cookies!Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationEvents.ValidatePrincipal(Microsoft.AspNetCore.Authentication.Cookies.CookieValidatePrincipalContext)+0x10 [/_/src/Security/Authentication/Cookies/src/CookieAuthenticationEvents.cs @ 115]

29 00000021`3be75ac0 00007ffc`311a00c6 Microsoft_AspNetCore_Authentication_Cookies!Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler+<HandleAuthenticateAsync>d__22.MoveNext()+0x1e0 [/_/src/Security/Authentication/Cookies/src/CookieAuthenticationHandler.cs @ 177]

2a 00000021`3be75b40 00007ffc`311a001f System_Private_CoreLib!System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.AspNetCore.Mvc.Razor.RazorView+<RenderAsync>d__18, Microsoft.AspNetCore.Mvc.Razor]](<RenderAsync>d__18 ByRef)+0xffffffff`ff0543a6 [/_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 1036]

2b 00000021`3be75bd0 00007ffc`8e4fdd1d System_Private_CoreLib!System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib]].Start[[Microsoft.AspNetCore.Identity.UserManager`1+<GetPhoneNumberAsync>d__124[[System.__Canon, System.Private.CoreLib]], Microsoft.Extensions.Identity.Core]](<GetPhoneNumberAsync>d__124<System.__Canon> ByRef)+0xffffffff`ff692b9f [/_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 350]

2c 00000021`3be75c00 00007ffc`8e4d7f21 Microsoft_AspNetCore_Authentication_Cookies!Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler.HandleAuthenticateAsync()+0x5d [/_/src/Security/Authentication/Cookies/src/CookieAuthenticationHandler.cs @ 409]

2d 00000021`3be75c80 00007ffc`3119fef9 Microsoft_AspNetCore_Authentication!Microsoft.AspNetCore.Authentication.AuthenticationHandler`1+<AuthenticateAsync>d__48[[System.__Canon, System.Private.CoreLib]].MoveNext()+0x131 [/_/src/Security/Authentication/Core/src/AuthenticationHandler.cs @ 138]

2e 00000021`3be75ce0 00007ffc`3119fd95 System_Private_CoreLib!System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.AspNetCore.Mvc.Razor.RazorView+<RenderAsync>d__18, Microsoft.AspNetCore.Mvc.Razor]](<RenderAsync>d__18 ByRef)+0xffffffff`ff0541d9 [/_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 1036]

2f 00000021`3be75d90 00007ffc`8e4d3467 System_Private_CoreLib!System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib]].Start[[Microsoft.AspNetCore.Identity.UserManager`1+<GetPhoneNumberAsync>d__124[[System.__Canon, System.Private.CoreLib]], Microsoft.Extensions.Identity.Core]](<GetPhoneNumberAsync>d__124<System.__Canon> ByRef)+0xffffffff`ff692915 [/_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 350]

30 00000021`3be75dd0 00007ffc`314126bc Microsoft_AspNetCore_Authentication!Microsoft.AspNetCore.Authentication.AuthenticationHandler`1[[System.__Canon, System.Private.CoreLib]].AuthenticateAsync()+0x67 [/_/src/Security/Authentication/Core/src/AuthenticationHandler.cs @ 198]

31 00000021`3be75e40 00007ffc`31411f46 IdentityServer4!IdentityServer4.Services.DefaultUserSession+<AuthenticateAsync>d__16.MoveNext()+0x2ec

32 00000021`3be75f20 00007ffc`31411dab System_Private_CoreLib!System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.AspNetCore.Mvc.Razor.RazorView+<RenderAsync>d__18, Microsoft.AspNetCore.Mvc.Razor]](<RenderAsync>d__18 ByRef)+0xffffffff`ff2c6226 [/_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 1036]

33 00000021`3be75fb0 00007ffc`31411adc System_Private_CoreLib!System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Microsoft.AspNetCore.Mvc.Controllers.ControllerBinderDelegateProvider+<>c__DisplayClass0_0+<<CreateBinderDelegate>g__Bind|0>d, Microsoft.AspNetCore.Mvc.Core]](<<CreateBinderDelegate>g__Bind|0>d ByRef)+0xffffffff`ff85c58b [/_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 223]

34 00000021`3be75fe0 00007ffc`31411784 IdentityServer4!IdentityServer4.Services.DefaultUserSession.AuthenticateAsync()+0x5c

35 00000021`3be76060 00007ffc`31411676 IdentityServer4!IdentityServer4.Services.DefaultUserSession+<GetUserAsync>d__18.MoveNext()+0x54

36 00000021`3be760e0 00007ffc`314115cf System_Private_CoreLib!System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.AspNetCore.Mvc.Razor.RazorView+<RenderAsync>d__18, Microsoft.AspNetCore.Mvc.Razor]](<RenderAsync>d__18 ByRef)+0xffffffff`ff2c5956 [/_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 1036]

37 00000021`3be76170 00007ffc`31411570 System_Private_CoreLib!System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib]].Start[[Microsoft.AspNetCore.Identity.UserManager`1+<GetPhoneNumberAsync>d__124[[System.__Canon, System.Private.CoreLib]], Microsoft.Extensions.Identity.Core]](<GetPhoneNumberAsync>d__124<System.__Canon> ByRef)+0xffffffff`ff90414f [/_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 350]

38 00000021`3be761a0 00007ffc`3140fd1c IdentityServer4!IdentityServer4.Services.DefaultUserSession.GetUserAsync()+0x70

39 00000021`3be76210 00007ffc`3140f9e6 IdentityServer4!IdentityServer4.Services.OidcReturnUrlParser+<ParseAsync>d__5.MoveNext()+0x27c

3a 00000021`3be76340 00007ffc`3140f93f System_Private_CoreLib!System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.AspNetCore.Mvc.Razor.RazorView+<RenderAsync>d__18, Microsoft.AspNetCore.Mvc.Razor]](<RenderAsync>d__18 ByRef)+0xffffffff`ff2c3cc6 [/_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 1036]

3b 00000021`3be763d0 00007ffc`3140f8e3 System_Private_CoreLib!System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib]].Start[[Microsoft.AspNetCore.Identity.UserManager`1+<GetPhoneNumberAsync>d__124[[System.__Canon, System.Private.CoreLib]], Microsoft.Extensions.Identity.Core]](<GetPhoneNumberAsync>d__124<System.__Canon> ByRef)+0xffffffff`ff9024bf [/_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 350]

3c 00000021`3be76400 00007ffc`3140f18f IdentityServer4!IdentityServer4.Services.OidcReturnUrlParser.ParseAsync(System.String)+0x83

3d 00000021`3be76490 00007ffc`3140f016 IdentityServer4!IdentityServer4.Services.ReturnUrlParser+<ParseAsync>d__2.MoveNext()+0xbf

3e 00000021`3be764f0 00007ffc`3140ef6f System_Private_CoreLib!System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.AspNetCore.Mvc.Razor.RazorView+<RenderAsync>d__18, Microsoft.AspNetCore.Mvc.Razor]](<RenderAsync>d__18 ByRef)+0xffffffff`ff2c32f6 [/_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 1036]

3f 00000021`3be76580 00007ffc`3140ef10 System_Private_CoreLib!System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib]].Start[[Microsoft.AspNetCore.Identity.UserManager`1+<GetPhoneNumberAsync>d__124[[System.__Canon, System.Private.CoreLib]], Microsoft.Extensions.Identity.Core]](<GetPhoneNumberAsync>d__124<System.__Canon> ByRef)+0xffffffff`ff901aef [/_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 350]

40 00000021`3be765b0 00007ffc`3140ec61 IdentityServer4!IdentityServer4.Services.ReturnUrlParser.ParseAsync(System.String)+0x80

41 00000021`3be76630 00007ffc`3140eb26 IdentityServer4!IdentityServer4.Services.DefaultIdentityServerInteractionService+<GetAuthorizationContextAsync>d__10.MoveNext()+0x81

42 00000021`3be76700 00007ffc`3140ea7f System_Private_CoreLib!System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.AspNetCore.Mvc.Razor.RazorView+<RenderAsync>d__18, Microsoft.AspNetCore.Mvc.Razor]](<RenderAsync>d__18 ByRef)+0xffffffff`ff2c2e06 [/_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 1036]

43 00000021`3be76790 00007ffc`3140ea20 System_Private_CoreLib!System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib]].Start[[Microsoft.AspNetCore.Identity.UserManager`1+<GetPhoneNumberAsync>d__124[[System.__Canon, System.Private.CoreLib]], Microsoft.Extensions.Identity.Core]](<GetPhoneNumberAsync>d__124<System.__Canon> ByRef)+0xffffffff`ff9015ff [/_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 350]

44 00000021`3be767c0 00007ffc`3140e478 IdentityServer4!IdentityServer4.Services.DefaultIdentityServerInteractionService.GetAuthorizationContextAsync(System.String)+0x80

45 00000021`3be76830 00007ffc`30cc5acf DCA_Auth_Server!DCA.Auth.Server.Customize.CustomLabelService..ctor(IdentityServer4.Services.IIdentityServerInteractionService, Microsoft.AspNetCore.Http.IHttpContextAccessor, DCA.Auth.Server.Cache.CacheManager)+0x168

46 00000021`3be768b0 00007ffc`30cc4627 Microsoft_Extensions_DependencyInjection!DynamicClass.ResolveService(ILEmitResolverBuilderRuntimeContext, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope)+0xe8f

47 00000021`3be76b40 00007ffc`30cc414f Microsoft_Extensions_DependencyInjection!DynamicClass.ResolveService(ILEmitResolverBuilderRuntimeContext, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope)+0x1d7

48 00000021`3be76c20 00007ffc`30cc3dcf Microsoft_Extensions_DependencyInjection!DynamicClass.ResolveService(ILEmitResolverBuilderRuntimeContext, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope)+0xbf

49 00000021`3be76d30 00007ffc`30cc3ba9 Microsoft_Extensions_DependencyInjection!DynamicClass.ResolveService(ILEmitResolverBuilderRuntimeContext, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope)+0xbf

4a 00000021`3be76e20 00007ffc`b27bbdf9 Microsoft_Extensions_DependencyInjection!DynamicClass.ResolveService(ILEmitResolverBuilderRuntimeContext, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope)+0xd9

4b 00000021`3be76ec0 00007ffc`b27bc00a Microsoft_Extensions_DependencyInjection!Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(System.Type, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope)+0x79 [/_/src/DependencyInjection/DI/src/ServiceLookup/ServiceProviderEngine.cs @ 88]

4c 00000021`3be76f10 00007ffc`ba02b036 Microsoft_Extensions_DependencyInjection!Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(System.Type)+0x2a [/_/src/DependencyInjection/DI/src/ServiceLookup/ServiceProviderEngineScope.cs @ 34]

4d 00000021`3be76f50 00007ffc`ba02b101 Microsoft_Extensions_DependencyInjection_Abstractions!Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(System.IServiceProvider, System.Type)+0x56 [/_/src/DependencyInjection/DI.Abstractions/src/ServiceProviderServiceExtensions.cs @ 56]

4e 00000021`3be76f90 00007ffc`8e528276 Microsoft_Extensions_DependencyInjection_Abstractions!Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[[System.__Canon, System.Private.CoreLib]](System.IServiceProvider)+0x41 [/_/src/DependencyInjection/DI.Abstractions/src/ServiceProviderServiceExtensions.cs @ 79]

4f 00000021`3be76fe0 00007ffc`8e5281f5 Microsoft_AspNetCore_Identity!Microsoft.AspNetCore.Identity.SecurityStampValidator.ValidateAsync[[System.__Canon, System.Private.CoreLib]](Microsoft.AspNetCore.Authentication.Cookies.CookieValidatePrincipalContext)+0x76 [/_/src/Identity/Core/src/SecurityStampValidator.cs @ 174]

50 00000021`3be77020 00007ffc`8e4fd1a0 Microsoft_AspNetCore_Identity!Microsoft.AspNetCore.Identity.SecurityStampValidator.ValidatePrincipalAsync(Microsoft.AspNetCore.Authentication.Cookies.CookieValidatePrincipalContext)+0x15 [/_/src/Identity/Core/src/SecurityStampValidator.cs @ 156]

51 00000021`3be77050 00007ffc`8e500540 Microsoft_AspNetCore_Authentication_Cookies!Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationEvents.ValidatePrincipal(Microsoft.AspNetCore.Authentication.Cookies.CookieValidatePrincipalContext)+0x10 [/_/src/Security/Authentication/Cookies/src/CookieAuthenticationEvents.cs @ 115]

52 00000021`3be77080 00007ffc`311a00c6 Microsoft_AspNetCore_Authentication_Cookies!Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler+<HandleAuthenticateAsync>d__22.MoveNext()+0x1e0 [/_/src/Security/Authentication/Cookies/src/CookieAuthenticationHandler.cs @ 177]

53 00000021`3be77100 00007ffc`311a001f System_Private_CoreLib!System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.AspNetCore.Mvc.Razor.RazorView+<RenderAsync>d__18, Microsoft.AspNetCore.Mvc.Razor]](<RenderAsync>d__18 ByRef)+0xffffffff`ff0543a6 [/_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 1036]

54 00000021`3be77190 00007ffc`8e4fdd1d System_Private_CoreLib!System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib]].Start[[Microsoft.AspNetCore.Identity.UserManager`1+<GetPhoneNumberAsync>d__124[[System.__Canon, System.Private.CoreLib]], Microsoft.Extensions.Identity.Core]](<GetPhoneNumberAsync>d__124<System.__Canon> ByRef)+0xffffffff`ff692b9f [/_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 350]

55 00000021`3be771c0 00007ffc`8e4d7f21 Microsoft_AspNetCore_Authentication_Cookies!Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler.HandleAuthenticateAsync()+0x5d [/_/src/Security/Authentication/Cookies/src/CookieAuthenticationHandler.cs @ 409]

56 00000021`3be77240 00007ffc`3119fef9 Microsoft_AspNetCore_Authentication!Microsoft.AspNetCore.Authentication.AuthenticationHandler`1+<AuthenticateAsync>d__48[[System.__Canon, System.Private.CoreLib]].MoveNext()+0x131 [/_/src/Security/Authentication/Core/src/AuthenticationHandler.cs @ 138]

57 00000021`3be772a0 00007ffc`3119fd95 System_Private_CoreLib!System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.AspNetCore.Mvc.Razor.RazorView+

@jmatheti
Copy link
Author

jmatheti commented May 7, 2020

@HaoK Thanks. We have a code from samesite (breakin change 3.0- 3.1), in the startup services. This is is the only cookie related change compared to previous build which is working.

I have been trying with the sample app to reproduce the issue, without a success. Now that I know its related to the cookie validation, let me add this and try.

@jmatheti
Copy link
Author

jmatheti commented May 7, 2020

@HaoK we have got this issue in another environment on every login, on every login page get request is crashing and the site going down as the app pool stopped. I appreciate if you share your direct contact to expedite. Weird dev environment is working fine, but not test environment.

@HaoK
Copy link
Member

HaoK commented May 7, 2020

sure my github is my microsoft alias, so [email protected]

@blowdart
Copy link
Contributor

blowdart commented May 9, 2020

Are you getting an endless redirect loop by any chance, now you have samesite changes in?

Is it on all browser types? Edge, Safari and Chrome?

@jmatheti
Copy link
Author

@blowdart Yes, we have seen this issue on Firefox, Edge and Chrome. But not sure about the Safari. I think I found it. The accountViewModel fluent validator constructor has a call to var authorizeRequest = interactionService.GetAuthorizationContextAsync (returnUrl) to get the clientId. After I have replaced this wtih the local code, the issue has gone. The same site changes are in the build.
I need to ensure this build is working on the all servers, before we close this issue.

Since this issue not coming from the dev servers, we are also thinking this may be in the code where race condition hits when the server is under performing, rest all environments have a better performances where we see this issue.

@blowdart
Copy link
Contributor

I'll leave it to Hao to dig in, but from your description at least it's not same site :)

@HaoK
Copy link
Member

HaoK commented May 11, 2020

Looks like the root issue has been identified, resolving as external for now, feel free to reactivate if this requires anything on our side

@HaoK HaoK closed this as completed May 11, 2020
@HaoK HaoK added the External This is an issue in a component not contained in this repository. It is open for tracking purposes. label May 11, 2020
@brockallen
Copy link

Looks like the root issue has been identified

And so what was the root issue?

@HaoK
Copy link
Member

HaoK commented Jun 10, 2020

From an offline email, the offending call that was causing the recursion was:

I have found the root cause. It is coming from the Identity server framework call var authorizeRequest = interactionService.GetAuthorizationContextAsync (returnUrl).Result;. I have replaced this with the local code to get the query parameters in the auth request.

@ghost ghost locked as resolved and limited conversation to collaborators Jul 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-identity Includes: Identity and providers External This is an issue in a component not contained in this repository. It is open for tracking purposes.
Projects
None yet
Development

No branches or pull requests

7 participants