Some of our users recently (in the last couple of months) started to report hang-line scenarios in our application that uses CEF.
This issue was reported in two very different versions of the framework:
Our most recent version uses: CEF 3.3396.1777.g636f29b / Chromium 67.0.3396.79
While the older version is still using: 1.1364.1123
Unfortunately, we were never able to reproduce the reported issue in-house, so the only analysis we were able to perform is based on dump files.
Digging into the information in the dump file using windbg we can see the finalizer thread is hanged waiting for another thread.
The finalizer thread has the stack below. It is currently cleaning up the RCW list and trying to transition to thread df0 in order to cleanup the COM object wrapped by the RCW at the head of the list.
- Code: Select all
0:002> !mex.t -c
DbgID ThreadID User Kernel Create Time (UTC)
2 2324 (0n8996) 46ms 0s 10/12/2018 04:06:17.627 PM
# Call Site Info
0 ntdll!ZwWaitForMultipleObjects+0x14
1 KERNELBASE!WaitForMultipleObjectsEx+0xfe
2 combase!MTAThreadWaitForCall+0xbd
3 combase!MTAThreadDispatchCrossApartmentCall+0x17e Target ThreadID: 0xdf0
4 combase!CSyncClientCall::SwitchAptAndDispatchCall+0x34a
5 combase!CSyncClientCall::SendReceive2+0x42c
6 combase!SyncClientCallRetryContext::SendReceiveWithRetry+0x25
7 combase!CSyncClientCall::SendReceiveInRetryContext+0x25
8 combase!DefaultSendReceive+0x65
9 combase!CSyncClientCall::SendReceive+0x2f9
a combase!CClientChannel::SendReceive+0x84
b combase!NdrExtpProxySendReceive+0x4e
c rpcrt4!Ndr64pSendReceive+0x239
d rpcrt4!NdrpClientCall3+0x8e9
e combase!ObjectStublessClient+0x13b
f combase!ObjectStubless+0x42
10 combase!CObjectContext::InternalContextCallback+0x252
11 combase!CObjectContext::ContextCallback+0x7f
12 clr!CtxEntry::EnterContext+0x287
13 clr!RCW::EnterContext+0x43
14 clr!RCWCleanupList::ReleaseRCWListInCorrectCtx+0xd5
15 clr!RCWCleanupList::CleanupAllWrappers+0x33fb04
16 clr!SyncBlockCache::CleanupSyncBlocks+0xcf
17 clr!Thread::DoExtraWorkForFinalizer+0x200
18 clr!FinalizerThread::FinalizerThreadWorker+0x91
19 clr!ManagedThreadBase_DispatchInner+0x39
1a clr!ManagedThreadBase_DispatchMiddle+0x6c
1b clr!ManagedThreadBase_DispatchOuter+0x75
1c clr!ManagedThreadBase_NoADTransition+0x3e
1d clr!ManagedThreadBase::FinalizerBase+0x3e
1e clr!FinalizerThread::FinalizerThreadStart+0x126
1f clr!Thread::intermediateThreadProc+0x86
20 kernel32!BaseThreadInitThunk+0x14
21 ntdll!RtlUserThreadStart+0x21
While the other thread (0xdf0) has the stack below. That thread is blocked waiting on an IOCompletion port:
- Code: Select all
0:017> !Mex.t -c -t 0xdf0
DbgID ThreadID User Kernel Create Time (UTC)
17 df0 (0n3568) 375ms 187ms 10/12/2018 04:06:24.479
# Call Site
0 ntdll!ZwRemoveIoCompletion+0x14
1 KERNELBASE!GetQueuedCompletionStatus+0x53
2 libcef!base::MessagePumpForIO::GetIOItem+0x43
3 libcef!base::MessagePumpForIO::WaitForIOCompletion+0x9e
4 libcef!base::MessagePumpForIO::WaitForWork+0x65
5 libcef!base::MessagePumpForIO::DoRunLoop+0x13d
6 libcef!base::MessagePumpWin::Run+0x68
7 libcef!base::RunLoop::Run+0x31
8 libcef!content::BrowserProcessSubThread::IOThreadRun+0x24
9 libcef!base::Thread::ThreadMain+0x19c
a libcef!base::`anonymous namespace'::ThreadFunc+0xf4
b kernel32!BaseThreadInitThunk+0x14
c ntdll!RtlUserThreadStart+0x21
We're kind of struggling to go any further on this issue. It is clear that CEF is waiting for something to finish, and until that happens, the process is stuck.
It would be great if anyone could shed some light of what is happening.
If you need any other details, please do not hesitate.
Any help is appreciated.