Hi,
Using React.NET 3.0.1 which uses ClearScript.V8 5.4.8 following hang is observed on recycling application pool
```
.NET Call Stack
.SharedPtr.Release(SharedPtr*)+d7
[[InlinedCallFrame] (.Decrement)] .RefCount.Decrement(RefCount*)
Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
[[DebuggerU2MCatchHandlerFrame]]
[[ContextTransitionFrame]]
[[GCFrame]]
[[DebuggerU2MCatchHandlerFrame]]
Full Call Stack
ntdll!NtWaitForSingleObject+14
KERNELBASE!WaitForSingleObjectEx+8f
v8_x64!v8::Extension::dependencies+329ac
v8_x64!v8::ExternalResourceVisitor::VisitExternalString+28187
v8_x64!v8::ExternalResourceVisitor::VisitExternalString+1a3
v8_x64!v8::ExternalResourceVisitor::VisitExternalString+533b
ClearScriptV8_64+14216
ClearScriptV8_64+120e4
ClearScriptV8_64+13e3f
ClearScriptV8_64+50a8
<Module>.SharedPtr<V8Context>.Release(SharedPtr<V8Context>*)+d7
[[InlinedCallFrame] (<Module>.Decrement)] <Module>.RefCount.Decrement(RefCount*)
Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
clr!FastCallFinalizeWorker+6
clr!ETW::GCLog::SendFinalizeObjectEvent+c9
clr!MethodTable::CallFinalizer+b5
clr!CallFinalizer+5e
clr!FinalizerThread::DoOneFinalization+95
clr!FinalizerThread::FinalizeAllObjects+133
clr!FinalizerThread::FinalizeAllObjects_Wrapper+18
clr!Frame::Push+59
clr!PEDecoder::GetNativeCodeManagerTable+170
clr!PEDecoder::GetNativeCodeManagerTable+99
[[DebuggerU2MCatchHandlerFrame]]
clr!Thread::ShouldChangeAbortToUnload+45
clr!Thread::DoADCallBack+109
[[ContextTransitionFrame]]
clr!Frame::Push+a2
clr!FinalizerThread::DoOneFinalization+1f9
[[GCFrame]]
clr!FinalizerThread::FinalizeAllObjects+133
clr!FinalizerThread::FinalizerThreadWorker+bb
clr!Frame::Push+59
clr!PEDecoder::GetNativeCodeManagerTable+170
clr!PEDecoder::GetNativeCodeManagerTable+99
[[DebuggerU2MCatchHandlerFrame]]
clr!FinalizerThread::FinalizerThreadStart+10a
clr!Thread::intermediateThreadProc+86
kernel32!BaseThreadInitThunk+14
ntdll!RtlUserThreadStart+21
```
Comments: Hi, Sorry for delay. Stack with symbols loaded for locally built version: ``` # Child-SP RetAddr Call Site 00 000000eb`4437ed78 00007ffa`f9c4988f ntdll!ZwWaitForSingleObject+0x14 01 000000eb`4437ed80 00007ffa`bb02554c KERNELBASE!WaitForSingleObjectEx+0x9f 02 (Inline Function) --------`-------- v8_x64!v8::internal::MemoryAllocator::Unmapper::WaitUntilCompleted+0x16 [c:\git\clearscript\clearscript\v8\v8\build\v8-x64\src\heap\spaces.cc @ 366] 03 000000eb`4437ee20 00007ffa`bad9e237 v8_x64!v8::internal::MemoryAllocator::TearDown+0x3c [c:\git\clearscript\clearscript\v8\v8\build\v8-x64\src\heap\spaces.cc @ 314] 04 000000eb`4437ee60 00007ffa`bad76283 v8_x64!v8::internal::Heap::TearDown+0x477 [c:\git\clearscript\clearscript\v8\v8\build\v8-x64\src\heap\heap.cc @ 5591] 05 000000eb`4437eea0 00007ffa`bad7b41b v8_x64!v8::internal::Isolate::Deinit+0x193 [c:\git\clearscript\clearscript\v8\v8\build\v8-x64\src\isolate.cc @ 2150] 06 000000eb`4437eed0 00007ffa`d0074216 v8_x64!v8::internal::Isolate::TearDown+0x5b [c:\git\clearscript\clearscript\v8\v8\build\v8-x64\src\isolate.cc @ 2077] 07 000000eb`4437ef10 00007ffa`d00720e4 ClearScriptV8_64!V8IsolateImpl::~V8IsolateImpl+0x286 [c:\git\clearscript\clearscript\v8\clearscriptv8\v8isolateimpl.cpp @ 656] 08 000000eb`4437eff0 00007ffa`d0073e3f ClearScriptV8_64!V8IsolateImpl::`scalar deleting destructor'+0x14 09 (Inline Function) --------`-------- ClearScriptV8_64!SharedPtrTraits<V8IsolateImpl>::Destroy+0xe [c:\git\clearscript\clearscript\v8\clearscriptv8\sharedptr.h @ 143] 0a (Inline Function) --------`-------- ClearScriptV8_64!SharedPtr<V8IsolateImpl>::Release+0x23 [c:\git\clearscript\clearscript\v8\clearscriptv8\sharedptr.h @ 338] 0b (Inline Function) --------`-------- ClearScriptV8_64!SharedPtr<V8IsolateImpl>::{dtor}+0x23 [c:\git\clearscript\clearscript\v8\clearscriptv8\sharedptr.h @ 259] 0c 000000eb`4437f020 00007ffa`d00650a8 ClearScriptV8_64!V8IsolateImpl::CallWithLockNoWait+0x1df [c:\git\clearscript\clearscript\v8\clearscriptv8\v8isolateimpl.cpp @ 628] 0d 000000eb`4437f0d0 00007ffa`84f451fb ClearScriptV8_64!V8ContextImpl::Destroy+0x68 [c:\git\clearscript\clearscript\v8\clearscriptv8\v8contextimpl.cpp @ 530] 0e 000000eb`4437f160 00007ffa`84f7121e 0x00007ffa`84f451fb 0f 000000eb`4437f210 00007ffa`84f47d1e 0x00007ffa`84f7121e 10 000000eb`4437f2c0 00007ffa`df5666c6 0x00007ffa`84f47d1e 11 000000eb`4437f300 00007ffa`df71a741 clr!LogHelp_LogAssert+0x1b46 12 000000eb`4437f330 00007ffa`df71a6c9 clr!MetaDataGetDispenser+0x3ff11 13 000000eb`4437f380 00007ffa`df71a602 clr!MetaDataGetDispenser+0x3fe99 14 000000eb`4437f3d0 00007ffa`df71a4b9 clr!MetaDataGetDispenser+0x3fdd2 15 000000eb`4437f410 00007ffa`df71a3cc clr!MetaDataGetDispenser+0x3fc89 16 000000eb`4437f4f0 00007ffa`df71bc87 clr!MetaDataGetDispenser+0x3fb9c 17 000000eb`4437f540 00007ffa`df567c9d clr!MetaDataGetDispenser+0x41457 18 000000eb`4437f570 00007ffa`df567c18 clr!LogHelp_LogAssert+0x311d 19 000000eb`4437f5b0 00007ffa`df567b56 clr!LogHelp_LogAssert+0x3098 1a 000000eb`4437f6b0 00007ffa`df56a864 clr!LogHelp_LogAssert+0x2fd6 1b 000000eb`4437f740 00007ffa`df5b2fe9 clr!LogHelp_LogAssert+0x5ce4 1c 000000eb`4437f770 00007ffa`df56a845 clr!LogHelp_NoGuiOnAssert+0x46dd9 1d 000000eb`4437f920 00007ffa`df71bc33 clr!LogHelp_LogAssert+0x5cc5 1e 000000eb`4437f960 00007ffa`df71a3cc clr!MetaDataGetDispenser+0x41403 1f 000000eb`4437fa40 00007ffa`df71977b clr!MetaDataGetDispenser+0x3fb9c 20 000000eb`4437fa90 00007ffa`df567c9d clr!MetaDataGetDispenser+0x3ef4b 21 000000eb`4437fad0 00007ffa`df567c18 clr!LogHelp_LogAssert+0x311d 22 000000eb`4437fb10 00007ffa`df567b56 clr!LogHelp_LogAssert+0x3098 23 000000eb`4437fc10 00007ffa`df69f87a clr!LogHelp_LogAssert+0x2fd6 24 000000eb`4437fca0 00007ffa`df6631cf clr!PreBindAssemblyEx+0x11aa 25 000000eb`4437fd40 00007ffa`fa102774 clr!GetPrivateContextsPerfCounters+0x10b6f 26 000000eb`4437fe00 00007ffa`fcc00d61 kernel32!BaseThreadInitThunk+0x14 27 000000eb`4437fe30 00000000`00000000 ntdll!RtlUserThreadStart+0x21 ```
Using React.NET 3.0.1 which uses ClearScript.V8 5.4.8 following hang is observed on recycling application pool
```
.NET Call Stack
.SharedPtr.Release(SharedPtr*)+d7
[[InlinedCallFrame] (.Decrement)] .RefCount.Decrement(RefCount*)
Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
[[DebuggerU2MCatchHandlerFrame]]
[[ContextTransitionFrame]]
[[GCFrame]]
[[DebuggerU2MCatchHandlerFrame]]
Full Call Stack
ntdll!NtWaitForSingleObject+14
KERNELBASE!WaitForSingleObjectEx+8f
v8_x64!v8::Extension::dependencies+329ac
v8_x64!v8::ExternalResourceVisitor::VisitExternalString+28187
v8_x64!v8::ExternalResourceVisitor::VisitExternalString+1a3
v8_x64!v8::ExternalResourceVisitor::VisitExternalString+533b
ClearScriptV8_64+14216
ClearScriptV8_64+120e4
ClearScriptV8_64+13e3f
ClearScriptV8_64+50a8
<Module>.SharedPtr<V8Context>.Release(SharedPtr<V8Context>*)+d7
[[InlinedCallFrame] (<Module>.Decrement)] <Module>.RefCount.Decrement(RefCount*)
Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
clr!FastCallFinalizeWorker+6
clr!ETW::GCLog::SendFinalizeObjectEvent+c9
clr!MethodTable::CallFinalizer+b5
clr!CallFinalizer+5e
clr!FinalizerThread::DoOneFinalization+95
clr!FinalizerThread::FinalizeAllObjects+133
clr!FinalizerThread::FinalizeAllObjects_Wrapper+18
clr!Frame::Push+59
clr!PEDecoder::GetNativeCodeManagerTable+170
clr!PEDecoder::GetNativeCodeManagerTable+99
[[DebuggerU2MCatchHandlerFrame]]
clr!Thread::ShouldChangeAbortToUnload+45
clr!Thread::DoADCallBack+109
[[ContextTransitionFrame]]
clr!Frame::Push+a2
clr!FinalizerThread::DoOneFinalization+1f9
[[GCFrame]]
clr!FinalizerThread::FinalizeAllObjects+133
clr!FinalizerThread::FinalizerThreadWorker+bb
clr!Frame::Push+59
clr!PEDecoder::GetNativeCodeManagerTable+170
clr!PEDecoder::GetNativeCodeManagerTable+99
[[DebuggerU2MCatchHandlerFrame]]
clr!FinalizerThread::FinalizerThreadStart+10a
clr!Thread::intermediateThreadProc+86
kernel32!BaseThreadInitThunk+14
ntdll!RtlUserThreadStart+21
```
Comments: Hi, Sorry for delay. Stack with symbols loaded for locally built version: ``` # Child-SP RetAddr Call Site 00 000000eb`4437ed78 00007ffa`f9c4988f ntdll!ZwWaitForSingleObject+0x14 01 000000eb`4437ed80 00007ffa`bb02554c KERNELBASE!WaitForSingleObjectEx+0x9f 02 (Inline Function) --------`-------- v8_x64!v8::internal::MemoryAllocator::Unmapper::WaitUntilCompleted+0x16 [c:\git\clearscript\clearscript\v8\v8\build\v8-x64\src\heap\spaces.cc @ 366] 03 000000eb`4437ee20 00007ffa`bad9e237 v8_x64!v8::internal::MemoryAllocator::TearDown+0x3c [c:\git\clearscript\clearscript\v8\v8\build\v8-x64\src\heap\spaces.cc @ 314] 04 000000eb`4437ee60 00007ffa`bad76283 v8_x64!v8::internal::Heap::TearDown+0x477 [c:\git\clearscript\clearscript\v8\v8\build\v8-x64\src\heap\heap.cc @ 5591] 05 000000eb`4437eea0 00007ffa`bad7b41b v8_x64!v8::internal::Isolate::Deinit+0x193 [c:\git\clearscript\clearscript\v8\v8\build\v8-x64\src\isolate.cc @ 2150] 06 000000eb`4437eed0 00007ffa`d0074216 v8_x64!v8::internal::Isolate::TearDown+0x5b [c:\git\clearscript\clearscript\v8\v8\build\v8-x64\src\isolate.cc @ 2077] 07 000000eb`4437ef10 00007ffa`d00720e4 ClearScriptV8_64!V8IsolateImpl::~V8IsolateImpl+0x286 [c:\git\clearscript\clearscript\v8\clearscriptv8\v8isolateimpl.cpp @ 656] 08 000000eb`4437eff0 00007ffa`d0073e3f ClearScriptV8_64!V8IsolateImpl::`scalar deleting destructor'+0x14 09 (Inline Function) --------`-------- ClearScriptV8_64!SharedPtrTraits<V8IsolateImpl>::Destroy+0xe [c:\git\clearscript\clearscript\v8\clearscriptv8\sharedptr.h @ 143] 0a (Inline Function) --------`-------- ClearScriptV8_64!SharedPtr<V8IsolateImpl>::Release+0x23 [c:\git\clearscript\clearscript\v8\clearscriptv8\sharedptr.h @ 338] 0b (Inline Function) --------`-------- ClearScriptV8_64!SharedPtr<V8IsolateImpl>::{dtor}+0x23 [c:\git\clearscript\clearscript\v8\clearscriptv8\sharedptr.h @ 259] 0c 000000eb`4437f020 00007ffa`d00650a8 ClearScriptV8_64!V8IsolateImpl::CallWithLockNoWait+0x1df [c:\git\clearscript\clearscript\v8\clearscriptv8\v8isolateimpl.cpp @ 628] 0d 000000eb`4437f0d0 00007ffa`84f451fb ClearScriptV8_64!V8ContextImpl::Destroy+0x68 [c:\git\clearscript\clearscript\v8\clearscriptv8\v8contextimpl.cpp @ 530] 0e 000000eb`4437f160 00007ffa`84f7121e 0x00007ffa`84f451fb 0f 000000eb`4437f210 00007ffa`84f47d1e 0x00007ffa`84f7121e 10 000000eb`4437f2c0 00007ffa`df5666c6 0x00007ffa`84f47d1e 11 000000eb`4437f300 00007ffa`df71a741 clr!LogHelp_LogAssert+0x1b46 12 000000eb`4437f330 00007ffa`df71a6c9 clr!MetaDataGetDispenser+0x3ff11 13 000000eb`4437f380 00007ffa`df71a602 clr!MetaDataGetDispenser+0x3fe99 14 000000eb`4437f3d0 00007ffa`df71a4b9 clr!MetaDataGetDispenser+0x3fdd2 15 000000eb`4437f410 00007ffa`df71a3cc clr!MetaDataGetDispenser+0x3fc89 16 000000eb`4437f4f0 00007ffa`df71bc87 clr!MetaDataGetDispenser+0x3fb9c 17 000000eb`4437f540 00007ffa`df567c9d clr!MetaDataGetDispenser+0x41457 18 000000eb`4437f570 00007ffa`df567c18 clr!LogHelp_LogAssert+0x311d 19 000000eb`4437f5b0 00007ffa`df567b56 clr!LogHelp_LogAssert+0x3098 1a 000000eb`4437f6b0 00007ffa`df56a864 clr!LogHelp_LogAssert+0x2fd6 1b 000000eb`4437f740 00007ffa`df5b2fe9 clr!LogHelp_LogAssert+0x5ce4 1c 000000eb`4437f770 00007ffa`df56a845 clr!LogHelp_NoGuiOnAssert+0x46dd9 1d 000000eb`4437f920 00007ffa`df71bc33 clr!LogHelp_LogAssert+0x5cc5 1e 000000eb`4437f960 00007ffa`df71a3cc clr!MetaDataGetDispenser+0x41403 1f 000000eb`4437fa40 00007ffa`df71977b clr!MetaDataGetDispenser+0x3fb9c 20 000000eb`4437fa90 00007ffa`df567c9d clr!MetaDataGetDispenser+0x3ef4b 21 000000eb`4437fad0 00007ffa`df567c18 clr!LogHelp_LogAssert+0x311d 22 000000eb`4437fb10 00007ffa`df567b56 clr!LogHelp_LogAssert+0x3098 23 000000eb`4437fc10 00007ffa`df69f87a clr!LogHelp_LogAssert+0x2fd6 24 000000eb`4437fca0 00007ffa`df6631cf clr!PreBindAssemblyEx+0x11aa 25 000000eb`4437fd40 00007ffa`fa102774 clr!GetPrivateContextsPerfCounters+0x10b6f 26 000000eb`4437fe00 00007ffa`fcc00d61 kernel32!BaseThreadInitThunk+0x14 27 000000eb`4437fe30 00000000`00000000 ntdll!RtlUserThreadStart+0x21 ```