CoCreateInstance Under Stress on Multiple Threads at the Same Time, loop in side the same method and

Hi,

I have one shell ext, where shell call IShellFolder::CompareIDs Method. internally i call my Out-proc COM server to get some values. for this i am using CoCreateInstance to get the service pinter.

in Stress on Multiple Threads senario, it loop in same method and never return from CoCreateInstance. because of this i am getting buffer over flow.

 

this is happning only on win-7. it is working fine on XP. i have seen similor issue on
http://support.microsoft.com/kb/187884.

call stack is given below:

  ole32.dll!763b43e1()  
  [Frames below may be incorrect and/or missing, no symbols loaded for ole32.dll] 
  ole32.dll!763b4491()  
  ole32.dll!763b4440()  
  ole32.dll!763b49bb()  
  ole32.dll!763b48b9()  
  ole32.dll!763b4a99()  
  ole32.dll!763b539e()  
  ole32.dll!763b5a0f()  
  shell32.dll!76e73265()  
  shell32.dll!76f4645e()  
  KernelBase.dll!75e474d9()  
  shell32.dll!76e9c24b()  
  shell32.dll!76e8b3f2()  
  shlwapi.dll!76903eb2()  
  shell32.dll!76e8b554()  
  shell32.dll!76e8c1b8()  
  shell32.dll!76e9c24b()  
  shell32.dll!76e8b3f2()  
  shlwapi.dll!76903eb2()  
  shell32.dll!76e8b554()  
  shell32.dll!76e8c1b8()  
  shell32.dll!76e8fc26()  
  shell32.dll!76e8b42a()  
  shell32.dll!76e8b7c2()  
  shell32.dll!76e8b40c()  
  shell32.dll!76e8e873()  
  shell32.dll!76e82456()  
  KernelBase.dll!75e474d9()  
  shell32.dll!76e9c447()  
  shell32.dll!76e8b42a()  
  shell32.dll!76e8b40c()  
  shell32.dll!76e8b7c2()  
  shell32.dll!76e8b40c()  
  shell32.dll!76e8e873()  
  shell32.dll!76e7ee8f()  
  shell32.dll!76e7eebd()  
  shell32.dll!76e8105d()  
  shell32.dll!76e810a6()  
  user32.dll!761a86ef()  
  user32.dll!761a8876()  
  user32.dll!761a881f()  
  user32.dll!761a70f4()  
  user32.dll!761a738f()  
  ntdll.dll!77a8642e()  
  user32.dll!761a914b()  
  user32.dll!761a9180()  
  user32.dll!761a92a9()  
  ole32.dll!7637d403()  
  ole32.dll!7637d47d()  
  user32.dll!761af0ab()  
  user32.dll!7619d4bc()  
  ole32.dll!7639b055()  
  ole32.dll!7639a5ed()  
  ole32.dll!7638365e()  
  ole32.dll!7638cba0()  
  ole32.dll!76398fd9()  
  ole32.dll!7638cb09()  
  ole32.dll!7649bf75()  
  rpcrt4.dll!766d178b()  
  rpcrt4.dll!76745744()  
  ole32.dll!7638c8b5()  
  ole32.dll!7639e01f()  
  ole32.dll!7639e0f9()  
  ole32.dll!763a554a()  
  ole32.dll!763a4ab3()  
  ole32.dll!763a5472()  
  rpcrt4.dll!766ec1b3()  
  ntdll.dll!77a9e5fd()  
  ntdll.dll!77a9e5fd()  
  ntdll.dll!77a6ff1d()  
  ole32.dll!763b45f3()  
  ole32.dll!763b4515()  
  ole32.dll!763b464f()  
  ole32.dll!763b45f3()  
  ole32.dll!763b4515()  
  ole32.dll!763b48fc()  
  ole32.dll!763b5bb4()  
  ole32.dll!763b5916()  
  ole32.dll!763b5877()  
  ole32.dll!763b5830()  
> MyProxy.dll.dll!CBtProxyManager::GetPairedDevice(_ADDR_T * pDeviceAddr=0x02bd7588, _DEVICE_INFO_EX * pDeviceInfo=0x03b0b858)  Line 1384 + 0x1a bytes C++
  MyProxy.dll.dll!BtGetPairedDevice(_ADDR_T * pDeviceAddr=0x02bd7588, _DEVICE_INFO_EX * pDeviceInfo=0x03b0b858)  Line 430 + 0x13 bytes C++
  MyShellExt.dll.dll!RetrievePairedBthDeviceName(const unsigned __int64 & addr=0x000000137043ae45, wchar_t * pBuf=0x02bd8bd4, unsigned long cchBuf=0x00000200)  Line 311 + 0x10 bytes C++
  MyShellExt.dll.dll!CCSRBtShellRootFolder::CompareIDs(long lParam=0x10000000, const _ITEMIDLIST * pidl1=0x04285a18, const _ITEMIDLIST * pidl2=0x02bd9070)  Line 243 + 0x15 bytes C++
  shell32.dll!76e939f6()  
  shell32.dll!76e7f5c1()  
  shell32.dll!76e7f55c()  
  shell32.dll!76e7f48d()  
  shell32.dll!76e7f4b0()  
  shell32.dll!76e7f4b0()  
  shell32.dll!76e7f661()  
  shell32.dll!76e80eee()  
  shell32.dll!76e8102f()  
  shell32.dll!76e8105d()  
  shell32.dll!76e810a6()  
  user32.dll!761a86ef()  
  user32.dll!761a8876()  
  user32.dll!761a881f()  
  user32.dll!761a70f4()  
  user32.dll!761a738f()  
  ntdll.dll!77a8642e()  
  user32.dll!761a914b()  
  user32.dll!761a9180()  
  user32.dll!761a92a9()  
  ole32.dll!7637d403()  
  ole32.dll!7637d47d()  
  user32.dll!761af0ab()  
  user32.dll!7619d4bc()  
  ole32.dll!7639b055()  
  ole32.dll!7639a5ed()  
  ole32.dll!7638365e()  
  ole32.dll!7638cba0()  
  ole32.dll!76398fd9()  
  ole32.dll!763949b1()  
  ole32.dll!7639aae3()  
  ole32.dll!7639aae3()  
  ole32.dll!7639badb()  
  ole32.dll!7649ba02()  
  ole32.dll!7638c8b5()  
  ole32.dll!7639e01f()  
  ole32.dll!7639e0f9()  
  ole32.dll!763a554a()  
  ole32.dll!763a4ab3()  
  ole32.dll!763a5472()  
  ole32.dll!7649c394()  
  ole32.dll!7638ce14()  
  ole32.dll!7649b644()  
  ole32.dll!7649bf21()  
  ole32.dll!7649bf21()  
  rpcrt4.dll!766ec1b3()  
  ntdll.dll!77a9e5fd()  
  ntdll.dll!77a9e5fd()  
  ntdll.dll!77a6ff1d()  
  ole32.dll!763b45f3()  
  ole32.dll!763b4515()  
  ole32.dll!763b464f()  
  ole32.dll!763b45f3()  
  ole32.dll!763b4515()  
  ole32.dll!763b48fc()  
  ole32.dll!763b5bb4()  
  ole32.dll!763b5916()  
  ole32.dll!763b5877()  
  ole32.dll!763b5830()  
  MyProxy.dll.dll!CBtProxyManager::GetPairedDevice(_ADDR_T * pDeviceAddr=0x02be0f78, _DEVICE_INFO_EX * pDeviceInfo=0x03b0b350)  Line 1384 + 0x1a bytes C++
  MyProxy.dll.dll!BtGetPairedDevice(_ADDR_T * pDeviceAddr=0x02be0f78, _DEVICE_INFO_EX * pDeviceInfo=0x03b0b350)  Line 430 + 0x13 bytes C++
  MyShellExt.dll.dll!RetrievePairedBthDeviceName(const unsigned __int64 & addr=0x000000137043ae45, wchar_t * pBuf=0x02be25c4, unsigned long cchBuf=0x00000200)  Line 311 + 0x10 bytes C++
  MyShellExt.dll.dll!CCSRBtShellRootFolder::CompareIDs(long lParam=0x10000000, const _ITEMIDLIST * pidl1=0x04285a18, const _ITEMIDLIST * pidl2=0x02be2a60)  Line 243 + 0x15 bytes C++
  shell32.dll!76e939f6()  
  shell32.dll!76e7f5c1()  
  shell32.dll!76e7f55c()  
  shell32.dll!76e7f48d()  
  shell32.dll!76e7f4b0()  
  shell32.dll!76e7f4b0()  
  shell32.dll!76e7f661()  
  shell32.dll!76e80eee()  
  shell32.dll!76e8102f()  
  shell32.dll!76e8105d()  
  shell32.dll!76e810a6()  
  user32.dll!761a86ef()  
  user32.dll!761a8876()  
  user32.dll!761a881f()  
  user32.dll!761a70f4()  
  user32.dll!761a738f()  
  ntdll.dll!77a8642e()  
  user32.dll!761a914b()  
  user32.dll!761a9180()  
  user32.dll!761a92a9()  
  ole32.dll!7637d403()  
  ole32.dll!7637d47d()  
  user32.dll!761af0ab()  
  user32.dll!7619d4bc()  
  ole32.dll!7639b055()  
  ole32.dll!7639a5ed()  
  ole32.dll!7638365e()  
  ole32.dll!7638cba0()  
  ole32.dll!76398fd9()  
  ole32.dll!7638cb09()  
  ole32.dll!7649bf75()  
  rpcrt4.dll!766d178b()  
  rpcrt4.dll!76745744()  
  rpcrt4.dll!766e1040()  
  ole32.dll!7638c8b5()  
  ole32.dll!7639e01f()  
  ole32.dll!7639e0f9()  
  ole32.dll!763a554a()  
  ole32.dll!763a4ab3()  
  ole32.dll!763a5472()  
  ole32.dll!7649b66f()  
  ole32.dll!763b8f09()  
  ole32.dll!763b26a7()  
  ole32.dll!7649b644()  
  ole32.dll!7649bf21()  
  rpcrt4.dll!766ec1b3()  
  ntdll.dll!77a9e5fd()  
  ntdll.dll!77a9e5fd()  
  ntdll.dll!77a6ff1d()  
  ole32.dll!763b45f3()  
  ole32.dll!763b4515()  
  ole32.dll!763b464f()  
  ole32.dll!763b45f3()  
  ole32.dll!763b4515()  
  ole32.dll!763b48fc()  
  ole32.dll!763b5bb4()  
  ole32.dll!763b5916()  
  ole32.dll!763b5877()  
  ole32.dll!763b5830()  
  MyProxy.dll.dll!CBtProxyManager::GetPairedDevice(_ADDR_T * pDeviceAddr=0x02bea968, _DEVICE_INFO_EX * pDeviceInfo=0x03b0b120)  Line 1384 + 0x1a bytes C++
  MyProxy.dll.dll!BtGetPairedDevice(_ADDR_T * pDeviceAddr=0x02bea968, _DEVICE_INFO_EX * pDeviceInfo=0x03b0b120)  Line 430 + 0x13 bytes C++
  MyShellExt.dll.dll!RetrievePairedBthDeviceName(const unsigned __int64 & addr=0x000000137043ae45, wchar_t * pBuf=0x02bebfb4, unsigned long cchBuf=0x00000200)  Line 311 + 0x10 bytes C++
  MyShellExt.dll.dll!CCSRBtShellRootFolder::CompareIDs(long lParam=0x10000000, const _ITEMIDLIST * pidl1=0x04285a18, const _ITEMIDLIST * pidl2=0x02bec450)  Line 243 + 0x15 bytes C++
  shell32.dll!76e939f6()  
  shell32.dll!76e7f5c1()  
  shell32.dll!76e7f55c()  
  shell32.dll!76e7f48d()  
  shell32.dll!76e7f4b0()  
  shell32.dll!76e7f4b0()  
  shell32.dll!76e7f661()  
  shell32.dll!76e80eee()  
  shell32.dll!76e8102f()  
  shell32.dll!76e8105d()  
  shell32.dll!76e810a6()  
  user32.dll!761a86ef()  
  user32.dll!761a8876()  
  user32.dll!761a881f()  
  user32.dll!761a70f4()  
  user32.dll!761a738f()  
  ntdll.dll!77a8642e()  
  user32.dll!761a914b()  
  user32.dll!761a9180()  
  user32.dll!761a92a9()  
  ole32.dll!7637d403()  
  ole32.dll!7637d47d()  
  user32.dll!761af0ab()  
  user32.dll!7619d4bc()  
  ole32.dll!7639b055()  
  ole32.dll!7639a5ed()  
  ole32.dll!7638365e()  
  ole32.dll!7638cba0()  
  ole32.dll!76398fd9()  
  ole32.dll!7638cb09()  
  ole32.dll!7649bf75()  
  rpcrt4.dll!766d178b()  
  rpcrt4.dll!76745744()  
  ntdll.dll!77a8491c()  
  KernelBase.dll!75e46ac4()  
  ole32.dll!76445e64()  
  ole32.dll!76445e90()  
  ole32.dll!763b8f2d()  
  ole32.dll!7649b66f()  
  ole32.dll!763b8f09()  
  ole32.dll!763b26a7()  
  ole32.dll!7649b644()  
  ole32.dll!7649bf21()  
  rpcrt4.dll!766ec1b3()  
  ntdll.dll!77a9e5fd()  
  ntdll.dll!77a9e5fd()  
  ntdll.dll!77a6ff1d()  
  ole32.dll!763b45f3()  
  ole32.dll!763b4515()  
  ole32.dll!763b464f()  
  ole32.dll!763b45f3()  
  ole32.dll!763b4515()  
  ole32.dll!763b48fc()  
  ole32.dll!763b5bb4()  
  ole32.dll!763b5916()  
  ole32.dll!763b5877()  
  ole32.dll!763b5830()  
  MyProxy.dll.dll!CBtProxyManager::GetPairedDevice(_ADDR_T * pDeviceAddr=0x02bf4358, _DEVICE_INFO_EX * pDeviceInfo=0x03b0aef0)  Line 1384 + 0x1a bytes C++
  MyProxy.dll.dll!BtGetPairedDevice(_ADDR_T * pDeviceAddr=0x02bf4358, _DEVICE_INFO_EX * pDeviceInfo=0x03b0aef0)  Line 430 + 0x13 bytes C++
  MyShellExt.dll.dll!RetrievePairedBthDeviceName(const unsigned __int64 & addr=0x000000137043ae45, wchar_t * pBuf=0x02bf59a4, unsigned long cchBuf=0x00000200)  Line 311 + 0x10 bytes C++
  MyShellExt.dll.dll!CCSRBtShellRootFolder::CompareIDs(long lParam=0x10000000, const _ITEMIDLIST * pidl1=0x04285a18, const _ITEMIDLIST * pidl2=0x02bf5e40)  Line 243 + 0x15 bytes C++
  shell32.dll!76e939f6()  
  shell32.dll!76e7f5c1()  
  shell32.dll!76e7f55c()  
  shell32.dll!76e7f48d()  
  shell32.dll!76e7f4b0()  
  shell32.dll!76e7f4b0()  
  shell32.dll!76e7f661()  
  shell32.dll!76e80eee()  
  shell32.dll!76e8102f()  
  shell32.dll!76e8105d()  
  shell32.dll!76e810a6()  
  user32.dll!761a86ef()  
  user32.dll!761a8876()  
  user32.dll!761a881f()  
  user32.dll!761a70f4()  
  user32.dll!761a738f()  
  ntdll.dll!77a8642e()  
  user32.dll!761a914b()  
  user32.dll!761a9180()  
  user32.dll!761a92a9()  
  ole32.dll!7637d403()  
  ole32.dll!7637d47d()  
  user32.dll!761af0ab()  
  user32.dll!7619d4bc()  
  ole32.dll!7639b055()  
  ole32.dll!7639a5ed()  
  ole32.dll!7638365e()  
  ole32.dll!7638cba0()  
  ole32.dll!76398fd9()  
  ole32.dll!7638cb09()  
  ole32.dll!7649bf75()  
  rpcrt4.dll!766d178b()  
  rpcrt4.dll!76745744()  
  ntdll.dll!77a9e5fd()  
  ntdll.dll!77a93b27()  
  ntdll.dll!77a92149()  
  ole32.dll!7639aae3()  
  ole32.dll!7639aae3()  
  ole32.dll!7639badb()  
  ole32.dll!7638cbc3()  
  ole32.dll!7649b66f()  
  ole32.dll!763b8f09()  
  ole32.dll!763b26a7()  
  ntdll.dll!77a9e5fd()  
  ntdll.dll!77a9e5fd()  
  ntdll.dll!77a6ff1d()  
  ole32.dll!763b45f3()  
  ole32.dll!763b4515()  
  ole32.dll!763b464f()  
  ole32.dll!763b45f3()  
  ole32.dll!763b4515()  
  ole32.dll!763b48fc()  
  ole32.dll!763b5bb4()  
  ole32.dll!763b5916()  
  ole32.dll!763b5877()  
  ole32.dll!763b5830()  
  MyProxy.dll!CBtProxyManager::GetPairedDevice(_ADDR_T * pDeviceAddr=0x02bfdd48, _DEVICE_INFO_EX * pDeviceInfo=0x03b09650)  Line 1384 + 0x1a bytes C++
  MyProxy.dll!BtGetPairedDevice(_ADDR_T * pDeviceAddr=0x02bfdd48, _DEVICE_INFO_EX * pDeviceInfo=0x03b09650)  Line 430 + 0x13 bytes C++
  MyShellExt.dll!RetrievePairedBthDeviceName(const unsigned __int64 & addr=0x000000137043ae45, wchar_t * pBuf=0x02bff394, unsigned long cchBuf=0x00000200)  Line 311 + 0x10 bytes C++
  MyShellExt.dll!CCSRBtShellRootFolder::CompareIDs(long lParam=0x10000000, const _ITEMIDLIST * pidl1=0x04285a18, const _ITEMIDLIST * pidl2=0x02bff830)  Line 243 + 0x15 bytes C++
  shell32.dll!76e939f6()  
  shell32.dll!76e7f5c1()  
  shell32.dll!76e7f55c()  
  shell32.dll!76e7f48d()  
  shell32.dll!76e7f4b0()  
  shell32.dll!76e7f4b0()  
  shell32.dll!76e7f661()  
  shell32.dll!76e80eee()  
  shell32.dll!76e8102f()  
  shell32.dll!76e8105d()  
  shell32.dll!76e810a6()  
  user32.dll!761a86ef()  
  user32.dll!761a8876()  
  user32.dll!761a881f()  
  user32.dll!761a70f4()  
  user32.dll!761a738f()  
  ntdll.dll!77a8642e()  
  user32.dll!761a914b()  
  user32.dll!761a9180()  
  user32.dll!761a92a9()  
  shell32.dll!76e8a34b()  
  shell32.dll!76e8a313()  
  shell32.dll!76df5359()  
  shlwapi.dll!768f46bc()  
  kernel32.dll!76101194()  
  ntdll.dll!77a9b3f5()  
  ntdll.dll!77a9b3c8()  

 

can anyone give me some hint what’s wrong with it.

Viv..

Hello Viv,This does not appear to be a question related to ATL or MFC.  Can you find a more appropriate forum?  Thanks!Pat Brenner, Visual C++ Libraries Development