I have a 2 COM ourtproc servers. CoCreateInstance() is invoked from UI thread of Server-A to activate Server-B.
UI thread of Server-A is initialized as STA. Also main thread of Server-B is initialized as STA.
The COM object in Server-A is created with CComPtr.
CoCreateInstance() is invoked frequently and this continuous call to CoCreateInstance() makes CoCreateInstance() hung after 3 or 4 hours. At the time of issue, Server-B is already running. As per my understanding, since it is already running, this issue has no relation with Server-B. Please find the callstack of the issue below
00184970 76be06eb 001849e8 00000000 0000000f user32!NtUserPeekMessage+0x15 00184998 76be0751 001849e8 00000000 0000000f user32!_PeekMessage+0x88 001849c4 74c3805d 001849e8 00000000 0000000f user32!PeekMessageW+0x108 WARNING: Stack unwind information not available. Following frames may be wrong. 00184a04 74c383a6 00184a18 00184c8c 74b86e28 mfc90u+0xc805d 00184a44 770d50d2 0218f058 00000000 00000000 mfc90u+0xc83a6 00184a84 7706d09e e46cbbe0 00000102 00184c8c ole32!CCliModalLoop::HandlePendingMessage+0x36 00184ae0 7706d048 00184c8c 006f9760 00000000 ole32!CCliModalLoop::HandleWakeForMsg+0x4c 00184af8 77072d31 00184b18 ffffffff 00184b28 ole32!CCliModalLoop::BlockFn+0xc3 00184b20 7718d2f6 ffffffff 006f9760 00184c30 ole32!ModalLoop+0x5b 00184b3c 7718d098 00000000 00184c44 00000000 ole32!ThreadSendReceive+0x12d 00184b68 7718cef0 00184c30 00710da0 00184c8c ole32!CRpcChannelBuffer::SwitchAptAndDispatchCall+0x1a7 00184c48 77072cba 00710da0 00184d74 00184d5c ole32!CRpcChannelBuffer::SendReceive2+0xef 00184c64 77089aa1 00184d74 00184d5c 00710da0 ole32!CCliModalLoop::SendReceive+0x1e 00184ce0 77089b24 00710da0 00184d74 00184d5c ole32!CAptRpcChnl::SendReceive+0x73 00184d34 7718ce06 00710da0 00184d74 00184d5c ole32!CCtxComChnl::SendReceive+0x1c5 00184d50 763a420b 00725d5c 00184da0 76420149 ole32!NdrExtpProxySendReceive+0x49 00184d5c 76420149 e46ca0ae 001851a8 0700022b rpcrt4!NdrpProxySendReceive+0xe 00185170 7718c8e2 7709fa10 770a48ce 001851a8 rpcrt4!NdrClientCall2+0x1a6 00185190 770898ad 00000014 00000004 00185210 ole32!ObjectStublessClient+0xa2 001851a0 77085d2c 00725d5c 00000000 00185664 ole32!ObjectStubless+0xf 00185210 7708637b 00185664 00185bcc 00000000 ole32!CRpcResolver::CreateInstance+0x195 0018546c 77093170 77196448 00000000 00185664 ole32!CClientContextActivator::CreateInstance+0x11f 001854ac 77093098 00185664 00000000 00185bcc ole32!ActivationPropertiesIn::DelegateCreateInstance+0x108 00185c80 77099e25 00185d58 00000000 00000017 ole32!ICoCreateInstanceEx+0x404 00185ce0 77099d86 00185d58 00000000 00000017 ole32!CComActivator::DoCreateInstance+0xd9 00185d04 77099d3f 00185d58 00000000 00000017 ole32!CoCreateInstanceEx+0x38 00185d34 1000865b 00185d58 00000000 00000017 ole32!CoCreateInstance+0x37
Thanks, Renjith V R