dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.38k stars 4.75k forks source link

EE suspension for sampling profiler failed to complete #12184

Closed cshung closed 4 years ago

cshung commented 5 years ago

Symptom:

When debugging a test case with an aggresive printing breakpoint set, the debuggee deadlocks.

Repro (x86, debug)

Run the test case in dotnet/runtime#12180 with WinDBG attached and set this aggressively logging breakpoint bm CoreCLR!EventPipeBufferList::InsertTail "k;g". It will stop and deadlock.

Analysis

It appears that the EE suspension triggered in thread 6 will not complete because thread 9 is waiting on the LoaderHeap lock while it is held by thread 0 which is already suspended.

@janvorli, can you please take a look?

Stacks

0:012> ~*k

   0  Id: 6bfe4.6d4fc Suspend: 1 Teb: 00262000 Unfrozen
 # ChildEBP RetAddr  
00 00574f2c 761a00a9 ntdll!NtWaitForSingleObject+0xc [minkernel\ntdll\wow6432\objfre\i386\usrstubs.asm @ 129] 
01 00574fa0 0f509f2b KERNELBASE!WaitForSingleObjectEx+0x99 [minkernel\kernelbase\synch.c @ 1328] 
02 00574fb4 0f50cfec CoreCLR!CLREventWaitHelper2+0x1b [c:\dev\coreclr\src\vm\synch.cpp @ 378] 
03 00574ffc 0f509fab CoreCLR!`CLREventWaitHelper'::`3'::__Body::Run+0x7c [c:\dev\coreclr\src\vm\synch.cpp @ 402] 
04 00575058 0f50e684 CoreCLR!CLREventWaitHelper+0x7b [c:\dev\coreclr\src\vm\synch.cpp @ 404] 
05 00575124 0f50d579 CoreCLR!CLREventBase::WaitEx+0x324 [c:\dev\coreclr\src\vm\synch.cpp @ 471] 
06 00575140 0fc0e153 CoreCLR!CLREventBase::Wait+0x39 [c:\dev\coreclr\src\vm\synch.cpp @ 418] 
07 00575158 0fc0e0ff CoreCLR!GCEvent::Impl::Wait+0x43 [c:\dev\coreclr\src\vm\gcenv.os.cpp @ 847] 
08 0057516c 0fc108ba CoreCLR!GCEvent::Wait+0x3f [c:\dev\coreclr\src\vm\gcenv.os.cpp @ 925] 
09 00575184 0f4c7f05 CoreCLR!WKS::GCHeap::WaitUntilGCComplete+0x6a [c:\dev\coreclr\src\gc\gcee.cpp @ 404] 
0a 00575254 0f3d9f53 CoreCLR!Thread::RareDisablePreemptiveGC+0x355 [c:\dev\coreclr\src\vm\threadsuspend.cpp @ 2794] 
0b 00575264 0f48f5ea CoreCLR!Thread::DisablePreemptiveGC+0xb3 [c:\dev\coreclr\src\vm\threads.h @ 2079] 
0c 00575290 0f5df1f3 CoreCLR!GCHolderBase::EnterInternalCoop_HackNoThread+0x10a [c:\dev\coreclr\src\vm\threads.h @ 5655] 
0d 005752b4 0f990891 CoreCLR!GCCoopHackNoThread::GCCoopHackNoThread+0x33 [c:\dev\coreclr\src\vm\threads.h @ 5885] 
0e 005753d0 0f4a81a3 CoreCLR!HashMap::LookupValue+0x181 [c:\dev\coreclr\src\vm\hash.cpp @ 554] 
0f 005753ec 0f859f51 CoreCLR!PtrHashMap::LookupValue+0x53 [c:\dev\coreclr\src\vm\hash.h @ 598] 
10 00575488 0f40efad CoreCLR!ReadyToRunInfo::GetMethodDescForEntryPoint+0x121 [c:\dev\coreclr\src\vm\readytoruninfo.cpp @ 62] 
11 0057554c 0f64070b CoreCLR!ReadyToRunJitManager::JitCodeToMethodInfo+0x1ed [c:\dev\coreclr\src\vm\codeman.cpp @ 6976] 
12 005755f0 0f5b6dc8 CoreCLR!EECodeInfo::Init+0x15b [c:\dev\coreclr\src\vm\jitinterface.cpp @ 14046] 
13 00575684 0f5b62c9 CoreCLR!StackFrameIterator::ProcessIp+0x118 [c:\dev\coreclr\src\vm\stackwalk.cpp @ 2788] 
14 00575710 0f5b5cdb CoreCLR!StackFrameIterator::PostProcessingForManagedFrames+0x149 [c:\dev\coreclr\src\vm\stackwalk.cpp @ 3212] 
15 005757f8 0f5b53c0 CoreCLR!StackFrameIterator::NextRaw+0x8ab [c:\dev\coreclr\src\vm\stackwalk.cpp @ 2587] 
16 00575820 0f5b7c6c CoreCLR!StackFrameIterator::Next+0x70 [c:\dev\coreclr\src\vm\stackwalk.cpp @ 1605] 
17 00575ad8 0f5b7a93 CoreCLR!Thread::StackWalkFramesEx+0x1bc [c:\dev\coreclr\src\vm\stackwalk.cpp @ 956] 
18 00575e1c 0f7c0462 CoreCLR!Thread::StackWalkFrames+0x2c3 [c:\dev\coreclr\src\vm\stackwalk.cpp @ 1034] 
19 00575ee4 0f7c0224 CoreCLR!EventPipe::WalkManagedStackForThread+0x1e2 [c:\dev\coreclr\src\vm\eventpipe.cpp @ 875] 
1a 00575f78 0fb35a9e CoreCLR!EventPipe::WalkManagedStackForCurrentThread+0x124 [c:\dev\coreclr\src\vm\eventpipe.cpp @ 852] 
1b 0057602c 0fc96e26 CoreCLR!EventPipeEventInstance::EventPipeEventInstance+0x25e [c:\dev\coreclr\src\vm\eventpipeeventinstance.cpp @ 65] 
1c 00576168 0fb3f51b CoreCLR!EventPipeBuffer::WriteEvent+0x2e6 [c:\dev\coreclr\src\vm\eventpipebuffer.cpp @ 78] 
1d 0057624c 0f7c0f51 CoreCLR!EventPipeBufferManager::WriteEvent+0x2fb [c:\dev\coreclr\src\vm\eventpipebuffermanager.cpp @ 360] 
1e 005766bc 0f7c0618 CoreCLR!EventPipe::WriteEventInternal+0x231 [c:\dev\coreclr\src\vm\eventpipe.cpp @ 771] 
1f 00576764 0fdcd357 CoreCLR!EventPipe::WriteEvent+0x138 [c:\dev\coreclr\src\vm\eventpipe.cpp @ 720] 
20 005767c4 0fea6cb8 CoreCLR!EventPipeWriteEventAllocRequest+0x167 [c:\dev\coreclr\bin\obj\windows_nt.x86.debug\eventing\eventpipe\eventpipe\dotnetruntimeprivate.cpp @ 6526] 
21 005767f0 0fea6c22 CoreCLR!FireEtwAllocRequest+0x28 [c:\dev\coreclr\bin\obj\windows_nt.x86.debug\src\inc\clretwallmain.h @ 5366] 
22 00576814 0feaa2b2 CoreCLR!`anonymous namespace'::EtwAllocRequest+0x22 [c:\dev\coreclr\src\utilcode\loaderheap.cpp @ 39] 
23 005769ac 0fea9485 CoreCLR!UnlockedLoaderHeap::UnlockedAllocMem_NoThrow+0x692 [c:\dev\coreclr\src\utilcode\loaderheap.cpp @ 1388] 
24 00576ae4 0f413895 CoreCLR!UnlockedLoaderHeap::UnlockedAllocMem+0x335 [c:\dev\coreclr\src\utilcode\loaderheap.cpp @ 1266] 
25 00576b34 0f41382e CoreCLR!LoaderHeap::RealAllocMemUnsafe+0x55 [c:\dev\coreclr\src\inc\loaderheap.h @ 565] 
26 00576b50 0fa60f3b CoreCLR!LoaderHeap::RealAllocMem+0x3e [c:\dev\coreclr\src\inc\loaderheap.h @ 520] 
27 00576c08 0fa76bb7 CoreCLR!MethodTableBuilder::AllocateFromLowFrequencyHeap+0x13b [c:\dev\coreclr\src\vm\methodtablebuilder.cpp @ 11630] 
28 00576d08 0fa5ffc4 CoreCLR!MethodTableBuilder::InitNewMethodDesc+0x2f7 [c:\dev\coreclr\src\vm\methodtablebuilder.cpp @ 5061] 
29 00576df8 0fa603c5 CoreCLR!MethodTableBuilder::AllocAndInitMethodDescChunk+0x2d4 [c:\dev\coreclr\src\vm\methodtablebuilder.cpp @ 6850] 
2a 00576eac 0fa645d2 CoreCLR!MethodTableBuilder::AllocAndInitMethodDescs+0x2b5 [c:\dev\coreclr\src\vm\methodtablebuilder.cpp @ 6785] 
2b 00577ec4 0fa6ab7b CoreCLR!MethodTableBuilder::BuildMethodTableThrowing+0x1752 [c:\dev\coreclr\src\vm\methodtablebuilder.cpp @ 1661] 
2c 005782e4 0f5e6e38 CoreCLR!ClassLoader::CreateTypeHandleForTypeDefThrowing+0x12eb [c:\dev\coreclr\src\vm\methodtablebuilder.cpp @ 12175] 
2d 00578520 0f5e7fa4 CoreCLR!ClassLoader::CreateTypeHandleForTypeKey+0x368 [c:\dev\coreclr\src\vm\clsload.cpp @ 3340] 
2e 005786d4 0f5f53e1 CoreCLR!ClassLoader::DoIncrementalLoad+0x464 [c:\dev\coreclr\src\vm\clsload.cpp @ 3268] 
2f 005788ec 0f5f431e CoreCLR!ClassLoader::LoadTypeHandleForTypeKey_Body+0xa71 [c:\dev\coreclr\src\vm\clsload.cpp @ 4030] 
30 00578a60 0f5f3e62 CoreCLR!ClassLoader::LoadTypeHandleForTypeKey+0x39e [c:\dev\coreclr\src\vm\clsload.cpp @ 3756] 
31 00578d54 0f5f300c CoreCLR!ClassLoader::LoadTypeDefThrowing+0xd52 [c:\dev\coreclr\src\vm\clsload.cpp @ 2644] 
32 00578f78 0f5eeeda CoreCLR!ClassLoader::LoadTypeDefOrRefThrowing+0x9ec [c:\dev\coreclr\src\vm\clsload.cpp @ 2816] 
33 00579110 0f5ee6e6 CoreCLR!ClassLoader::LoadApproxTypeThrowing+0x72a [c:\dev\coreclr\src\vm\clsload.cpp @ 3159] 
34 005791d4 0fa69fb5 CoreCLR!ClassLoader::LoadApproxParentThrowing+0x1e6 [c:\dev\coreclr\src\vm\clsload.cpp @ 3213] 
35 005795d8 0f5e6e38 CoreCLR!ClassLoader::CreateTypeHandleForTypeDefThrowing+0x725 [c:\dev\coreclr\src\vm\methodtablebuilder.cpp @ 11912] 
36 00579814 0f5e7fa4 CoreCLR!ClassLoader::CreateTypeHandleForTypeKey+0x368 [c:\dev\coreclr\src\vm\clsload.cpp @ 3340] 
37 005799c8 0f5f53e1 CoreCLR!ClassLoader::DoIncrementalLoad+0x464 [c:\dev\coreclr\src\vm\clsload.cpp @ 3268] 
38 00579be0 0f5f431e CoreCLR!ClassLoader::LoadTypeHandleForTypeKey_Body+0xa71 [c:\dev\coreclr\src\vm\clsload.cpp @ 4030] 
39 00579d54 0f5f3e62 CoreCLR!ClassLoader::LoadTypeHandleForTypeKey+0x39e [c:\dev\coreclr\src\vm\clsload.cpp @ 3756] 
3a 0057a048 0f5f300c CoreCLR!ClassLoader::LoadTypeDefThrowing+0xd52 [c:\dev\coreclr\src\vm\clsload.cpp @ 2644] 
3b 0057a26c 0f8041cd CoreCLR!ClassLoader::LoadTypeDefOrRefThrowing+0x9ec [c:\dev\coreclr\src\vm\clsload.cpp @ 2816] 
3c 0057a590 0fa9e48d CoreCLR!SigPointer::GetTypeHandleThrowing+0x129d [c:\dev\coreclr\src\vm\siginfo.cpp @ 1500] 
3d 0057a664 0f641a02 CoreCLR!ZapSig::DecodeType+0x16d [c:\dev\coreclr\src\vm\zapsig.cpp @ 810] 
3e 0057a830 0f6950e0 CoreCLR!LoadDynamicInfoEntry+0x202 [c:\dev\coreclr\src\vm\jitinterface.cpp @ 13290] 
3f 0057a90c 0f6c5f30 CoreCLR!Module::FixupNativeEntry+0x240 [c:\dev\coreclr\src\vm\ceeload.cpp @ 10603] 
40 0057aa74 0f6ca7d2 CoreCLR!Module::FixupDelayListAux<Module *,int (__thiscall Module::*)(CORCOMPILE_IMPORT_SECTION *,unsigned long,unsigned long *)>+0x450 [c:\dev\coreclr\src\vm\ceeload.inl @ 608] 
41 0057aaa8 0f8598de CoreCLR!Module::FixupDelayList+0x62 [c:\dev\coreclr\src\vm\ceeload.inl @ 512] 
42 0057abbc 0f6cc4eb CoreCLR!ReadyToRunInfo::GetEntryPoint+0x3de [c:\dev\coreclr\src\vm\readytoruninfo.cpp @ 745] 
43 0057ac5c 0f6cbf3c CoreCLR!MethodDesc::GetPrecompiledR2RCode+0x17b [c:\dev\coreclr\src\vm\prestub.cpp @ 529] 
44 0057acf4 0f6cfe36 CoreCLR!MethodDesc::GetPrecompiledCode+0x16c [c:\dev\coreclr\src\vm\prestub.cpp @ 413] 
45 0057ad98 0f6cfa3d CoreCLR!MethodDesc::PrepareILBasedCode+0x166 [c:\dev\coreclr\src\vm\prestub.cpp @ 370] 
46 0057ae28 0f6d00c6 CoreCLR!MethodDesc::PrepareCode+0x17d [c:\dev\coreclr\src\vm\prestub.cpp @ 360] 
47 0057aee0 0f6c8c5f CoreCLR!MethodDesc::PrepareInitialCode+0x176 [c:\dev\coreclr\src\vm\prestub.cpp @ 316] 
48 0057b058 0f6d3336 CoreCLR!MethodDesc::DoPrestub+0x7cf [c:\dev\coreclr\src\vm\prestub.cpp @ 1893] 
49 0057b1c0 0f478b8b CoreCLR!PreStubWorker+0x336 [c:\dev\coreclr\src\vm\prestub.cpp @ 1649] 
4a 0057b1e4 3097a220 CoreCLR!ThePreStub+0x11 [C:\Dev\coreclr\src\vm\i386\asmhelpers.asm @ 1672] 
4b 0057b248 30959917 System_Private_CoreLib!System.Reflection.RuntimeAssembly.GetManifestResourceStream(System.Type, System.String)+0x13c
4c 0057b284 30958baa System_Private_CoreLib!System.Resources.ManifestBasedResourceGroveler.GetManifestResourceStream(System.Reflection.Assembly, System.String)+0x87
4d 0057b344 3095c9df System_Private_CoreLib!System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(System.Globalization.CultureInfo, System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceSet>, Boolean, Boolean)+0x282
4e 0057b410 3095d21d System_Private_CoreLib!System.Resources.ResourceManager.InternalGetResourceSet(System.Globalization.CultureInfo, Boolean, Boolean)+0x27b
4f 0057b4dc 307b8012 System_Private_CoreLib!System.Resources.ResourceManager.GetString(System.String, System.Globalization.CultureInfo)+0x205
50 0057b5c0 307b7bbd System_Private_CoreLib!System.SR.InternalGetResourceString(System.String)+0x3ea
51 0057b600 307b7b7b System_Private_CoreLib!System.SR.GetResourceString(System.String, System.String)+0x2d
52 0057b614 30a73e19 System_Private_CoreLib!System.SR.GetResourceString(System.String)+0x23
53 0057b630 30a6d295 System_Private_CoreLib!System.Diagnostics.Tracing.Resources.GetResourceString(System.String, System.Object[])+0x21
54 0057b6bc 30a6f976 System_Private_CoreLib!System.Diagnostics.Tracing.ManifestBuilder.GetTypeNameHelper(System.Type)+0x2d5
55 0057b704 30a6e768 System_Private_CoreLib!System.Diagnostics.Tracing.ManifestBuilder.GetTypeName(System.Type)+0xd6
56 0057b804 30a6771d System_Private_CoreLib!System.Diagnostics.Tracing.ManifestBuilder.AddEventParameter(System.Type, System.String)+0x200
57 0057bce4 30a650cd System_Private_CoreLib!System.Diagnostics.Tracing.EventSource.CreateManifestAndDescriptors(System.Type, System.String, System.Diagnostics.Tracing.EventSource, System.Diagnostics.Tracing.EventManifestOptions)+0x1541
58 0057bde4 30a64422 System_Private_CoreLib!System.Diagnostics.Tracing.EventSource.EnsureDescriptorsInitialized()+0x16d
59 0057bf7c 30a60bad System_Private_CoreLib!System.Diagnostics.Tracing.EventSource.DoCommand(System.Diagnostics.Tracing.EventCommandEventArgs)+0xe2
5a 0057c064 30a5dc88 System_Private_CoreLib!System.Diagnostics.Tracing.EventSource.Initialize(System.Guid, System.String, System.String[])+0x4cd
5b 0057c0e0 30a5db4a System_Private_CoreLib!System.Diagnostics.Tracing.EventSource..ctor(System.Diagnostics.Tracing.EventSourceSettings, System.String[])+0x134
5c 0057c0f4 30a5dab1 System_Private_CoreLib!System.Diagnostics.Tracing.EventSource..ctor(System.Diagnostics.Tracing.EventSourceSettings)+0x1a
5d 0057c100 0a4e24ad System_Private_CoreLib!System.Diagnostics.Tracing.EventSource..ctor()+0x15
5e 0057c110 0a4e2465 tracecontrol!Tracing.Tests.SimpleEventSource..ctor()+0x25 [C:\Dev\coreclr\tests\src\tracing\tracecontrol\TraceControl.cs @ 29] 
5f 0057c11c 0f4787f1 tracecontrol!Tracing.Tests.SimpleEventSource..cctor()+0x2d [C:\Dev\coreclr\tests\src\tracing\tracecontrol\TraceControl.cs @ 23] 
60 0057c128 0f83a911 CoreCLR!CallDescrWorkerInternal+0x34 [C:\Dev\coreclr\src\vm\i386\asmhelpers.asm @ 612] 
61 0057c544 0f83ab95 CoreCLR!CallDescrWorker+0x121 [c:\dev\coreclr\src\vm\callhelpers.cpp @ 129] 
62 0057c5ec 0f83bd66 CoreCLR!CallDescrWorkerWithHandler+0x205 [c:\dev\coreclr\src\vm\callhelpers.cpp @ 72] 
63 0057c630 0f83b9e4 CoreCLR!`DispatchCallDebuggerWrapper'::`3'::__Body::Run+0x76 [c:\dev\coreclr\src\vm\callhelpers.cpp @ 164] 
64 0057c688 0f83bc10 CoreCLR!DispatchCallDebuggerWrapper+0x74 [c:\dev\coreclr\src\vm\callhelpers.cpp @ 164] 
65 0057c744 0f8ac413 CoreCLR!DispatchCallSimple+0x190 [c:\dev\coreclr\src\vm\callhelpers.cpp @ 224] 
66 0057c8e0 0f89815d CoreCLR!MethodTable::RunClassInitEx+0x453 [c:\dev\coreclr\src\vm\methodtable.cpp @ 3303] 
67 0057d394 0f893c15 CoreCLR!MethodTable::DoRunClassInitThrowing+0x87d [c:\dev\coreclr\src\vm\methodtable.cpp @ 3536] 
68 0057d474 0f635b35 CoreCLR!MethodTable::CheckRunClassInitThrowing+0x345 [c:\dev\coreclr\src\vm\methodtable.cpp @ 3691] 
69 0057d5a0 0f635e5f CoreCLR!JIT_GetSharedNonGCStaticBase_Helper+0x265 [c:\dev\coreclr\src\vm\jithelpers.cpp @ 1449] 
6a 0057d5f8 006835eb CoreCLR!JIT_GetSharedNonGCStaticBase_Portable+0x11f [c:\dev\coreclr\src\vm\jithelpers.cpp @ 1363] 
WARNING: Frame IP not in any known module. Following frames may be wrong.
6b 0057d604 0a4e1d0e 0x6835eb
6c 0057d74c 0f4787f1 tracecontrol!Tracing.Tests.TraceControlTest.Main(System.String[])+0x5e [C:\Dev\coreclr\tests\src\tracing\tracecontrol\TraceControl.cs @ 57] 
6d 0057d758 0f83a911 CoreCLR!CallDescrWorkerInternal+0x34 [C:\Dev\coreclr\src\vm\i386\asmhelpers.asm @ 612] 
6e 0057db74 0f83ab95 CoreCLR!CallDescrWorker+0x121 [c:\dev\coreclr\src\vm\callhelpers.cpp @ 129] 
6f 0057dc20 0f83b454 CoreCLR!CallDescrWorkerWithHandler+0x205 [c:\dev\coreclr\src\vm\callhelpers.cpp @ 72] 
70 0057df50 0f4d89de CoreCLR!MethodDescCallSite::CallTargetWorker+0x874 [c:\dev\coreclr\src\vm\callhelpers.cpp @ 607] 
71 0057dfe0 0f506d9f CoreCLR!MethodDescCallSite::Call_RetArgSlot+0xce [c:\dev\coreclr\src\vm\callhelpers.h @ 472] 
72 0057e0c8 0f506ef0 CoreCLR!``RunMain'::`29'::__Body::Run'::`5'::__Body::Run+0x1bf [c:\dev\coreclr\src\vm\assembly.cpp @ 1581] 
73 0057e128 0f5070ca CoreCLR!`RunMain'::`29'::__Body::Run+0xa0 [c:\dev\coreclr\src\vm\assembly.cpp @ 1592] 
74 0057e1a0 0f4fcd78 CoreCLR!RunMain+0x15a [c:\dev\coreclr\src\vm\assembly.cpp @ 1592] 
75 0057e57c 0f3f155f CoreCLR!Assembly::ExecuteMainMethod+0x428 [c:\dev\coreclr\src\vm\assembly.cpp @ 1702] 
76 0057e710 011b1c7f CoreCLR!CorHost2::ExecuteAssembly+0x3ff [c:\dev\coreclr\src\vm\corhost.cpp @ 472] 
77 0057f818 011b2f5c CoreRun!TryRun+0xb0f [c:\dev\coreclr\src\coreclr\hosts\corerun\corerun.cpp @ 642] 
78 0057f878 0120ccbe CoreRun!wmain+0x10c [c:\dev\coreclr\src\coreclr\hosts\corerun\corerun.cpp @ 758] 
79 0057f88c 0120cba7 CoreRun!invoke_main+0x1e [d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 90] 
7a 0057f8e8 0120ca4d CoreRun!__scrt_common_main_seh+0x157 [d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 288] 
7b 0057f8f0 0120cd28 CoreRun!__scrt_common_main+0xd [d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 331] 
7c 0057f8f8 75ae0179 CoreRun!wmainCRTStartup+0x8 [d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_wmain.cpp @ 17] 
7d 0057f908 7757662d KERNEL32!BaseThreadInitThunk+0x19 [base\win32\client\thread.c @ 64] 
7e 0057f964 775765fd ntdll!__RtlUserThreadStart+0x2f [minkernel\ntdll\rtlstrt.c @ 1163] 
7f 0057f974 00000000 ntdll!_RtlUserThreadStart+0x1b [minkernel\ntdll\rtlstrt.c @ 1080] 

   1  Id: 6bfe4.6d00c Suspend: 1 Teb: 00265000 Unfrozen
 # ChildEBP RetAddr  
00 0085f8a4 7755e4c6 ntdll!NtWaitForWorkViaWorkerFactory+0xc [minkernel\ntdll\wow6432\objfre\i386\usrstubs.asm @ 3777] 
01 0085fa64 75ae0179 ntdll!TppWorkerThread+0x296 [minkernel\threadpool\ntdll\worker.c @ 910] 
02 0085fa74 7757662d KERNEL32!BaseThreadInitThunk+0x19 [base\win32\client\thread.c @ 64] 
03 0085fad0 775765fd ntdll!__RtlUserThreadStart+0x2f [minkernel\ntdll\rtlstrt.c @ 1163] 
04 0085fae0 00000000 ntdll!_RtlUserThreadStart+0x1b [minkernel\ntdll\rtlstrt.c @ 1080] 

   2  Id: 6bfe4.6cde4 Suspend: 1 Teb: 00268000 Unfrozen
 # ChildEBP RetAddr  
00 00b2f924 7755e4c6 ntdll!NtWaitForWorkViaWorkerFactory+0xc [minkernel\ntdll\wow6432\objfre\i386\usrstubs.asm @ 3777] 
01 00b2fae4 75ae0179 ntdll!TppWorkerThread+0x296 [minkernel\threadpool\ntdll\worker.c @ 910] 
02 00b2faf4 7757662d KERNEL32!BaseThreadInitThunk+0x19 [base\win32\client\thread.c @ 64] 
03 00b2fb50 775765fd ntdll!__RtlUserThreadStart+0x2f [minkernel\ntdll\rtlstrt.c @ 1163] 
04 00b2fb60 00000000 ntdll!_RtlUserThreadStart+0x1b [minkernel\ntdll\rtlstrt.c @ 1080] 

   3  Id: 6bfe4.6d21c Suspend: 1 Teb: 0026b000 Unfrozen
 # ChildEBP RetAddr  
00 00cefa7c 7755e4c6 ntdll!NtWaitForWorkViaWorkerFactory+0xc [minkernel\ntdll\wow6432\objfre\i386\usrstubs.asm @ 3777] 
01 00cefc3c 75ae0179 ntdll!TppWorkerThread+0x296 [minkernel\threadpool\ntdll\worker.c @ 910] 
02 00cefc4c 7757662d KERNEL32!BaseThreadInitThunk+0x19 [base\win32\client\thread.c @ 64] 
03 00cefca8 775765fd ntdll!__RtlUserThreadStart+0x2f [minkernel\ntdll\rtlstrt.c @ 1163] 
04 00cefcb8 00000000 ntdll!_RtlUserThreadStart+0x1b [minkernel\ntdll\rtlstrt.c @ 1080] 

   4  Id: 6bfe4.6e37c Suspend: 1 Teb: 0026e000 Unfrozen
 # ChildEBP RetAddr  
00 04c2f96c 761a2a03 ntdll!NtWaitForMultipleObjects+0xc [minkernel\ntdll\wow6432\objfre\i386\usrstubs.asm @ 825] 
01 04c2fb00 0ff27477 KERNELBASE!WaitForMultipleObjectsEx+0x133 [minkernel\kernelbase\synch.c @ 1551] 
02 04c2fc98 0ff297ee CoreCLR!DebuggerRCThread::MainLoop+0x5c7 [c:\dev\coreclr\src\debug\ee\rcthread.cpp @ 1137] 
03 04c2fdc8 0ff298d5 CoreCLR!DebuggerRCThread::ThreadProc+0x62e [c:\dev\coreclr\src\debug\ee\rcthread.cpp @ 943] 
04 04c2fdd4 75ae0179 CoreCLR!DebuggerRCThread::ThreadProcStatic+0x45 [c:\dev\coreclr\src\debug\ee\rcthread.cpp @ 1528] 
05 04c2fde4 7757662d KERNEL32!BaseThreadInitThunk+0x19 [base\win32\client\thread.c @ 64] 
06 04c2fe40 775765fd ntdll!__RtlUserThreadStart+0x2f [minkernel\ntdll\rtlstrt.c @ 1163] 
07 04c2fe50 00000000 ntdll!_RtlUserThreadStart+0x1b [minkernel\ntdll\rtlstrt.c @ 1080] 

   5  Id: 6bfe4.6e318 Suspend: 1 Teb: 00271000 Unfrozen
 # ChildEBP RetAddr  
00 06ddf30c 761a2a03 ntdll!NtWaitForMultipleObjects+0xc [minkernel\ntdll\wow6432\objfre\i386\usrstubs.asm @ 825] 
01 06ddf4a0 0f793789 KERNELBASE!WaitForMultipleObjectsEx+0x133 [minkernel\kernelbase\synch.c @ 1551] 
02 06ddf4d8 0f792d0d CoreCLR!FinalizerThread::WaitForFinalizerEvent+0x149 [c:\dev\coreclr\src\vm\finalizerthread.cpp @ 431] 
03 06ddf504 0f4e7fae CoreCLR!FinalizerThread::FinalizerThreadWorker+0xbd [c:\dev\coreclr\src\vm\finalizerthread.cpp @ 549] 
04 06ddf590 0f4e805d CoreCLR!ManagedThreadBase_DispatchInner+0x11e [c:\dev\coreclr\src\vm\threads.cpp @ 7779] 
05 06ddf69c 0f4ebd9f CoreCLR!ManagedThreadBase_DispatchMiddle+0x8d [c:\dev\coreclr\src\vm\threads.cpp @ 7824] 
06 06ddf6dc 0f4ebe99 CoreCLR!``ManagedThreadBase_DispatchOuter'::`8'::__Body::Run'::`5'::__Body::Run+0x6f [c:\dev\coreclr\src\vm\threads.cpp @ 8043] 
07 06ddf730 0f4e84c0 CoreCLR!`ManagedThreadBase_DispatchOuter'::`8'::__Body::Run+0x99 [c:\dev\coreclr\src\vm\threads.cpp @ 8043] 
08 06ddf79c 0f4e878d CoreCLR!ManagedThreadBase_DispatchOuter+0xc0 [c:\dev\coreclr\src\vm\threads.cpp @ 8065] 
09 06ddf844 0f4e000e CoreCLR!ManagedThreadBase_NoADTransition+0x13d [c:\dev\coreclr\src\vm\threads.cpp @ 8115] 
0a 06ddf854 0f79333e CoreCLR!ManagedThreadBase::FinalizerBase+0xe [c:\dev\coreclr\src\vm\threads.cpp @ 8141] 
0b 06ddf8a0 0f791ef6 CoreCLR!`FinalizerThread::FinalizerThreadStart'::`37'::__Body::Run+0xbe [c:\dev\coreclr\src\vm\finalizerthread.cpp @ 699] 
0c 06ddf904 0f4f343e CoreCLR!FinalizerThread::FinalizerThreadStart+0x186 [c:\dev\coreclr\src\vm\finalizerthread.cpp @ 768] 
0d 06ddf9b4 75ae0179 CoreCLR!Thread::intermediateThreadProc+0x8e [c:\dev\coreclr\src\vm\threads.cpp @ 2151] 
0e 06ddf9c4 7757662d KERNEL32!BaseThreadInitThunk+0x19 [base\win32\client\thread.c @ 64] 
0f 06ddfa20 775765fd ntdll!__RtlUserThreadStart+0x2f [minkernel\ntdll\rtlstrt.c @ 1163] 
10 06ddfa30 00000000 ntdll!_RtlUserThreadStart+0x1b [minkernel\ntdll\rtlstrt.c @ 1080] 

   6  Id: 6bfe4.6af60 Suspend: 1 Teb: 00274000 Unfrozen
 # ChildEBP RetAddr  
00 0753f760 761a00a9 ntdll!NtWaitForSingleObject+0xc [minkernel\ntdll\wow6432\objfre\i386\usrstubs.asm @ 129] 
01 0753f7d4 0f509f2b KERNELBASE!WaitForSingleObjectEx+0x99 [minkernel\kernelbase\synch.c @ 1328] 
02 0753f7e8 0f50cfec CoreCLR!CLREventWaitHelper2+0x1b [c:\dev\coreclr\src\vm\synch.cpp @ 378] 
03 0753f830 0f509fab CoreCLR!`CLREventWaitHelper'::`3'::__Body::Run+0x7c [c:\dev\coreclr\src\vm\synch.cpp @ 402] 
04 0753f88c 0f50e684 CoreCLR!CLREventWaitHelper+0x7b [c:\dev\coreclr\src\vm\synch.cpp @ 404] 
05 0753f958 0f50d579 CoreCLR!CLREventBase::WaitEx+0x324 [c:\dev\coreclr\src\vm\synch.cpp @ 471] 
06 0753f974 0f4ccab1 CoreCLR!CLREventBase::Wait+0x39 [c:\dev\coreclr\src\vm\synch.cpp @ 418] 
07 0753fb84 0f4cba43 CoreCLR!ThreadSuspend::SuspendRuntime+0xbc1 [c:\dev\coreclr\src\vm\threadsuspend.cpp @ 4450] 
08 0753fcac 0fb40da7 CoreCLR!ThreadSuspend::SuspendEE+0x263 [c:\dev\coreclr\src\vm\threadsuspend.cpp @ 6860] 
09 0753fda4 0f4f343e CoreCLR!SampleProfiler::ThreadProc+0x227 [c:\dev\coreclr\src\vm\sampleprofiler.cpp @ 185] 
0a 0753fed4 75ae0179 CoreCLR!Thread::intermediateThreadProc+0x8e [c:\dev\coreclr\src\vm\threads.cpp @ 2151] 
0b 0753fee4 7757662d KERNEL32!BaseThreadInitThunk+0x19 [base\win32\client\thread.c @ 64] 
0c 0753ff40 775765fd ntdll!__RtlUserThreadStart+0x2f [minkernel\ntdll\rtlstrt.c @ 1163] 
0d 0753ff50 00000000 ntdll!_RtlUserThreadStart+0x1b [minkernel\ntdll\rtlstrt.c @ 1080] 

   7  Id: 6bfe4.6bb8c Suspend: 1 Teb: 00277000 Unfrozen
 # ChildEBP RetAddr  
00 075ef8a4 76188feb ntdll!NtDelayExecution+0xc [minkernel\ntdll\wow6432\objfre\i386\usrstubs.asm @ 513] 
01 075ef90c 0fa3006d KERNELBASE!SleepEx+0x4b [minkernel\kernelbase\thread.c @ 2230] 
02 075ef9f4 0fa30321 CoreCLR!ThreadpoolMgr::TimerThreadFire+0x16d [c:\dev\coreclr\src\vm\win32threadpool.cpp @ 4602] 
03 075efa08 75ae0179 CoreCLR!ThreadpoolMgr::TimerThreadStart+0x81 [c:\dev\coreclr\src\vm\win32threadpool.cpp @ 4566] 
04 075efa18 7757662d KERNEL32!BaseThreadInitThunk+0x19 [base\win32\client\thread.c @ 64] 
05 075efa74 775765fd ntdll!__RtlUserThreadStart+0x2f [minkernel\ntdll\rtlstrt.c @ 1163] 
06 075efa84 00000000 ntdll!_RtlUserThreadStart+0x1b [minkernel\ntdll\rtlstrt.c @ 1080] 

   8  Id: 6bfe4.6df38 Suspend: 1 Teb: 0027a000 Unfrozen
 # ChildEBP RetAddr  
00 07ddf518 761a00a9 ntdll!NtWaitForSingleObject+0xc [minkernel\ntdll\wow6432\objfre\i386\usrstubs.asm @ 129] 
01 07ddf58c 0f509f2b KERNELBASE!WaitForSingleObjectEx+0x99 [minkernel\kernelbase\synch.c @ 1328] 
02 07ddf5a0 0f50cfec CoreCLR!CLREventWaitHelper2+0x1b [c:\dev\coreclr\src\vm\synch.cpp @ 378] 
03 07ddf5e8 0f509fab CoreCLR!`CLREventWaitHelper'::`3'::__Body::Run+0x7c [c:\dev\coreclr\src\vm\synch.cpp @ 402] 
04 07ddf644 0f50e684 CoreCLR!CLREventWaitHelper+0x7b [c:\dev\coreclr\src\vm\synch.cpp @ 404] 
05 07ddf710 0f50d579 CoreCLR!CLREventBase::WaitEx+0x324 [c:\dev\coreclr\src\vm\synch.cpp @ 471] 
06 07ddf72c 0fc0e153 CoreCLR!CLREventBase::Wait+0x39 [c:\dev\coreclr\src\vm\synch.cpp @ 418] 
07 07ddf744 0fc0e0ff CoreCLR!GCEvent::Impl::Wait+0x43 [c:\dev\coreclr\src\vm\gcenv.os.cpp @ 847] 
08 07ddf758 0fc108ba CoreCLR!GCEvent::Wait+0x3f [c:\dev\coreclr\src\vm\gcenv.os.cpp @ 925] 
09 07ddf770 0f4c7f05 CoreCLR!WKS::GCHeap::WaitUntilGCComplete+0x6a [c:\dev\coreclr\src\gc\gcee.cpp @ 404] 
0a 07ddf840 0f3d9f53 CoreCLR!Thread::RareDisablePreemptiveGC+0x355 [c:\dev\coreclr\src\vm\threadsuspend.cpp @ 2794] 
0b 07ddf850 0f3e6416 CoreCLR!Thread::DisablePreemptiveGC+0xb3 [c:\dev\coreclr\src\vm\threads.h @ 2079] 
0c 07ddf864 0f3e1fe6 CoreCLR!GCHolderBase::EnterInternalCoop+0xf6 [c:\dev\coreclr\src\vm\threads.h @ 5717] 
0d 07ddf88c 0f4e963b CoreCLR!GCCoop::GCCoop+0x36 [c:\dev\coreclr\src\vm\threads.h @ 5837] 
0e 07ddfa94 0f4dcc1c CoreCLR!Thread::OnThreadTerminate+0x22b [c:\dev\coreclr\src\vm\threads.cpp @ 2937] 
0f 07ddfbb8 0fa31c33 CoreCLR!DestroyThread+0x20c [c:\dev\coreclr\src\vm\threads.cpp @ 904] 
10 07ddfd44 0f4f343e CoreCLR!ThreadpoolMgr::WorkerThreadStart+0x973 [c:\dev\coreclr\src\vm\win32threadpool.cpp @ 2191] 
11 07ddfef0 75ae0179 CoreCLR!Thread::intermediateThreadProc+0x8e [c:\dev\coreclr\src\vm\threads.cpp @ 2151] 
12 07ddff00 7757662d KERNEL32!BaseThreadInitThunk+0x19 [base\win32\client\thread.c @ 64] 
13 07ddff5c 775765fd ntdll!__RtlUserThreadStart+0x2f [minkernel\ntdll\rtlstrt.c @ 1163] 
14 07ddff6c 00000000 ntdll!_RtlUserThreadStart+0x1b [minkernel\ntdll\rtlstrt.c @ 1080] 

   9  Id: 6bfe4.6e258 Suspend: 1 Teb: 00280000 Unfrozen
 # ChildEBP RetAddr  
00 09d4b038 77562014 ntdll!NtWaitForAlertByThreadId+0xc [minkernel\ntdll\wow6432\objfre\i386\usrstubs.asm @ 3753] 
01 09d4b058 77561f56 ntdll!RtlpWaitOnAddressWithTimeout+0x33 [minkernel\ntos\rtl\waitaddr.c @ 817] 
02 09d4b09c 77561e4b ntdll!RtlpWaitOnAddress+0xa5 [minkernel\ntos\rtl\waitaddr.c @ 1071] 
03 09d4b0d8 7755ff16 ntdll!RtlpWaitOnCriticalSection+0xac [minkernel\ntos\rtl\resource.c @ 1568] 
04 09d4b100 7755fe39 ntdll!RtlpEnterCriticalSectionContended+0xd6 [minkernel\ntos\rtl\resource.c @ 2265] 
05 09d4b108 0f4499cd ntdll!RtlEnterCriticalSection+0x49 [minkernel\ntos\rtl\resource.c @ 1881] 
06 09d4b114 0f448586 CoreCLR!UnsafeEnterCriticalSection+0xd [c:\dev\coreclr\src\inc\unsafe.h @ 20] 
07 09d4b158 0f47f075 CoreCLR!CrstBase::Enter+0x216 [c:\dev\coreclr\src\vm\crst.cpp @ 316] 
08 09d4b1e4 0f3ed2fc CoreCLR!EEEnterCriticalSection+0x135 [c:\dev\coreclr\src\vm\hosting.cpp @ 760] 
09 09d4b1f0 0f379f23 CoreCLR!CExecutionEngine::AcquireLock+0xc [c:\dev\coreclr\src\vm\corhost.cpp @ 2870] 
0a 09d4b208 0f3ccbb2 CoreCLR!ClrEnterCriticalSection+0x33 [c:\dev\coreclr\src\utilcode\clrhost_nodependencies.cpp @ 757] 
0b 09d4b218 0f3cc19c CoreCLR!FunctionBase<void *,&ClrEnterCriticalSection,&ClrLeaveCriticalSection>::DoAcquire+0x12 [c:\dev\coreclr\src\inc\holder.h @ 715] 
0c 09d4b224 0f3cb8b1 CoreCLR!BaseHolder<void *,FunctionBase<void *,&ClrEnterCriticalSection,&ClrLeaveCriticalSection>,0,&CompareDefault<void *> >::Acquire+0x3c [c:\dev\coreclr\src\inc\holder.h @ 288] 
0d 09d4b230 0f3cb992 CoreCLR!BaseHolder<void *,FunctionBase<void *,&ClrEnterCriticalSection,&ClrLeaveCriticalSection>,0,&CompareDefault<void *> >::BaseHolder<void *,FunctionBase<void *,&ClrEnterCriticalSection,&ClrLeaveCriticalSection>,0,&CompareDefault<void *> >+0x31 [c:\dev\coreclr\src\inc\holder.h @ 255] 
0e 09d4b250 0f413877 CoreCLR!Holder<void *,&ClrEnterCriticalSection,&ClrLeaveCriticalSection,0,&CompareDefault<void *>,1>::Holder<void *,&ClrEnterCriticalSection,&ClrLeaveCriticalSection,0,&CompareDefault<void *>,1>+0x32 [c:\dev\coreclr\src\inc\holder.h @ 749] 
0f 09d4b298 0f41382e CoreCLR!LoaderHeap::RealAllocMemUnsafe+0x37 [c:\dev\coreclr\src\inc\loaderheap.h @ 564] 
10 09d4b2b4 0fa8cea5 CoreCLR!LoaderHeap::RealAllocMem+0x3e [c:\dev\coreclr\src\inc\loaderheap.h @ 520] 
11 09d4b378 0fa91b13 CoreCLR!NgenHashTable<EETypeHashTable,EETypeHashEntry,2>::BaseAllocateEntry+0x155 [c:\dev\coreclr\src\vm\ngenhash.inl @ 91] 
12 09d4b534 0f5f93bf CoreCLR!EETypeHashTable::InsertValue+0x723 [c:\dev\coreclr\src\vm\typehash.cpp @ 645] 
13 09d4b818 0f5e805b CoreCLR!ClassLoader::PublishType+0x51f [c:\dev\coreclr\src\vm\clsload.cpp @ 3486] 
14 09d4b9cc 0f5f53e1 CoreCLR!ClassLoader::DoIncrementalLoad+0x51b [c:\dev\coreclr\src\vm\clsload.cpp @ 3271] 
15 09d4bbe4 0f5f431e CoreCLR!ClassLoader::LoadTypeHandleForTypeKey_Body+0xa71 [c:\dev\coreclr\src\vm\clsload.cpp @ 4030] 
16 09d4bd58 0f5efe95 CoreCLR!ClassLoader::LoadTypeHandleForTypeKey+0x39e [c:\dev\coreclr\src\vm\clsload.cpp @ 3756] 
17 09d4bf3c 0f5f0b38 CoreCLR!ClassLoader::LoadConstructedTypeThrowing+0x935 [c:\dev\coreclr\src\vm\clsload.cpp @ 1202] 
18 09d4c104 0f8040a7 CoreCLR!ClassLoader::LoadGenericInstantiationThrowing+0x7a8 [c:\dev\coreclr\src\vm\clsload.cpp @ 2079] 
19 09d4c434 0f804394 CoreCLR!SigPointer::GetTypeHandleThrowing+0x1177 [c:\dev\coreclr\src\vm\siginfo.cpp @ 1438] 
1a 09d4c75c 0fa990ef CoreCLR!SigPointer::GetTypeHandleThrowing+0x1464 [c:\dev\coreclr\src\vm\siginfo.cpp @ 1556] 
1b 09d4ca40 0f6294f1 CoreCLR!Dictionary::PopulateEntry+0x66f [c:\dev\coreclr\src\vm\genericdict.cpp @ 820] 
1c 09d4cb40 0f629a41 CoreCLR!JIT_GenericHandleWorker+0x281 [c:\dev\coreclr\src\vm\jithelpers.cpp @ 3885] 
1d 09d4cd24 0f628db8 CoreCLR!JIT_GenericHandle_Framed+0x4b1 [c:\dev\coreclr\src\vm\jithelpers.cpp @ 3935] 
1e 09d4ce7c 30a9ba2f CoreCLR!JIT_GenericHandleClassWithSlotAndModule+0x3f8 [c:\dev\coreclr\src\vm\jithelpers.cpp @ 4050] 
1f 09d4cebc 30a999f8 System_Private_CoreLib!System.Collections.Concurrent.ConcurrentQueueSegment`1[[System.__Canon, System.Private.CoreLib]]..ctor(Int32)+0xbf
20 09d4ced4 308af30e System_Private_CoreLib!System.Collections.Concurrent.ConcurrentQueue`1[[System.__Canon, System.Private.CoreLib]]..ctor()+0x64
21 09d4cef4 308af1ef System_Private_CoreLib!System.Threading.ThreadPoolWorkQueue..ctor()+0x26
22 09d4cf0c 0f4787f1 System_Private_CoreLib!System.Threading.ThreadPoolGlobals..cctor()+0x3b
23 09d4cf18 0f83a911 CoreCLR!CallDescrWorkerInternal+0x34 [C:\Dev\coreclr\src\vm\i386\asmhelpers.asm @ 612] 
24 09d4d334 0f83ab95 CoreCLR!CallDescrWorker+0x121 [c:\dev\coreclr\src\vm\callhelpers.cpp @ 129] 
25 09d4d3e4 0f83bd66 CoreCLR!CallDescrWorkerWithHandler+0x205 [c:\dev\coreclr\src\vm\callhelpers.cpp @ 72] 
26 09d4d428 0f83b9e4 CoreCLR!`DispatchCallDebuggerWrapper'::`3'::__Body::Run+0x76 [c:\dev\coreclr\src\vm\callhelpers.cpp @ 164] 
27 09d4d480 0f83bc10 CoreCLR!DispatchCallDebuggerWrapper+0x74 [c:\dev\coreclr\src\vm\callhelpers.cpp @ 164] 
28 09d4d53c 0f8ac413 CoreCLR!DispatchCallSimple+0x190 [c:\dev\coreclr\src\vm\callhelpers.cpp @ 224] 
29 09d4d6d8 0f89815d CoreCLR!MethodTable::RunClassInitEx+0x453 [c:\dev\coreclr\src\vm\methodtable.cpp @ 3303] 
2a 09d4e18c 0f893c15 CoreCLR!MethodTable::DoRunClassInitThrowing+0x87d [c:\dev\coreclr\src\vm\methodtable.cpp @ 3536] 
2b 09d4e26c 0f6c9450 CoreCLR!MethodTable::CheckRunClassInitThrowing+0x345 [c:\dev\coreclr\src\vm\methodtable.cpp @ 3691] 
2c 09d4e4f0 0f6d21ef CoreCLR!DynamicHelperFixup+0x420 [c:\dev\coreclr\src\vm\prestub.cpp @ 2895] 
2d 09d4e654 0f478c24 CoreCLR!DynamicHelperWorker+0x1af [c:\dev\coreclr\src\vm\prestub.cpp @ 3203] 
2e 09d4e684 30898a38 CoreCLR!DelayLoad_Helper+0x25 [C:\Dev\coreclr\src\vm\i386\asmhelpers.asm @ 1849] 
2f 09d4e690 30899790 System_Private_CoreLib!System.Threading.ThreadPool.EnsureInitialized()+0xc
30 09d4e6a8 3089aa4d System_Private_CoreLib!System.Threading.ThreadPool.UnsafeQueueUserWorkItemInternal(System.Object, Boolean)+0x44
31 09d4e76c 3089a5fb System_Private_CoreLib!System.Threading.TimerQueue.FireNextTimers()+0x265
32 09d4e78c 0f4787f1 System_Private_CoreLib!System.Threading.TimerQueue.AppDomainTimerCallback(Int32)+0x9b
33 09d4e798 0f83a911 CoreCLR!CallDescrWorkerInternal+0x34 [C:\Dev\coreclr\src\vm\i386\asmhelpers.asm @ 612] 
34 09d4ebb4 0f83ab95 CoreCLR!CallDescrWorker+0x121 [c:\dev\coreclr\src\vm\callhelpers.cpp @ 129] 
35 09d4ec60 0f83b454 CoreCLR!CallDescrWorkerWithHandler+0x205 [c:\dev\coreclr\src\vm\callhelpers.cpp @ 72] 
36 09d4ef94 0f3ed9e7 CoreCLR!MethodDescCallSite::CallTargetWorker+0x874 [c:\dev\coreclr\src\vm\callhelpers.cpp @ 607] 
37 09d4efac 0fbdf46a CoreCLR!MethodDescCallSite::Call+0x17 [c:\dev\coreclr\src\vm\callhelpers.h @ 472] 
38 09d4f0b4 0f4e7fae CoreCLR!AppDomainTimerCallback_Worker+0x15a [c:\dev\coreclr\src\vm\comthreadpool.cpp @ 772] 
39 09d4f140 0f4e805d CoreCLR!ManagedThreadBase_DispatchInner+0x11e [c:\dev\coreclr\src\vm\threads.cpp @ 7779] 
3a 09d4f24c 0f4ebd9f CoreCLR!ManagedThreadBase_DispatchMiddle+0x8d [c:\dev\coreclr\src\vm\threads.cpp @ 7824] 
3b 09d4f28c 0f4ebe99 CoreCLR!``ManagedThreadBase_DispatchOuter'::`8'::__Body::Run'::`5'::__Body::Run+0x6f [c:\dev\coreclr\src\vm\threads.cpp @ 8043] 
3c 09d4f2e0 0f4e84c0 CoreCLR!`ManagedThreadBase_DispatchOuter'::`8'::__Body::Run+0x99 [c:\dev\coreclr\src\vm\threads.cpp @ 8043] 
3d 09d4f34c 0f4e8621 CoreCLR!ManagedThreadBase_DispatchOuter+0xc0 [c:\dev\coreclr\src\vm\threads.cpp @ 8065] 
3e 09d4f3f0 0f4f0e06 CoreCLR!ManagedThreadBase_FullTransitionWithAD+0x131 [c:\dev\coreclr\src\vm\threads.cpp @ 8091] 
3f 09d4f408 0fbdf2a1 CoreCLR!ManagedThreadBase::ThreadPool+0x16 [c:\dev\coreclr\src\vm\threads.cpp @ 8133] 
40 09d4f4ec 0fa23654 CoreCLR!AppDomainTimerCallback+0x191 [c:\dev\coreclr\src\vm\comthreadpool.cpp @ 804] 
41 09d4f590 0faf4f34 CoreCLR!ThreadpoolMgr::AsyncTimerCallbackCompletion+0x184 [c:\dev\coreclr\src\vm\win32threadpool.cpp @ 4786] 
42 09d4f608 0fa27f51 CoreCLR!UnManagedPerAppDomainTPCount::DispatchWorkItem+0x254 [c:\dev\coreclr\src\vm\threadpoolrequest.cpp @ 543] 
43 09d4f6a4 0fa3179b CoreCLR!ThreadpoolMgr::ExecuteWorkRequest+0x1a1 [c:\dev\coreclr\src\vm\win32threadpool.cpp @ 1546] 
44 09d4f834 0f4f343e CoreCLR!ThreadpoolMgr::WorkerThreadStart+0x4db [c:\dev\coreclr\src\vm\win32threadpool.cpp @ 2008] 
45 09d4fa64 75ae0179 CoreCLR!Thread::intermediateThreadProc+0x8e [c:\dev\coreclr\src\vm\threads.cpp @ 2151] 
46 09d4fa74 7757662d KERNEL32!BaseThreadInitThunk+0x19 [base\win32\client\thread.c @ 64] 
47 09d4fad0 775765fd ntdll!__RtlUserThreadStart+0x2f [minkernel\ntdll\rtlstrt.c @ 1163] 
48 09d4fae0 00000000 ntdll!_RtlUserThreadStart+0x1b [minkernel\ntdll\rtlstrt.c @ 1080] 

  10  Id: 6bfe4.6e428 Suspend: 1 Teb: 00289000 Unfrozen
 # ChildEBP RetAddr  
00 0ae2faf4 7755e4c6 ntdll!NtWaitForWorkViaWorkerFactory+0xc [minkernel\ntdll\wow6432\objfre\i386\usrstubs.asm @ 3777] 
01 0ae2fcb4 75ae0179 ntdll!TppWorkerThread+0x296 [minkernel\threadpool\ntdll\worker.c @ 910] 
02 0ae2fcc4 7757662d KERNEL32!BaseThreadInitThunk+0x19 [base\win32\client\thread.c @ 64] 
03 0ae2fd20 775765fd ntdll!__RtlUserThreadStart+0x2f [minkernel\ntdll\rtlstrt.c @ 1163] 
04 0ae2fd30 00000000 ntdll!_RtlUserThreadStart+0x1b [minkernel\ntdll\rtlstrt.c @ 1080] 

  11  Id: 6bfe4.6e42c Suspend: 1 Teb: 0028c000 Unfrozen
 # ChildEBP RetAddr  
00 0afaf998 7755e4c6 ntdll!NtWaitForWorkViaWorkerFactory+0xc [minkernel\ntdll\wow6432\objfre\i386\usrstubs.asm @ 3777] 
01 0afafb58 75ae0179 ntdll!TppWorkerThread+0x296 [minkernel\threadpool\ntdll\worker.c @ 910] 
02 0afafb68 7757662d KERNEL32!BaseThreadInitThunk+0x19 [base\win32\client\thread.c @ 64] 
03 0afafbc4 775765fd ntdll!__RtlUserThreadStart+0x2f [minkernel\ntdll\rtlstrt.c @ 1163] 
04 0afafbd4 00000000 ntdll!_RtlUserThreadStart+0x1b [minkernel\ntdll\rtlstrt.c @ 1080] 

# 12  Id: 6bfe4.6d5b4 Suspend: 1 Teb: 00292000 Unfrozen
 # ChildEBP RetAddr  
00 0b12f744 775bb3a9 ntdll!DbgBreakPoint [minkernel\ntos\rtl\i386\debug2.asm @ 61] 
01 0b12f774 75ae0179 ntdll!DbgUiRemoteBreakin+0x39 [minkernel\ntdll\dlluistb.c @ 312] 
02 0b12f784 7757662d KERNEL32!BaseThreadInitThunk+0x19 [base\win32\client\thread.c @ 64] 
03 0b12f7e0 775765fd ntdll!__RtlUserThreadStart+0x2f [minkernel\ntdll\rtlstrt.c @ 1163] 
04 0b12f7f0 00000000 ntdll!_RtlUserThreadStart+0x1b [minkernel\ntdll\rtlstrt.c @ 1080] 
cshung commented 5 years ago

Thanks @janvorli for the investigation, he pointed out that problem is the code is doing something inappropriate according to the contracts. In particular, UnlockedLoaderHeap::UnlockedAllocMem indicated it is a GC_NOTRIGGER region yet later on we did a GCX_MAYBE_COOP_NO_THREAD_BROKEN later on and caused grief.

Later on we discussed around and identified 4 possible solutions:

  1. Ensure WriteEvent() is only called in places where StackWalk is safe.
  2. If we could detect StackWalk is not safe, skip the stack, or
  3. Make StackWalk safe.
  4. Replace managed stack walk with a native stack walker.

Option 1 is very tedious, if not impossible. EtmDummy.h indicates we have about 400 different call sites for WriteEvent.

Option 2 is also tedious, there were attempts trying to detect whether or not StackWalk is safe. It is hard to do in general, and is also error prone.

Option 3 is interesting - so far the only offender I am seeing (in my simple stack) is ReadyToRunInfo::GetMethodDescForEntryPoint trying to do a hash table lookup, and for reason that I don't understand, it enters into cooperative mode, and screw us up. It could be the only case, or it could a tip of the iceberg, I have no idea for now. If we could make stack walking never need to enter cooperative mode, we can ensure a robust implementation of EventPipe. The great thing about this approach is that there is one big component to analyze, but not 400 call sites.

Option 4 is interesting too, if we use a different stack walker, then we are break free from the constraint of the current stack walker. It also allow the EventPipe traces to get native frames for analysis. It will likely not hit the time we need for .NET Core 3, and there might be other reasons that I don't know to introduce a native stack walker into the runtime.

@jkotas @fadimounir - for the ready to run use case @AaronRobinsonMSFT - for what might that RCW reason be. @sywhang @noahfalk @jorive @vancem @tommcdon

AaronRobinsonMSFT commented 5 years ago

@cshung This is a part of the code I have not had a chance to fully process. There are a lot of dragons here with respect to the RCW cache with the STA and GC. If you look through the hash.cpp there are a myriad of places that mention the RCWCache scenario is broken. I couldn't really answer the question only to say that when we detect an RCW is being created on an STA we take the opportunity to clean up unused STA objects in the RCWCache. This means we could induce a GC that could be the reason, but that is speculation.

jkotas commented 5 years ago

for reason that I don't understand, it enters into cooperative mode

m_entryPointToMethodDescMap is lock-free hash table. It uses the GC mode for synchronization. The comment in front of class HashMap explains how it works.

here were attempts trying to detect whether or not StackWalk is safe.

Yep, it was stress-test driven development. We have been running stack walk stress for months and every time we hit a crash, assert or hang in it, we have tried to fix by improving the detection of when it is not safe to do a stackwalk.

so far the only offender I am seeing (in my simple stack)

There are number of these lock-free hash tables and other complex code reachable from stack walk. If you run the tests long enough, you should eventually see all more of them.

The great thing about this approach is that there is one big component to analyze

It is about as tedious as Option 2. You have one big component to analyze for both Option 2 and Option 3. The difference between Option 2 and Option 3 is that Option 2 adds conditions around entrypoint to this big component that try to detect when it is dangerous to enter it; and Option 3 is changing the implementation of this component to eliminate the reasons when it is dangerous to enter it.

jkotas commented 5 years ago

I think Option 3 is the cleanest, but it is pretty non-trivial.

vancem commented 5 years ago

Certainly from a design perpective, making something very primtive like stack walking NOT have any interactions with higher level concepts like the GC (or GC mode), would not nice, so I am not averse to that. It sounds like it is hard enough that we shoudl be considering alternatives.

I wanted to mention that the number of events in the runtime that would benefit from having a stack associated with the event is relatively small. Indeed we have this inventory, it is the ClrEtwAllMeta.lst file (all events with 'nostack' don't have stacks (the sense of the flag really should have been reversed, stack is much less common and you should have to opt into it).

In particular the one that caused the bug above, was added with the idea that it would be useful to track memory the loader allocated on your behalf but it has actually never been used. I woudl be OK if we simply remove the event (thus fixing this paritcular instance).

If we go the route of picking and choosing sites to have stack walks, we should really have some enforcement by the contract system (there should be a different call contact for those that do stack walks from those that do not, so we get failures (this assumes we do runs on debug CLRs with events truned on, I am assuming this is the case).

Finally I do note that we have a stackwalker for ETW that was GC_NOTRIGGER (see GetCurrentTheadsCallStack in eventtrace.cpp), but I think this is windows only, and frankly I would like to get rid of it, so best not rely on it.

noahfalk commented 5 years ago

I'm not sure how well ClrEtwAllMeta.lst is expressing our intent? There are only 6 events that explicitly opt in to having stacks, two of which are fusion (irrelevant), one is LoaderHeapAllocation (which we just decided wasn't valuable) and the other three are GarbageCollectionPrivate. However after that there is a sizable swath of events that aren't marked as 'stack' or 'nostack' and its unclear what the intent is for those.

I think a simple route could be declaring that the only runtime events which will get stacks from EventPipe are the ones explicitly marked 'stack', which is now just three relevant events. This reduces the auditing burden dramatically. If anyone else wants to add more we can fault them in as they are determined to be useful and safe. If we find ourselves doing that too frequently we could step back and re-evaluate the approach. How does that sound?

davidwrighton commented 5 years ago

Longer term, Option 3 seems the best, but for the foreseeable future, I suspect the approach of only capturing stacks for a defined set of "safe" events would be acceptable.

tommcdon commented 5 years ago

@cshung please reference PR and close

cshung commented 5 years ago

This PR should result in much less stack walking operation and thus make this issue go away. Care has to be taken whenever we enable stack for events though.