SimpleInjector icon indicating copy to clipboard operation
SimpleInjector copied to clipboard

IIS Application hang when Simple Injector calls LambdaCompiler.Compile.

Open cblaze22 opened this issue 3 years ago • 10 comments

We get this every once ina while and not sure why exactly but it causes our site to hang. Is this a SimpleInjector issue? Below is the dmp file output.

0:000> !analyze -v
*******************************************************************************
*                                                                             *
*                        Exception Analysis                                   *
*                                                                             *
*******************************************************************************

MethodDesc:   00007ff9f01abcb8
Method Name:  System.Linq.Expressions.Compiler.LambdaCompiler.Compile(System.Linq.Expressions.LambdaExpression, System.Runtime.CompilerServices.DebugInfoGenerator)
Class:        00007ff9f01b4630
MethodTable:  00007ff9f01ac5e0
mdToken:      000000000600172d
Module:       00007ff9eed60020
IsJitted:     yes
CodeAddr:     00007ff9efcbb940
Transparency: Transparent
MethodDesc:   00007ffa0325b848
Method Name:  SimpleInjector.Advanced.DefaultExpressionCompilationBehavior.Compile(System.Linq.Expressions.Expression)
Class:        00007ffa03247c20
MethodTable:  00007ffa0325b858
mdToken:      00000000060007e0
Module:       00007ffa019f96d0
IsJitted:     yes
CodeAddr:     00007ffa0316f7e0
Transparency: Critical
MethodDesc:   00007ffa0369d130
Method Name:  SimpleInjector.Internals.CompilationHelpers.ReduceObjectGraphSize(System.Linq.Expressions.Expression, SimpleInjector.Container, System.Collections.Generic.Dictionary`2<System.Linq.Expressions.Expression,System.Linq.Expressions.InvocationExpression>)
Class:        00007ffa036a8300
MethodTable:  00007ffa0369d168
mdToken:      00000000060005bd
Module:       00007ffa019f96d0
IsJitted:     yes
CodeAddr:     00007ffa0316ed00
Transparency: Critical
MethodDesc:   00007ffa0369d0c0
Method Name:  SimpleInjector.Internals.CompilationHelpers.CompileExpression(SimpleInjector.Container, System.Linq.Expressions.Expression, System.Collections.Generic.Dictionary`2<System.Linq.Expressions.Expression,System.Linq.Expressions.InvocationExpression>)
Class:        00007ffa036a8300
MethodTable:  00007ffa0369d168
mdToken:      00000000060005b7
Module:       00007ffa019f96d0
IsJitted:     yes
CodeAddr:     00007ffa0316eca0
Transparency: Critical
MethodDesc:   00007ffa036c83e0
Method Name:  SimpleInjector.Internals.CompilationHelpers.CompileExpression[[System.__Canon, mscorlib]](SimpleInjector.Container, System.Linq.Expressions.Expression)
Class:        00007ffa036a8300
MethodTable:  00007ffa0369d168
mdToken:      00000000060005b6
Module:       00007ffa019f96d0
IsJitted:     yes
CodeAddr:     00007ffa031744c0
Transparency: Critical
MethodDesc:   00007ffa032577b8
Method Name:  SimpleInjector.InstanceProducer.BuildInstanceCreator()
Class:        00007ffa03245aa8
MethodTable:  00007ffa03257888
mdToken:      000000000600035c
Module:       00007ffa019f96d0
IsJitted:     yes
CodeAddr:     00007ffa03174370
Transparency: Critical
MethodDesc:   00007ffa03257808
Method Name:  SimpleInjector.InstanceProducer.BuildAndReplaceInstanceCreatorAndCreateFirstInstance()
Class:        00007ffa03245aa8
MethodTable:  00007ffa03257888
mdToken:      0000000006000361
Module:       00007ffa019f96d0
IsJitted:     yes
CodeAddr:     00007ffa03174320
Transparency: Critical
MethodDesc:   00007ffa032576e8
Method Name:  SimpleInjector.InstanceProducer.GetInstance()
Class:        00007ffa03245aa8
MethodTable:  00007ffa03257888
mdToken:      000000000600034f
Module:       00007ffa019f96d0
IsJitted:     yes
CodeAddr:     00007ffa031741d0
Transparency: Critical
MethodDesc:   00007ffa03257748
Method Name:  SimpleInjector.InstanceProducer.VerifyInstanceCreation()
Class:        00007ffa03245aa8
MethodTable:  00007ffa03257888
mdToken:      0000000006000355
Module:       00007ffa019f96d0
IsJitted:     yes
CodeAddr:     00007ffa0317e690
Transparency: Critical
MethodDesc:   00007ffa01f29220
Method Name:  SimpleInjector.Container.VerifyInternal(Boolean)
Class:        00007ffa01f5f180
MethodTable:  00007ffa01f292e8
mdToken:      0000000006000249
Module:       00007ffa019f96d0
IsJitted:     yes
CodeAddr:     00007ffa03148ea0
Transparency: Critical
MethodDesc:   00007ffa01f291e0
Method Name:  SimpleInjector.Container.Verify()
Class:        00007ffa01f5f180
MethodTable:  00007ffa01f292e8
mdToken:      0000000006000245
Module:       00007ffa019f96d0
IsJitted:     yes
CodeAddr:     00007ffa03148010
Transparency: Critical
MethodDesc:   00007ffa01f27c90
Method Name:  Tournaments.MvcApplication.Application_Start()
Class:        00007ffa01f5f018
MethodTable:  00007ffa01f27d88
mdToken:      0000000006000261
Module:       00007ffa01b4c050
IsJitted:     yes
CodeAddr:     00007ffa014aeba0
Transparency: Critical
MethodDesc:   00007ff9ef1a2668
Method Name:  System.Web.HttpApplication.InvokeMethodWithAssert(System.Reflection.MethodInfo, Int32, System.Object, System.EventArgs)
Class:        00007ff9ef194798
MethodTable:  00007ff9ef1a2af0
mdToken:      0000000006000777
Module:       00007ff9ee975648
IsJitted:     yes
CodeAddr:     00007ff9efc9c300
Transparency: Safe critical
MethodDesc:   00007ff9ef1a2678
Method Name:  System.Web.HttpApplication.ProcessSpecialRequest(System.Web.HttpContext, System.Reflection.MethodInfo, Int32, System.Object, System.EventArgs, System.Web.SessionState.HttpSessionState)
Class:        00007ff9ef194798
MethodTable:  00007ff9ef1a2af0
mdToken:      0000000006000778
Module:       00007ff9ee975648
IsJitted:     yes
CodeAddr:     00007ff9efc9bde0
Transparency: Safe critical
MethodDesc:   00007ff9efc57e50
Method Name:  System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(System.Web.HttpContext, System.Web.HttpApplication)
Class:        00007ff9efd022a8
MethodTable:  00007ff9efc58070
mdToken:      00000000060007ae
Module:       00007ff9ee975648
IsJitted:     yes
CodeAddr:     00007ff9efc966d0
Transparency: Safe critical
MethodDesc:   00007ff9ef1a2868
Method Name:  System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr, System.Web.HttpContext, System.Reflection.MethodInfo[])
Class:        00007ff9ef194798
MethodTable:  00007ff9ef1a2af0
mdToken:      0000000006000796
Module:       00007ff9ee975648
IsJitted:     yes
CodeAddr:     00007ff9efc91360
Transparency: Safe critical
MethodDesc:   00007ff9ef1a26b8
Method Name:  System.Web.HttpApplication.InitSpecial(System.Web.HttpApplicationState, System.Reflection.MethodInfo[], IntPtr, System.Web.HttpContext)
Class:        00007ff9ef194798
MethodTable:  00007ff9ef1a2af0
mdToken:      000000000600077c
Module:       00007ff9ee975648
IsJitted:     yes
CodeAddr:     00007ff9efc90b00
Transparency: Safe critical
MethodDesc:   00007ff9efc57f30
Method Name:  System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr, System.Web.HttpContext)
Class:        00007ff9efd022a8
MethodTable:  00007ff9efc58070
mdToken:      00000000060007bc
Module:       00007ff9ee975648
IsJitted:     yes
CodeAddr:     00007ff9efc90250
Transparency: Safe critical
MethodDesc:   00007ff9efc5f390
Method Name:  System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr)
Class:        00007ff9efd0a640
MethodTable:  00007ff9efc5f4b0
mdToken:      0000000006005eea
Module:       00007ff9ee975648
IsJitted:     yes
CodeAddr:     00007ff9efc8d280
Transparency: Safe critical
MethodDesc:   00007ff9efd10598
Method Name:  DomainNeutralILStubClass.IL_STUB_COMtoCLR(Int64)
Class:        00007ff9eebf23b0
MethodTable:  00007ff9eebf2428
mdToken:      0000000006000000
Module:       00007ff9ee975648
IsJitted:     yes
CodeAddr:     00007ff9efc8ccd0
Transparency: Safe critical

KEY_VALUES_STRING: 1

    Key  : Analysis.CPU.Sec
    Value: 117

    Key  : Analysis.DebugAnalysisProvider.CPP
    Value: Create: 8007007e on FLYNNPC

    Key  : Analysis.DebugData
    Value: CreateObject

    Key  : Analysis.DebugModel
    Value: CreateObject

    Key  : Analysis.Elapsed.Sec
    Value: 166

    Key  : Analysis.Memory.CommitPeak.Mb
    Value: 369

    Key  : Analysis.System
    Value: CreateObject

    Key  : CLR.Engine
    Value: CLR

    Key  : CLR.Version
    Value: 4.0.30319.0

    Key  : Timeline.OS.Boot.DeltaSec
    Value: 1760870

    Key  : Timeline.Process.Start.DeltaSec
    Value: 32687


NTGLOBALFLAG:  0

PROCESS_BAM_CURRENT_THROTTLED: 0

PROCESS_BAM_PREVIOUS_THROTTLED: 0

APPLICATION_VERIFIER_FLAGS:  0

CONTEXT:  (.ecxr)
rax=0000000000000003 rbx=0000000000000000 rcx=00000000000001c0
rdx=0000000000000000 rsi=00000000ffffffff rdi=00000000000001c0
rip=00007ffa5e73062a rsp=0000000a81ccf5a8 rbp=0000000a81ccf790
 r8=0000000000000004  r9=0000000a81ccf468 r10=0000000000000000
r11=0000000a81ccf3d0 r12=0000000000000000 r13=00007ff77cee1134
r14=0000000000000000 r15=0000000000000000
iopl=0         nv up ei pl zr na po nc
cs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
ntdll!NtWaitForSingleObject+0xa:
00007ffa`5e73062a c3              ret
Resetting default scope

EXCEPTION_RECORD:  (.exr -1)
ExceptionAddress: 0000000000000000
   ExceptionCode: 80000007 (Wake debugger)
  ExceptionFlags: 00000000
NumberParameters: 0

PROCESS_NAME:  w3wp.exe

ERROR_CODE: (NTSTATUS) 0x80000007 - {Kernel Debugger Awakened}  the system debugger was awakened by an interrupt.

EXCEPTION_CODE_STR:  80000007

MISSING_CLR_SYMBOL: 0

DERIVED_WAIT_CHAIN:  

Dl Eid Cid     WaitType
-- --- ------- --------------------------
   0   24d0.10dc GDI                    -->
   8   24d0.12c8 Unknown                

WAIT_CHAIN_COMMAND:  ~0s;k;;~8s;k;;

BLOCKING_THREAD:  00000000000012c8

FAULTING_THREAD:  000012c8

STACK_TEXT:  
0000000a`833aa4d8 00007ffa`5bb72354 : 0000000a`833aa790 0000000a`833aab58 0000000a`833aa788 00007ffa`4da6c92a : ntdll!NtFreeVirtualMemory+0xa
0000000a`833aa4e0 00007ffa`4dfcd992 : 00000000`00000000 0000001f`b53c0000 00007ffa`4dfcd950 00000000`00000000 : KERNELBASE!VirtualFree+0x3b
0000000a`833aa510 00007ffa`4da55f70 : 00007ffa`4dfcd950 00007ffa`4db7d010 0000001f`b53d0000 0000000a`833aac50 : clr!CExecutionEngine::ClrVirtualFree+0x42
0000000a`833aa550 00007ffa`4da66cdb : 00007ffa`4da55f20 00000000`ffffffff 0000000a`833aac50 00007ffa`4db7d010 : clrjit!PooledAllocator::destroy+0x50
0000000a`833aa580 00007ffa`4da56098 : 00007ffa`0419f170 00007ffa`04320571 0000000a`833aa9e0 0000000a`833aac50 : clrjit!jitNativeCode+0x2c3
0000000a`833aa740 00007ffa`4dfd49b9 : 00007ffa`4da55ff0 0000000a`833aa870 0000000a`833aa9e0 00007ffa`4db7dc80 : clrjit!CILJit::compileMethod+0xa2
0000000a`833aa7b0 00007ffa`4dfd5c6a : 0000000f`a2f37870 00007ffa`4dfea2aa 0000000a`833aac50 0000000a`833ab4b8 : clr!invokeCompileMethodHelper+0xce
0000000a`833aa820 00007ffa`4dfd5b02 : 0000000a`833aab20 00000000`00000001 00000000`00000000 00000040`0082c010 : clr!invokeCompileMethod+0x97
0000000a`833aa890 00007ffa`4dfd58ca : 00000000`0082c010 00000000`0082c010 00000000`00989680 0000000a`833aab20 : clr!CallCompileMethodWithSEHWrapper+0x51
0000000a`833aa930 00007ffa`4dfd61ed : 00000000`00000000 00000000`00000000 0000001f`b3d97d18 00000000`00000000 : clr!UnsafeJitFunction+0x69c
0000000a`833aafc0 00007ffa`4dfcf8db : 00007ffa`0419f170 00000000`00000000 0000000a`833ab318 00000000`00000000 : clr!MethodDesc::MakeJitWorker+0x52a
0000000a`833ab220 00007ffa`4e6035b8 : 0000000e`46efd2e8 00000000`00000000 00007ffa`4e5edaad 00007ffa`00000001 : clr!MethodDesc::DoPrestub+0x7e1
0000000a`833ab440 00007ffa`3ddddccb : 0000000e`46f08a58 0000000a`833ab4b8 0000000a`833abc18 0000000e`46efd2e8 : clr!ReflectionInvocation::CompileMethod+0x58
0000000a`833ab490 00007ffa`3e036429 : 0000000e`46f094b8 0000000e`46efd090 00000000`00000000 00000000`00000001 : mscorlib_ni+0xd1dccb
0000000a`833ab540 00007ff9`efcbb9e1 : 0000000e`46ef6c80 0000000b`c4408890 0000000c`4668d288 0000000e`46ef6c60 : mscorlib_ni+0xf76429
0000000a`833ab590 00007ffa`0316f8a5 : 0000000e`46ef6c60 0000000e`46ef6c40 0000000c`463b3550 00007ffa`0316ecbe : 0x00007ff9`efcbb9e1
0000000a`833ab5d0 00007ffa`0316ed86 : 0000000d`0662edb0 0000000e`46eba820 0000000c`4643b6d8 0000000d`86417b28 : 0x00007ffa`0316f8a5
0000000a`833ab620 00007ffa`0316ecb3 : 0000000c`466b0098 0000000d`467df9c8 0000000c`466a0e70 0000000d`467df5c8 : 0x00007ffa`0316ed86
0000000a`833ab680 00007ffa`03174533 : 0000000c`8637a8c8 0000000d`863fc160 0000000c`4669d560 00007ffa`4e4cd98b : 0x00007ffa`0316ecb3
0000000a`833ab6b0 00007ffa`031743c0 : 0000000d`4679c490 00007ff9`f1373177 00000000`0000004f 0000000a`833ab7c0 : 0x00007ffa`03174533
0000000a`833ab700 00007ffa`03174330 : 0000000c`461d04c0 00007ffa`03180b98 00000000`0000004f 0000000c`46586d90 : 0x00007ffa`031743c0
0000000a`833ab750 00007ffa`03174223 : 0000000a`833ab760 00000000`00000001 0000000d`4680ad50 0000000c`461cfaf8 : 0x00007ffa`03174330
0000000a`833ab780 00007ffa`0317e6ad : 0000000c`461d04c0 0000000d`468567a0 0000000a`833ab7c0 00000000`00000001 : 0x00007ffa`03174223
0000000a`833ab7d0 00007ffa`0317e640 : 0000000c`461d04c0 0000000c`46586d90 00000000`00000000 0000000d`468567a0 : 0x00007ffa`0317e6ad
0000000a`833ab820 00007ffa`03148fbe : 0000000c`06558258 0000000d`4679c490 0000000c`46586d90 0000000d`4679bb10 : 0x00007ffa`0317e640
0000000a`833ab870 00007ffa`03148045 : 0000000c`06558258 00000000`00000001 00000000`00000001 00000000`00000000 : 0x00007ffa`03148fbe
0000000a`833ab8e0 00007ffa`014aef29 : 0000000c`06558258 00000000`00000000 0000000c`06558cb4 00000000`08000000 : 0x00007ffa`03148045
0000000a`833ab910 00007ffa`4dfc6913 : 0000000b`05fa9f58 00000000`0000000e 00000000`00000000 00000000`81e80000 : 0x00007ffa`014aef29
0000000a`833abac0 00007ffa`4dfc6818 : 00000000`00000004 00007ffa`4e0a3b1b 00000000`00000001 00007ffa`4dfe93ad : clr!CallDescrWorkerInternal+0x83
0000000a`833abb00 00007ffa`4e0876b2 : 0000000b`060a2508 00000000`00000000 0000000a`833abcf0 00000000`00000000 : clr!CallDescrWorkerWithHandler+0x4e
0000000a`833abb40 00007ffa`4e087b25 : 00000000`00000000 00000000`00000000 00000000`00000000 0000000a`833abe20 : clr!CallDescrWorkerReflectionWrapper+0x1a
0000000a`833abb90 00007ffa`3d65d90d : 0000000f`a2f37870 00007ff9`efc5f390 0000000b`060a2508 00007ffa`3d64fe00 : clr!RuntimeMethodHandle::InvokeMethod+0x465
0000000a`833ac1b0 00007ffa`3d6751f2 : 00000000`00000000 00007ff9`efc5f390 0000000f`a2f37870 0000000b`0607e2c0 : mscorlib_ni+0x59d90d
0000000a`833ac220 00007ffa`3d6f4962 : 0000000f`92c85348 00007ffa`4dfc5715 00007ff9`ef1a2668 0000000b`060a2508 : mscorlib_ni+0x5b51f2
0000000a`833ac2a0 00007ff9`efc9c354 : 00000000`00000000 00000000`00000000 0000000b`0607eaf8 0000000b`060e35a0 : mscorlib_ni+0x634962
0000000a`833ac2e0 00007ff9`efc9bf0b : 0000000b`060a2508 0000000b`0607eaf8 00000000`00000000 0000000b`0607e2c0 : 0x00007ff9`efc9c354
0000000a`833ac330 00007ff9`efc96849 : 0000000b`05fa9f58 0000000b`05fa9370 0000000b`0607eaf8 00000000`00000000 : 0x00007ff9`efc9bf0b
0000000a`833ac3a0 00007ff9`efc91419 : 0000000b`05fa9370 0000000b`060a2508 0000000b`060a94f8 00007ffa`3d0e5dd8 : 0x00007ff9`efc96849
0000000a`833ac430 00007ff9`efc90ba8 : 0000000b`05fa9f58 0000000f`a2d2b6b0 0000000b`05fa9370 0000000b`06099690 : 0x00007ff9`efc91419
0000000a`833ac4b0 00007ff9`efc90365 : 0000000b`05fa9f58 0000000b`0607e598 0000000b`06099690 0000000f`a2d2b6b0 : 0x00007ff9`efc90ba8
0000000a`833ac530 00007ff9`efc8d3f1 : 0000000b`0607e2c0 0000000f`a2d2b6b0 0000000b`060a02d8 00000000`00000002 : 0x00007ff9`efc90365
0000000a`833ac5b0 00007ff9`efc8cce8 : 00000000`c0000135 0000000f`a2d2b6b0 00000000`c0000135 00007ffa`5e6dad61 : 0x00007ff9`efc8d3f1
0000000a`833ac630 00007ffa`4dfc2eb9 : 0000000a`833ac9b0 00000000`00000000 00000000`00000000 00007ffa`4dfc8481 : 0x00007ff9`efc8cce8
0000000a`833ac680 00007ffa`4e145844 : 0000000a`833ac9b0 0000000a`833ac7d0 ffffffff`fffffffe 00007ffa`4dfc83fe : clr!COMToCLRDispatchHelper+0x39
0000000a`833ac6b0 00007ffa`4e1457ed : 00007ffa`4dfc8420 00007ffa`4dfc5341 00000000`00000000 0000000f`a2f37870 : clr!InvokeStub+0x24
0000000a`833ac6f0 00007ffa`4e145470 : 0000000a`00000000 0000000a`833acc70 0000000a`833acbb8 0000000a`833acc10 : clr!COMToCLRWorkerBody_SOIntolerant+0x2c6
0000000a`833ac7a0 00007ffa`4e14523b : 00000000`00000000 00007ffa`4b5c67d8 00000000`00000000 00000000`0000001c : clr!COMToCLRWorkerBodyWithADTransition+0x258
0000000a`833acb40 00007ffa`4dfc2e17 : 00007bc8`a441bef4 00000000`00000015 00000000`00000000 00000000`00000008 : clr!COMToCLRWorker+0xffffffff`fffa147b
0000000a`833acc00 00007ffa`4b5554a2 : 0000000a`83dffb20 0000000f`a2d2b6b0 00000000`00000001 0000000a`824aed78 : clr!GenericComCallStub+0x57
0000000a`833acc90 00007ffa`4b555283 : 00000000`00000001 00000000`00000000 0000000f`a2d2b6b0 0000000a`83dffd98 : webengine4!W3_MGD_APP_CONTEXT::InitializeMgdApplication+0xbb
0000000a`833accd0 00007ffa`4b55543a : 0000000f`a2d2b6b0 0000001f`a42d2ff8 0000000a`82ed4230 0000001f`a42d2ff8 : webengine4!W3_MGD_APP_CONTEXT::OnApplicationResolveModules+0xef
0000000a`833acd20 00007ffa`462418bc : 00007ffa`4b555400 00007ffa`56272d58 00007ffa`46252750 0000000a`00000048 : webengine4!CMgdEngGlobalModule::OnGlobalApplicationResolveModules+0x6f
0000000a`833acd50 00007ffa`462411bd : 00000000`0000001f 00000000`00000400 0000000f`0000001f 00007ffa`4625276c : iiscore!VIRTUAL_MODULE::GlobalDoWork+0x38
0000000a`833acd80 00007ffa`4627cf9c : 0000001f`a42d34d8 00000000`00000000 0000001f`a42d2ff8 0000001f`a42d2ff0 : iiscore!W3_SERVER::GlobalNotify+0xeb
0000000a`833acdd0 00007ffa`46260c28 : 0000001f`a42d34d8 0000000a`83036830 0000001f`a4255708 00000000`00000002 : iiscore!W3_APPLICATION::ResolveModules+0x30
0000000a`833ace00 00007ffa`46243db9 : 00007ffa`462486e0 00007ffa`46259150 0000000a`833acee9 00007ffa`46241db0 : iiscore!W3_APPLICATION::SetupNotificationContext+0x199c8
0000000a`833ace70 00007ffa`462456b0 : 0000000f`9cacb810 00007ffa`00000001 00007ffa`00000000 0000000a`00000000 : iiscore!W3_CONTEXT::SetupStateMachinePhase2+0x289
0000000a`833acf50 00007ffa`46244f73 : 0000000f`9cacabe0 0000000f`9cacb810 0000000a`83036830 00007ffa`46244fd0 : iiscore!W3_CONTEXT::SetupStateMachine+0x6c0
0000000a`833afad0 00007ffa`46221551 : 00000000`00000000 0000000f`9cacabc0 00000000`0000072c 00000000`0000072c : iiscore!W3_MAIN_CONTEXT::OnNewRequest+0x253
0000000a`833afb10 00007ffa`4c1d1d2d : 0000000a`824989e0 00007ffa`46221590 00007ffa`4c1d0000 00000000`00000000 : w3dt!WP_CONTEXT::OnCompletion+0xf4
0000000a`833afb50 00007ffa`4c1d1c43 : 00000000`0000072c 0000000f`9cacb7e0 00007ffa`46221590 00007ffa`4c1d0000 : w3tp!THREAD_POOL_DATA::ThreadPoolThread+0xcd
0000000a`833afbd0 00007ffa`4c1d1bca : 00000000`00000000 0000000a`82455350 0000000a`82455350 00007ffa`4c1d0000 : w3tp!THREAD_POOL_DATA::ThreadPoolThread+0x33
0000000a`833afc10 00007ffa`5e2e13f2 : 00007ffa`4c1d1b80 00000000`00000000 0000000a`82455350 00000000`00000000 : w3tp!THREAD_MANAGER::ThreadManagerThread+0x4a
0000000a`833afc50 00007ffa`5e6b54f4 : 00007ffa`5e2e13d0 00000000`00000000 00000000`00000000 00000000`00000000 : kernel32!BaseThreadInitThunk+0x22
0000000a`833afc80 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!RtlUserThreadStart+0x34


STACK_COMMAND:  ~8s ; .cxr ; kb

SYMBOL_NAME:  clr!CExecutionEngine::ClrVirtualFree+42

MODULE_NAME: clr

IMAGE_NAME:  clr.dll

BUCKET_ID_MODPRIVATE: 1

FAILURE_BUCKET_ID:  APPLICATION_HANG_BusyHang_80000007_clr.dll!CExecutionEngine::ClrVirtualFree

OS_VERSION:  6.3.9600.18217

BUILDLAB_STR:  winblue_ltsb

OSPLATFORM_TYPE:  x64

OSNAME:  Windows 8.1

FAILURE_ID_HASH:  {f201a3f3-cb70-4897-4b1c-903ac417b51f}

Followup:     MachineOwner
---------

0:000> !DumpClass /d 00007ff9f01b4630
Class Name:      System.Linq.Expressions.Compiler.LambdaCompiler
mdToken:         0000000002000280
File:            C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll
Parent Class:    00007ffa3d0c2f68
Module:          00007ff9eed60020
Method Table:    00007ff9f01ac5e0
Vtable Slots:    4
Total Method Slots:  6
Class Attributes:    100100  
Transparency:        Transparent
NumInstanceFields:   d
NumStaticFields:     1
              MT    Field   Offset                 Type VT     Attr            Value Name
00007ff9f01ac7d8  4000b62        8 ...iler.AnalyzedTree  0 instance           _tree
00007ffa3d119a80  4000b63       10 ....Emit.ILGenerator  0 instance           _ilg
00007ffa3d0da1e8  4000b64       18 ....Emit.TypeBuilder  0 instance           _typeBuilder
00007ffa3d162330  4000b65       20 ...ection.MethodInfo  0 instance           _method
00007ff9f01d5b10  4000b66       28 ...er.LabelScopeInfo  0 instance           _labelBlock
00007ff9f01d5ed8  4000b67       30 ...fo, System.Core]]  0 instance           _labelInfo
00007ff9f01cad18  4000b68       38 ...ler.CompilerScope  0 instance           _scope
00007ff9efd63b38  4000b69       40 ....LambdaExpression  0 instance           _lambda
00007ffa3d0eb698  4000b6a       60       System.Boolean  1 instance           _hasClosureArgument
00007ff9f01cb158  4000b6b       48 ...er.BoundConstants  0 instance           _boundConstants
00007ff9f01d68d8  4000b6c       50 ...ilder, mscorlib]]  0 instance           _freeLocals
00007ffa3d0eb698  4000b6d       61       System.Boolean  1 instance           _sequencePointCleared
00007ff9f01c8588  4000b6e       58 ...ssions.StackGuard  0 instance           _guard
00007ffa3d0e85a0  4000b6f      520         System.Int32  1   shared           static _Counter
                                 >> Domain:Value  0000000a83ba7120:NotInit  0000000f923e1a20:NotInit  0000001fa92d2ee0:NotInit  0000001fb3d96ed0:NotInit  <<
0:000> !DumpMD /d 00007ff9f01abcb8
Method Name:  System.Linq.Expressions.Compiler.LambdaCompiler.Compile(System.Linq.Expressions.LambdaExpression, System.Runtime.CompilerServices.DebugInfoGenerator)
Class:        00007ff9f01b4630
MethodTable:  00007ff9f01ac5e0
mdToken:      000000000600172d
Module:       00007ff9eed60020
IsJitted:     yes
CodeAddr:     00007ff9efcbb940
Transparency: Transparent
0:000> !DumpMD /d 00007ffa0325b848
Method Name:  SimpleInjector.Advanced.DefaultExpressionCompilationBehavior.Compile(System.Linq.Expressions.Expression)
Class:        00007ffa03247c20
MethodTable:  00007ffa0325b858
mdToken:      00000000060007e0
Module:       00007ffa019f96d0
IsJitted:     yes
CodeAddr:     00007ffa0316f7e0
Transparency: Critical
0:000> !DumpMD /d 00007ffa0325b848
Method Name:  SimpleInjector.Advanced.DefaultExpressionCompilationBehavior.Compile(System.Linq.Expressions.Expression)
Class:        00007ffa03247c20
MethodTable:  00007ffa0325b858
mdToken:      00000000060007e0
Module:       00007ffa019f96d0
IsJitted:     yes
CodeAddr:     00007ffa0316f7e0
Transparency: Critical

cblaze22 avatar Jun 30 '21 19:06 cblaze22

The exception seems to be thrown by System.Linq.Expressions.Compiler.LambdaCompiler.Compile. Do you have more exception details, such as exception type and exception message?

dotnetjunkie avatar Jun 30 '21 19:06 dotnetjunkie

Is there a command I can put in WinDb to get that? All I used was !analyze -v. This issue was reported by LeanSentry.

cblaze22 avatar Jun 30 '21 20:06 cblaze22

I'm not that familiar with windbg. Can't help you with that.

dotnetjunkie avatar Jun 30 '21 20:06 dotnetjunkie

Ok let me dig deeper

cblaze22 avatar Jun 30 '21 20:06 cblaze22

The issue you are having sounds familiar, but the last time issues like these were reporting were when Dynamic Assembly Compilation (DAC) was on by default. For more details, see #274. From the stack trace, however, it seems you have DAC turned off. Perhaps there is another tool that uses DAC, which corrupts the IIS process, which also impacts Simple Injector?

dotnetjunkie avatar Jul 14 '21 20:07 dotnetjunkie

It says Options.EnableDynamicAssemblyCompilation is obsolete. So should it still be used?

cblaze22 avatar Jul 14 '21 21:07 cblaze22

Setting that property has no effect any longer. To enable DAC, you need to pull in the SimpleInjector.DynamicAssemblyCompilatipn NuGet. If you're not using that extra NuGet, you're not using DAC on Simple Injector. Other libraries, however, might still do DAC.

dotnetjunkie avatar Jul 14 '21 21:07 dotnetjunkie

In the past, these kinds of issues would typically occur when Simple Injector's dynamic compilation feature was used in combination with tools like:

  • Microsoft IntelliTrace
  • JetBrains dotTrace
  • Microsoft's test runner (MSTest)
  • TestDriven.NET
  • .NET profiling API (which seems what all the above tools rely on)

Simple Injector's Dynamic Assembly Compilation feature has been disabled by default since version 3.3 and after that point error reports stopped.

I remember seeing these crashes happen once or twice in combination with IIS recycling an app domain, but I believe this was still in combination with other tooling. Did anything change on your server before you experienced the first crash of this kind? Was any kind of monitoring tooling installed that might interact with the app domain? Profiling tooling perhaps?

Also consider the following issues, because they might be related:

  • https://github.com/dotnet/runtime/issues/10275
  • https://github.com/dotnet/efcore/issues/11543

dotnetjunkie avatar Nov 01 '21 10:11 dotnetjunkie

Are you sure its calling a DAC path because the screenshot below starts at the .Verify method. Seems that is a normal default thing to do.

image

cblaze22 avatar Nov 01 '21 13:11 cblaze22

Are you sure its calling a DAC

No, I'm pretty sure that your code doesn't use DAC as it is using the DefaultExpressionCompilationBehavior, which simply calls System.Linq.Expressions.Compiler.LambaCompiler.Compile. This uses Lightweight Code Generation (LCG) (a.k.a. dynamic methods), which is different from Dynamic Assembly Compilation (although both can be achieved through the Expression API).

my experience is that LCG does usually not cause the issues you are having, but there are exceptions, as the previous Microsoft issues show.

dotnetjunkie avatar Nov 01 '21 14:11 dotnetjunkie