EDN Admin
Well-known member
Dear all,
I have an urgent issue and need your help! Thanks in advance!
I have a C# winform client and make calls to a COM Server which is in another thread. The threading model of the CoClass is neutral. When I make calls to the COM Server, I got an exception:
0:013> !pe
Exception object: 015f89b0
Exception type: System.InvalidCastException
Message: Unable to cast COM object of type System.__ComObject to interface type PrdUIServers.IRunManagerUIServer. This operation failed because the QueryInterface call on the COM component for the interface with IID {50AC90A8-B7A1-46D5-B712-F62615F4F198}
failed due to the following error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)).
InnerException: <none>
StackTrace (generated):
SP IP Function
0D70F504 07E20B81 DataImportControl!HAL.DataImportControl.ImportedRunMgr.AssociateToolString()+0x31
0D70F518 07E20968 DataImportControl!HAL.DataImportControl.CreateJobImporter.AssociateToolstring()+0x10
0D70F51C 0659D80E DataImportControl!HAL.DataImportControl.DataImportStateMachine.EventHandlerWorkerThread(System.Object)+0x6e
0D70F534 792C9EEF mscorlib_ni!System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(System.Object)+0x2f
0D70F53C 792E02CF mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)+0x6f
0D70F554 792CA453 mscorlib_ni!System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(System.Threading._ThreadPoolWaitCallback)+0x53
0D70F568 792CA2E9 mscorlib_ni!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(System.Object)+0x59
StackTraceString: <none>
HResult: 80004002
Then I list the thread state:
0:013> !COMState
ID TEB APT APTId CallerTID Context
0 ad8 7ffdf000 STA e77 0 00173cc0
1 1230 7ffde000 Ukn
2 5bc 7ffdd000 MTA 0 0 00173e30
3 ac8 7ffd8000 Ukn
4 c8c 7ffd6000 STA 0 0 00173ee8
5 f64 7ff4f000 MTA 0 0 00173e30
6 c98 7ffd7000 MTA 0 0 00173e30
7 1474 7ffd5000 Ukn
8 150c 7ff4c000 Ukn
9 1528 7ff4e000 MTA 0 0 00173e30
10 a10 7ff4b000 MTA 0 0 00173e30
11 15ec 7ff4a000 Ukn
12 11ec 7ff49000 MTA 0 0 00173e30
13 151c 7ff48000 MTA 0 0 00173e30
14 13d0 7ff45000 Ukn 0 0 00000000
15 f28 7ff4d000 Ukn 0 0 00000000
16 14fc 7ffdb000 Ukn 0 0 00000000
17 cb0 7ffda000 Ukn
As you can see that the 13 thread apartment is already MTA.
Then I dump the stacks.
0:013> !dumpstack
OS Thread Id: 0x151c (13)
Current frame: ntdll!KiFastSystemCallRet
ChildEBP RetAddr Caller,Callee
0d70e1f0 7c90df4a ntdll!ZwWaitForMultipleObjects+0xc
0d70e1f4 7c809574 kernel32!WaitForMultipleObjectsEx+0x12c, calling ntdll!NtWaitForMultipleObjects
0d70e228 7c80ba76 kernel32!VirtualQuery+0x15, calling kernel32!VirtualQueryEx
0d70e250 79e79cea mscorwks!ClrFlsSetValue+0x57, calling mscorwks!_EH_epilog3
0d70e278 79e79cea mscorwks!ClrFlsSetValue+0x57, calling mscorwks!_EH_epilog3
0d70e290 7c80a105 kernel32!WaitForMultipleObjects+0x18, calling kernel32!WaitForMultipleObjectsEx
0d70e2ac 7a2d9585 mscorwks!Debugger::EnsureDebuggerAttached+0x9f, calling kernel32!WaitForMultipleObjects
0d70e2f4 7a2da7cd mscorwks!Debugger::SendException+0x1ba, calling mscorwks!Debugger::EnsureDebuggerAttached
0d70e320 79e821f9 mscorwks!CallDescrWorkerWithHandler+0xa3, calling mscorwks!CallDescrWorker
0d70e33c 79e72032 mscorwks!_SEH_epilog4_GS+0xa, calling mscorwks!__security_check_cookie
0d70e340 79e82236 mscorwks!CallDescrWorkerWithHandler+0x1af, calling mscorwks!_SEH_epilog4_GS
0d70e354 7c812aeb kernel32!RaiseException+0x53, calling ntdll!RtlRaiseException
0d70e3dc 79e96920 mscorwks!MetaSig::MetaSig+0x3a, calling msvcr80!memcpy
0d70e3f8 79e964be mscorwks!MethodDesc::CallDescr+0xbb, calling mscorwks!_alloca_probe_16
0d70e45c 79e96436 mscorwks!MethodDesc::CallDescr+0x1f, calling mscorwks!_alloca_probe_16
0d70e468 79e96581 mscorwks!MethodDesc::CallDescr+0x1ac, calling mscorwks!__security_check_cookie
0d70e4a8 79e96436 mscorwks!MethodDesc::CallDescr+0x1f, calling mscorwks!_alloca_probe_16
0d70e4b4 79e96581 mscorwks!MethodDesc::CallDescr+0x1ac, calling mscorwks!__security_check_cookie
0d70e4ec 79e965a4 mscorwks!MethodDesc::CallTargetWorker+0x1f, calling mscorwks!MethodDesc::CallDescr
0d70e508 79e965c2 mscorwks!MethodDescCallSite::Call+0x1a, calling mscorwks!MethodDesc::CallTargetWorker
0d70e510 79e7d9f5 mscorwks!CLRException::HandlerState::CleanupTry+0x16, calling mscorwks!GetCurrentSEHRecord
0d70e524 7a04a9c9 mscorwks!COMDelegate::BindToMethodInfo+0x548, calling mscorwks!CLRException::HandlerState::CleanupTry
0d70e528 79e7c85c mscorwks!_EH_epilog3_catch_GS+0xa, calling mscorwks!__security_check_cookie
0d70e52c 7a04a9db mscorwks!COMDelegate::BindToMethodInfo+0x66e, calling mscorwks!_EH_epilog3_catch_GS
0d70e574 79e8f02f mscorwks!Thread::StackWalkFramesEx+0x693, calling mscorwks!Thread::MakeStackwalkerCallback
0d70e600 79e96436 mscorwks!MethodDesc::CallDescr+0x1f, calling mscorwks!_alloca_probe_16
0d70e60c 79e96581 mscorwks!MethodDesc::CallDescr+0x1ac, calling mscorwks!__security_check_cookie
0d70e658 79e7d9f5 mscorwks!CLRException::HandlerState::CleanupTry+0x16, calling mscorwks!GetCurrentSEHRecord
0d70e66c 7a04adea mscorwks!DistributeUnhandledExceptionReliably+0xee, calling mscorwks!CLRException::HandlerState::CleanupTry
0d70e670 79e7c85c mscorwks!_EH_epilog3_catch_GS+0xa, calling mscorwks!__security_check_cookie
0d70e674 7a04ae18 mscorwks!DistributeUnhandledExceptionReliably+0x1e2, calling mscorwks!_EH_epilog3_catch_GS
0d70e6b0 79e821f9 mscorwks!CallDescrWorkerWithHandler+0xa3, calling mscorwks!CallDescrWorker
0d70e6b4 7c90df4a ntdll!ZwWaitForMultipleObjects+0xc
0d70e6b8 7c809574 kernel32!WaitForMultipleObjectsEx+0x12c, calling ntdll!NtWaitForMultipleObjects
0d70e6c4 7c8095b6 kernel32!WaitForMultipleObjectsEx+0x187, calling ntdll!RtlDeactivateActivationContextUnsafeFast
0d70e6cc 7c8095a4 kernel32!WaitForMultipleObjectsEx+0x17a, calling kernel32!_SEH_epilog
0d70e71c 79e79d91 mscorwks!UnsafeEELeaveCriticalSection+0x25, calling mscorwks!DECTHREADNONHOSTLOCKCOUNT
0d70e728 79e79d52 mscorwks!CrstBase::Leave+0x8c, calling mscorwks!UnsafeEELeaveCriticalSection
0d70e72c 79e79d6b mscorwks!CrstBase::Leave+0xab, calling mscorwks!_EH_epilog3
0d70e754 79e79d6b mscorwks!CrstBase::Leave+0xab, calling mscorwks!_EH_epilog3
0d70e758 79e79d30 mscorwks!Holder<CrstBase *,&CrstBase::AcquireLock,&CrstBase::ReleaseLock,0,&CompareDefault<CrstBase *>,1>::~Holder<CrstBase *,&CrstBase::AcquireLock,&CrstBase::ReleaseLock,0,&CompareDefault<CrstBase
*>,1>+0x2b, calling mscorwks!_EH_epilog3
0d70e77c 79e79d30 mscorwks!Holder<CrstBase *,&CrstBase::AcquireLock,&CrstBase::ReleaseLock,0,&CompareDefault<CrstBase *>,1>::~Holder<CrstBase *,&CrstBase::AcquireLock,&CrstBase::ReleaseLock,0,&CompareDefault<CrstBase
*>,1>+0x2b, calling mscorwks!_EH_epilog3
0d70e794 7a2db49d mscorwks!Debugger::LastChanceManagedException+0x14d, calling mscorwks!Debugger::SendException
0d70e7a0 7c812aeb kernel32!RaiseException+0x53, calling ntdll!RtlRaiseException
0d70e7d4 7a02f3ec mscorwks!AppDomain::OnUnhandledException+0x96, calling mscorwks!_EH_epilog3
0d70e834 7a0973c9 mscorwks!IsStackOverflowException+0xb4
0d70e8b0 7a0477d7 mscorwks!DoFaultReportWorker+0xe5d, calling mscorwks!_EH_epilog3_catch_GS
0d70e8b4 7a048832 mscorwks!DoFaultReport+0xc3, calling mscorwks!DoFaultReportWorker
0d70e8c8 7a097369 mscorwks!IsStackOverflowException+0x54, calling mscorwks!_alloca_probe_16
0d70e8ec 7a09754a mscorwks!WatsonLastChance+0x140, calling mscorwks!IsStackOverflowException+0x32
0d70e914 7a09c0af mscorwks!CLRAddVectoredHandlers+0x209, calling mscorwks!WatsonLastChance
0d70e954 7c809ef0 kernel32!IsBadReadPtr+0x5c, calling kernel32!_SEH_epilog
0d70e96c 7a09c15b mscorwks!InternalUnhandledExceptionFilter+0x22, calling mscorwks!CLRAddVectoredHandlers+0x70
0d70e974 7c35f0c3 msvcr71!__CxxUnhandledExceptionFilter+0x46, calling mscorwks!COMUnhandledExceptionFilter
0d70e980 00cf6302 ime_srv!CanUnload+0x4452, calling msvcr71!__CxxUnhandledExceptionFilter
0d70e98c 7c864031 kernel32!UnhandledExceptionFilter+0x1c7
0d70e9a0 7c834b66 kernel32!BaseDllFormatMessage+0x29a, calling kernel32!_SEH_epilog
0d70e9b4 79e7e121 mscorwks!HndWriteBarrier+0x21, calling mscorwks!HandleFetchType
0d70e9c0 78132c78 msvcr80!__set_flsgetvalue+0xd, calling kernel32!TlsGetValue
0d70e9cc 78132e24 msvcr80!_getptd_noexit+0x72, calling ntdll!RtlSetLastWin32Error
0d70e9dc 78132e2f msvcr80!_getptd+0x6, calling msvcr80!_getptd_noexit
0d70e9e4 78137021 msvcr80!_LocaleUpdate::_LocaleUpdate+0x14, calling msvcr80!_getptd
0d70e9ec 78152cf7 msvcr80!_towupper_l+0x21, calling msvcr80!_LocaleUpdate::_LocaleUpdate
0d70ea10 78152d8f msvcr80!towupper+0xb, calling msvcr80!_towupper_l
0d70ea1c 79e8ff88 mscorwks!HashiString+0x16, calling msvcr80!towupper
0d70ea30 79f74481 mscorwks!ProbabilisticNameSet::GetBitIndex+0x1e, calling mscorwks!HashiString
0d70ea3c 79f744bc mscorwks!ProbabilisticNameSet::MayContain+0x19, calling mscorwks!ProbabilisticNameSet::GetBitIndex
0d70ea5c 79f744ed mscorwks!REGUTIL::EnvCacheValueNameSeenPerhaps+0x19, calling mscorwks!ProbabilisticNameSet::MayContain
0d70ea68 79e7f1e8 mscorwks!_EH_epilog3_GS+0xa, calling mscorwks!__security_check_cookie
0d70ea6c 79f74423 mscorwks!REGUTIL::EnvGetString+0x110, calling mscorwks!_EH_epilog3_GS
0d70ea78 78132c78 msvcr80!__set_flsgetvalue+0xd, calling kernel32!TlsGetValue
0d70ea84 78132e24 msvcr80!_getptd_noexit+0x72, calling ntdll!RtlSetLastWin32Error
0d70ea94 78132e2f msvcr80!_getptd+0x6, calling msvcr80!_getptd_noexit
0d70ea9c 78137021 msvcr80!_LocaleUpdate::_LocaleUpdate+0x14, calling msvcr80!_getptd
0d70eaa4 78152cf7 msvcr80!_towupper_l+0x21, calling msvcr80!_LocaleUpdate::_LocaleUpdate
0d70eac8 78152d8f msvcr80!towupper+0xb, calling msvcr80!_towupper_l
0d70eae8 79f74481 mscorwks!ProbabilisticNameSet::GetBitIndex+0x1e, calling mscorwks!HashiString
0d70eaf4 79f744bc mscorwks!ProbabilisticNameSet::MayContain+0x19, calling mscorwks!ProbabilisticNameSet::GetBitIndex
0d70eb14 79f74460 mscorwks!REGUTIL::RegCacheValueNameSeenPerhaps+0x32, calling mscorwks!ProbabilisticNameSet::MayContain
0d70eb20 79f74547 mscorwks!REGUTIL::GetConfigDWORD+0x81, calling mscorwks!REGUTIL::RegCacheValueNameSeenPerhaps
0d70eb38 79f52562 mscorwks!ExceptionIsAlwaysSwallowed+0x8c, calling mscorwks!_EH_epilog3
0d70eb50 7a0a5685 mscorwks!ThreadExceptionState::MaybeEagerlyCaptureUnhandledInfoForWatson+0x1d, calling mscorwks!REGUTIL::GetConfigDWORD
0d70eb68 7a09b9f9 mscorwks!DefaultCatchHandler+0x64e, calling mscorwks!ThreadExceptionState::MaybeEagerlyCaptureUnhandledInfoForWatson
0d70eb80 79f525e1 mscorwks!ThreadBaseExceptionSwallowingFilter+0x11, calling mscorwks!DefaultCatchHandler+0x5eb
0d70eb94 79f5180e mscorwks!ManagedThreadCallState::IsAppDomainEqual+0xa7
0d70eb9c 79f5183a mscorwks!ManagedThreadCallState::IsAppDomainEqual+0x56, calling mscorwks!_EH_epilog3
0d70eba0 7c910323 ntdll!RtlpImageNtHeader+0x56, calling ntdll!_SEH_epilog
0d70ebb8 7c90d98a ntdll!NtQueryVirtualMemory+0xc
0d70ebbc 7c880a31 kernel32!_ValidateEH3RN+0xb6, calling ntdll!ZwQueryVirtualMemory
0d70ebfc 7c83ab38 kernel32!BaseThreadStart+0x4d, calling kernel32!UnhandledExceptionFilter
0d70ec04 7c839b21 kernel32!_except_handler3+0x61
0d70ec2c 7c9032a8 ntdll!ExecuteHandler2+0x26
0d70ec50 7c90327a ntdll!ExecuteHandler+0x24, calling ntdll!ExecuteHandler2
0d70ec74 7c92aa0f ntdll!RtlDispatchException+0xb1, calling ntdll!RtlpExecuteHandlerForException
0d70eca0 7c910041 ntdll!RtlFreeHeap+0x1e9, calling ntdll!RtlpFreeToHeapLookaside
0d70eca8 7c91005d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0d70ed00 7c90e48a ntdll!KiUserExceptionDispatcher+0xe, calling ntdll!RtlDispatchException
0d70effc 7c812aeb kernel32!RaiseException+0x53 ====> Exception cxr@d70ed30
0d70ed20 7c812aeb kernel32!RaiseException+0x53, calling ntdll!RtlRaiseException
0d70ed88 3ff7afff msi!CMsiDatabase:erefTemporaryString+0x4
0d70ede4 7c812aeb kernel32!RaiseException+0x53, calling ntdll!RtlRaiseException
0d70ee2c 7c910222 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling ntdll!_SEH_epilog
0d70eedc 7c91005d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0d70eee0 79e7a1b6 mscorwks!EEHeapFree+0x98, calling ntdll!RtlFreeHeap
0d70ef40 7c910222 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling ntdll!_SEH_epilog
0d70ef44 7c91019b ntdll!RtlAllocateHeap+0x1c2, calling ntdll!RtlpAllocateFromHeapLookaside
0d70ef48 7c9101db ntdll!RtlAllocateHeap+0xeac, calling ntdll!_SEH_epilog
0d70ef60 79f4a8bc mscorwks!ThreadpoolMgr:eleteTimer+0x95, calling mscorwks!ThreadpoolMgr::QueueTimerInfoForRelease
0d70ef64 79f4a8c1 mscorwks!ThreadpoolMgr:eleteTimer+0x9a, calling mscorwks!_EH_epilog3
0d70ef78 7c910222 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling ntdll!_SEH_epilog
0d70ef84 7c9100b8 ntdll!RtlpFreeToHeapLookaside+0x22, calling ntdll!RtlpInterlockedPushEntrySList
0d70ef90 7c910041 ntdll!RtlFreeHeap+0x1e9, calling ntdll!RtlpFreeToHeapLookaside
0d70ef98 7c91005d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0d70efe4 7c82c132 kernel32!BaseDispatchAPC+0x38, calling kernel32!_SEH_epilog
0d70efe8 7c90d06a ntdll!NtContinue+0xc
0d70efec 7c90e45f ntdll!KiUserApcDispatcher+0xf, calling ntdll!NtContinue
0d70f008 7c812aeb kernel32!RaiseException+0x53, calling ntdll!RtlRaiseException
0d70f01c 79e8006c mscorwks!Binder::RawGetClass+0x20, calling mscorwks!Module::LookupTypeDef
0d70f02c 79e806cf mscorwks!Binder::IsClass+0x23, calling mscorwks!Binder::RawGetClass
0d70f038 79ef2a4f mscorwks!Binder::IsException+0x14, calling mscorwks!Binder::IsClass
0d70f048 79ef2a76 mscorwks!IsExceptionOfType+0x23, calling mscorwks!Binder::IsException
0d70f050 79ef2bfc mscorwks!RaiseTheExceptionInternalOnly+0x2a8, calling kernel32!RaiseException
0d70f0b0 79f51c84 mscorwks!UnwindAndContinueRethrowHelperAfterCatch+0x70, calling mscorwks!RaiseTheExceptionInternalOnly
0d70f0e8 7a0259c3 mscorwks!ComObject::GetComIPFromRCWEx+0xba, calling mscorwks!UnwindAndContinueRethrowHelperAfterCatch
0d70f150 79fc7d16 mscorwks!ComObject::StaticGetComIPFromRCWEx+0x50, calling mscorwks!ComObject::GetComIPFromRCWEx
0d70f19c 0412b9b7 0412b9b7, calling mscorwks!ComObject::StaticGetComIPFromRCWEx
0d70f208 7c90fdc2 ntdll!RtlQueryInformationActivationContext+0x310, calling ntdll!RtlpQueryInformationActivationContextBasicInformation
0d70f224 7c90fddd ntdll!RtlQueryInformationActivationContext+0x32b, calling ntdll!_SEH_epilog
0d70f274 7c90fddd ntdll!RtlQueryInformationActivationContext+0x32b, calling ntdll!_SEH_epilog
0d70f278 7c82c0a1 kernel32!QueueUserAPC+0x27, calling ntdll!RtlQueryInformationActivationContext
0d70f280 7c90d9aa ntdll!ZwQueueApcThread+0xc
0d70f284 7c82c0cc kernel32!QueueUserAPC+0x64, calling ntdll!NtQueueApcThread
0d70f2a4 79f4a65d mscorwks!Holder<ThreadpoolMgr::TimerInfo *,&ThreadpoolMgr::AcquireTimerInfo,&ThreadpoolMgr::ReleaseTimerInfo,0,&CompareDefault<ThreadpoolMgr::TimerInfo *>,2>::~Holder<ThreadpoolMgr::TimerInfo *,&ThreadpoolMgr::AcquireTimerInfo,&ThreadpoolMgr::ReleaseTimerInfo,0,&CompareDefault<ThreadpoolMgr::TimerInfo
*>,2>+0x2b, calling mscorwks!_EH_epilog3
0d70f30c 79f75e03 mscorwks!WKS::gc_heap::try_allocate_more_space+0x5bb, calling mscorwks!WKS::gc_heap::adjust_limit_clr
0d70f314 79e73219 mscorwks!HelperMethodFrame::LazyInit+0x17, calling (JitHelp: CORINFO_HELP_GET_THREAD)
0d70f31c 79e731fc mscorwks!HelperMethodFrame::HelperMethodFrame+0x1d, calling mscorwks!HelperMethodFrame::LazyInit
0d70f32c 79e7cd2b mscorwks!HelperMethodFrame_PROTECTOBJ::HelperMethodFrame_PROTECTOBJ+0x14, calling mscorwks!HelperMethodFrame::HelperMethodFrame
0d70f348 79e8d3a4 mscorwks!Int32ToDecStr+0xe1, calling mscorwks!_EH_epilog3
0d70f34c 79e8d287 mscorwks!COMNumber::FormatInt32+0x1d8, calling mscorwks!Int32ToDecStr
0d70f354 79e7c85c mscorwks!_EH_epilog3_catch_GS+0xa, calling mscorwks!__security_check_cookie
0d70f358 79e8d2ef mscorwks!COMNumber::FormatInt32+0x244, calling mscorwks!_EH_epilog3_catch_GS
0d70f374 79e79d52 mscorwks!CrstBase::Leave+0x8c, calling mscorwks!UnsafeEELeaveCriticalSection
0d70f39c 79e8d193 mscorwks!COMNumber::FormatInt32+0x39, calling mscorwks!LazyMachStateCaptureState
0d70f40c 79eb6e06 mscorwks!MethodDesc:oBackpatch+0x6d, calling mscorwks!Precode::SetTargetInterlocked
0d70f434 79e7f449 mscorwks!MethodDesc:oPrestub+0x50b, calling mscorwks!MethodDesc:oBackpatch
0d70f43c 79e8127d mscorwks!MethodDesc:oPrestub+0x517, calling mscorwks!_EH_epilog3
0d70f450 79e73219 mscorwks!HelperMethodFrame::LazyInit+0x17, calling (JitHelp: CORINFO_HELP_GET_THREAD)
0d70f458 79e731fc mscorwks!HelperMethodFrame::HelperMethodFrame+0x1d, calling mscorwks!HelperMethodFrame::LazyInit
0d70f468 79e73247 mscorwks!FrameWithCookie<HelperMethodFrame>::FrameWithCookie<HelperMethodFrame>+0x1e, calling mscorwks!HelperMethodFrame::HelperMethodFrame
0d70f48c 79e813e4 mscorwks!PreStubWorker+0x139, calling ntdll!RtlSetLastWin32Error
0d70f490 79e813ec mscorwks!PreStubWorker+0x141, calling mscorwks!_EH_epilog3
0d70f4d4 07e20b81 (MethodDesc 0x6c50914 +0x31 xxx.HAL.xxxDataImportControl.ImportedRunMgr.AssociateToolString()), calling 00939ede
0d70f4f4 07e20b81 (MethodDesc 0x6c50914 +0x31 xxx.HAL.xxxDataImportControl.ImportedRunMgr.AssociateToolString()), calling 00939ede
0d70f510 07e20968 (MethodDesc 0x80e36cc +0x10 xxx.HAL.xxxDataImportControl.CreateJobImporter.AssociateToolstring()), calling (MethodDesc 0x6c50914 +0 xxx.HAL.xxxDataImportControl.ImportedRunMgr.AssociateToolString())
0d70f514 0659d80e (MethodDesc 0x80e4ba0 +0x6e xxx.HAL.xxxDataImportControl.DataImportStateMachine.EventHandlerWorkerThread(System.Object))
0d70f52c 792c9eef (MethodDesc 0x790fc9c0 +0x2f System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(System.Object))
0d70f534 792e02cf (MethodDesc 0x7910277c +0x6f System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object))
0d70f548 792ca453 (MethodDesc 0x790fc9d8 +0x53 System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(System.Threading._ThreadPoolWaitCallback)), calling (MethodDesc 0x7910277c +0 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object))
0d70f560 792ca2e9 (MethodDesc 0x790fc9cc +0x59 System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(System.Object)), calling (MethodDesc 0x790fc9d8 +0 System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(System.Threading._ThreadPoolWaitCallback))
0d70f578 79e71b4c mscorwks!CallDescrWorker+0x33
0d70f588 79e821f9 mscorwks!CallDescrWorkerWithHandler+0xa3, calling mscorwks!CallDescrWorker
0d70f608 79e8285f mscorwks!DispatchCallBody+0x1e, calling mscorwks!CallDescrWorkerWithHandler
0d70f628 79e828a0 mscorwks!DispatchCallDebuggerWrapper+0x3d, calling mscorwks!DispatchCallBody
0d70f68c 79e82911 mscorwks!DispatchCallNoEH+0x51, calling mscorwks!DispatchCallDebuggerWrapper
0d70f6c0 79f47ba5 mscorwks!QueueUserWorkItemManagedCallback+0x59, calling mscorwks!DispatchCallNoEH
0d70f71c 79e984cf mscorwks!Thread:oADCallBack+0x32a
0d70f730 79e9846b mscorwks!Thread::ShouldChangeAbortToUnload+0xe3, calling mscorwks!Thread:oADCallBack+0x2db
0d70f758 79e8c4c7 mscorwks!Thread::EnterRuntimeNoThrow+0xad, calling ntdll!RtlSetLastWin32Error
0d70f75c 79e8c4ce mscorwks!Thread::EnterRuntimeNoThrow+0xb4, calling mscorwks!_EH_epilog3
0d70f7c4 79e98391 mscorwks!Thread::ShouldChangeAbortToUnload+0x30a, calling mscorwks!Thread::ShouldChangeAbortToUnload+0x32
0d70f800 79e9851d mscorwks!Thread::ShouldChangeAbortToUnload+0x33e, calling mscorwks!Thread::ShouldChangeAbortToUnload+0x29d
0d70f828 79ec4ac4 mscorwks!ManagedThreadBase::ThreadPool+0x13, calling mscorwks!Thread::ShouldChangeAbortToUnload+0x319
0d70f840 79f4783a mscorwks!ManagedPerAppDomainTPCount:ispatchWorkItem+0xe9, calling mscorwks!ManagedThreadBase::ThreadPool
0d70f894 79ec4b3f mscorwks!PerAppDomainTPCountList::GetAppDomainIndexForThreadpoolDispatch+0x35
0d70f8a8 79ec475e mscorwks!ThreadpoolMgr::ExecuteWorkRequest+0xaf
0d70f8bc 79ec48d2 mscorwks!ThreadpoolMgr::WorkerThreadStart+0x20b, calling mscorwks!ThreadpoolMgr::ExecuteWorkRequest
0d70f914 79f75765 mscorwks!Thread::intermediateThreadProc+0x49
0d70f938 7c910222 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling ntdll!_SEH_epilog
0d70f93c 7c91019b ntdll!RtlAllocateHeap+0x1c2, calling ntdll!RtlpAllocateFromHeapLookaside
0d70f940 7c9101db ntdll!RtlAllocateHeap+0xeac, calling ntdll!_SEH_epilog
0d70f95c 7c910222 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling ntdll!_SEH_epilog
0d70f988 7c910222 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling ntdll!_SEH_epilog
0d70f98c 7c91019b ntdll!RtlAllocateHeap+0x1c2, calling ntdll!RtlpAllocateFromHeapLookaside
0d70f990 7c9101db ntdll!RtlAllocateHeap+0xeac, calling ntdll!_SEH_epilog
0d70fa0c 7c917e09 ntdll!LdrpGetProcedureAddress+0xa6, calling ntdll!_SEH_epilog
0d70fa10 7c918047 ntdll!LdrpSnapThunk+0x317, calling ntdll!LdrpGetProcedureAddress
0d70fa60 7c917dba ntdll!LdrpGetProcedureAddress+0x186, calling ntdll!LdrpSnapThunk
0d70fa78 7c917e5f ntdll!LdrpGetProcedureAddress+0x29b, calling ntdll!RtlLeaveCriticalSection
0d70fa80 7c917e09 ntdll!LdrpGetProcedureAddress+0xa6, calling ntdll!_SEH_epilog
0d70fb28 7c917e09 ntdll!LdrpGetProcedureAddress+0xa6, calling ntdll!_SEH_epilog
0d70fb2c 7c917ec0 ntdll!LdrGetProcedureAddress+0x18, calling ntdll!LdrpGetProcedureAddress
0d70fb64 7c9101db ntdll!RtlAllocateHeap+0xeac, calling ntdll!_SEH_epilog
0d70fb90 0e511bc6 urlmon!DllMain+0x17e, calling urlmon!TlsDllMain
0d70fb98 564176d4 GenericRoutines!ATL::CAtlDllModuleT<CGenericRoutinesModule>:llMain+0x14 [crogram filesmicrosoft visual studio 9.0vcatlmfcincludeatlbase.h:3180], calling GenericRoutines!ATL::CAtlDllModuleT<CGenericRoutinesModule>::_DllMain
[crogram filesmicrosoft visual studio 9.0vcatlmfcincludeatlbase.h:3093]
0d70fbac 56417355 GenericRoutines!DllMain+0x15 [*t:HALframework_9605srchzframeworkutilitiesgenericroutinesreleasegenericroutines.inj:10:35], calling GenericRoutines!ATL::CAtlDllModuleT<CGenericRoutinesModule>:llMain [crogram filesmicrosoft
visual studio 9.0vcatlmfcincludeatlbase.h:3165]
0d70fbc0 5641d64f GenericRoutines!__DllMainCRTStartup+0x7a [f:ddvctoolscrt_bldself_x86crtsrccrtdll.c:546], calling GenericRoutines!DllMain [*t:HALframework_9605srchzframeworkutilitiesgenericroutinesreleasegenericroutines.inj:10:32]
0d70fbcc 5641d6df GenericRoutines!__DllMainCRTStartup+0x10a [f:ddvctoolscrt_bldself_x86crtsrccrtdll.c:577], calling GenericRoutines!__SEH_epilog4
0d70fc00 5641d6df GenericRoutines!__DllMainCRTStartup+0x10a [f:ddvctoolscrt_bldself_x86crtsrccrtdll.c:577], calling GenericRoutines!__SEH_epilog4
0d70fc04 5641d709 GenericRoutines!_DllMainCRTStartup+0x1e [f:ddvctoolscrt_bldself_x86crtsrccrtdll.c:510], calling GenericRoutines!__DllMainCRTStartup [f:ddvctoolscrt_bldself_x86crtsrccrtdll.c:520]
0d70fc10 7c90118a ntdll!LdrpCallInitRoutine+0x14
0d70fc38 7c91b0c4 ntdll!LdrpInitializeThread+0xdf, calling ntdll!RtlDeactivateActivationContextUnsafeFast
0d70fc40 7c91b1b7 ntdll!LdrpInitializeThread+0x13b, calling ntdll!_SEH_epilog
0d70fca0 7c91b0a4 ntdll!_LdrpInitialize+0x25b, calling ntdll!RtlLeaveCriticalSection
0d70fca4 7c90de9a ntdll!NtTestAlert+0xc
0d70fca8 7c91b02a ntdll!_LdrpInitialize+0x246, calling ntdll!_SEH_epilog
0d70fd18 7c91b02a ntdll!_LdrpInitialize+0x246, calling ntdll!_SEH_epilog
0d70fd1c 7c90d06a ntdll!NtContinue+0xc
0d70fd20 7c90e45f ntdll!KiUserApcDispatcher+0xf, calling ntdll!NtContinue
0d70ffa0 79f75753 mscorwks!Thread::intermediateThreadProc+0x37, calling mscorwks!_alloca_probe_16
0d70ffb4 7c80b713 kernel32!BaseThreadStart+0x37
This crash happens rarely and now I could not reproduce. And I dont know why the crash happens. Can anyone give me a hint?
Thanks a lot!
View the full article
I have an urgent issue and need your help! Thanks in advance!
I have a C# winform client and make calls to a COM Server which is in another thread. The threading model of the CoClass is neutral. When I make calls to the COM Server, I got an exception:
0:013> !pe
Exception object: 015f89b0
Exception type: System.InvalidCastException
Message: Unable to cast COM object of type System.__ComObject to interface type PrdUIServers.IRunManagerUIServer. This operation failed because the QueryInterface call on the COM component for the interface with IID {50AC90A8-B7A1-46D5-B712-F62615F4F198}
failed due to the following error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)).
InnerException: <none>
StackTrace (generated):
SP IP Function
0D70F504 07E20B81 DataImportControl!HAL.DataImportControl.ImportedRunMgr.AssociateToolString()+0x31
0D70F518 07E20968 DataImportControl!HAL.DataImportControl.CreateJobImporter.AssociateToolstring()+0x10
0D70F51C 0659D80E DataImportControl!HAL.DataImportControl.DataImportStateMachine.EventHandlerWorkerThread(System.Object)+0x6e
0D70F534 792C9EEF mscorlib_ni!System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(System.Object)+0x2f
0D70F53C 792E02CF mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)+0x6f
0D70F554 792CA453 mscorlib_ni!System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(System.Threading._ThreadPoolWaitCallback)+0x53
0D70F568 792CA2E9 mscorlib_ni!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(System.Object)+0x59
StackTraceString: <none>
HResult: 80004002
Then I list the thread state:
0:013> !COMState
ID TEB APT APTId CallerTID Context
0 ad8 7ffdf000 STA e77 0 00173cc0
1 1230 7ffde000 Ukn
2 5bc 7ffdd000 MTA 0 0 00173e30
3 ac8 7ffd8000 Ukn
4 c8c 7ffd6000 STA 0 0 00173ee8
5 f64 7ff4f000 MTA 0 0 00173e30
6 c98 7ffd7000 MTA 0 0 00173e30
7 1474 7ffd5000 Ukn
8 150c 7ff4c000 Ukn
9 1528 7ff4e000 MTA 0 0 00173e30
10 a10 7ff4b000 MTA 0 0 00173e30
11 15ec 7ff4a000 Ukn
12 11ec 7ff49000 MTA 0 0 00173e30
13 151c 7ff48000 MTA 0 0 00173e30
14 13d0 7ff45000 Ukn 0 0 00000000
15 f28 7ff4d000 Ukn 0 0 00000000
16 14fc 7ffdb000 Ukn 0 0 00000000
17 cb0 7ffda000 Ukn
As you can see that the 13 thread apartment is already MTA.
Then I dump the stacks.
0:013> !dumpstack
OS Thread Id: 0x151c (13)
Current frame: ntdll!KiFastSystemCallRet
ChildEBP RetAddr Caller,Callee
0d70e1f0 7c90df4a ntdll!ZwWaitForMultipleObjects+0xc
0d70e1f4 7c809574 kernel32!WaitForMultipleObjectsEx+0x12c, calling ntdll!NtWaitForMultipleObjects
0d70e228 7c80ba76 kernel32!VirtualQuery+0x15, calling kernel32!VirtualQueryEx
0d70e250 79e79cea mscorwks!ClrFlsSetValue+0x57, calling mscorwks!_EH_epilog3
0d70e278 79e79cea mscorwks!ClrFlsSetValue+0x57, calling mscorwks!_EH_epilog3
0d70e290 7c80a105 kernel32!WaitForMultipleObjects+0x18, calling kernel32!WaitForMultipleObjectsEx
0d70e2ac 7a2d9585 mscorwks!Debugger::EnsureDebuggerAttached+0x9f, calling kernel32!WaitForMultipleObjects
0d70e2f4 7a2da7cd mscorwks!Debugger::SendException+0x1ba, calling mscorwks!Debugger::EnsureDebuggerAttached
0d70e320 79e821f9 mscorwks!CallDescrWorkerWithHandler+0xa3, calling mscorwks!CallDescrWorker
0d70e33c 79e72032 mscorwks!_SEH_epilog4_GS+0xa, calling mscorwks!__security_check_cookie
0d70e340 79e82236 mscorwks!CallDescrWorkerWithHandler+0x1af, calling mscorwks!_SEH_epilog4_GS
0d70e354 7c812aeb kernel32!RaiseException+0x53, calling ntdll!RtlRaiseException
0d70e3dc 79e96920 mscorwks!MetaSig::MetaSig+0x3a, calling msvcr80!memcpy
0d70e3f8 79e964be mscorwks!MethodDesc::CallDescr+0xbb, calling mscorwks!_alloca_probe_16
0d70e45c 79e96436 mscorwks!MethodDesc::CallDescr+0x1f, calling mscorwks!_alloca_probe_16
0d70e468 79e96581 mscorwks!MethodDesc::CallDescr+0x1ac, calling mscorwks!__security_check_cookie
0d70e4a8 79e96436 mscorwks!MethodDesc::CallDescr+0x1f, calling mscorwks!_alloca_probe_16
0d70e4b4 79e96581 mscorwks!MethodDesc::CallDescr+0x1ac, calling mscorwks!__security_check_cookie
0d70e4ec 79e965a4 mscorwks!MethodDesc::CallTargetWorker+0x1f, calling mscorwks!MethodDesc::CallDescr
0d70e508 79e965c2 mscorwks!MethodDescCallSite::Call+0x1a, calling mscorwks!MethodDesc::CallTargetWorker
0d70e510 79e7d9f5 mscorwks!CLRException::HandlerState::CleanupTry+0x16, calling mscorwks!GetCurrentSEHRecord
0d70e524 7a04a9c9 mscorwks!COMDelegate::BindToMethodInfo+0x548, calling mscorwks!CLRException::HandlerState::CleanupTry
0d70e528 79e7c85c mscorwks!_EH_epilog3_catch_GS+0xa, calling mscorwks!__security_check_cookie
0d70e52c 7a04a9db mscorwks!COMDelegate::BindToMethodInfo+0x66e, calling mscorwks!_EH_epilog3_catch_GS
0d70e574 79e8f02f mscorwks!Thread::StackWalkFramesEx+0x693, calling mscorwks!Thread::MakeStackwalkerCallback
0d70e600 79e96436 mscorwks!MethodDesc::CallDescr+0x1f, calling mscorwks!_alloca_probe_16
0d70e60c 79e96581 mscorwks!MethodDesc::CallDescr+0x1ac, calling mscorwks!__security_check_cookie
0d70e658 79e7d9f5 mscorwks!CLRException::HandlerState::CleanupTry+0x16, calling mscorwks!GetCurrentSEHRecord
0d70e66c 7a04adea mscorwks!DistributeUnhandledExceptionReliably+0xee, calling mscorwks!CLRException::HandlerState::CleanupTry
0d70e670 79e7c85c mscorwks!_EH_epilog3_catch_GS+0xa, calling mscorwks!__security_check_cookie
0d70e674 7a04ae18 mscorwks!DistributeUnhandledExceptionReliably+0x1e2, calling mscorwks!_EH_epilog3_catch_GS
0d70e6b0 79e821f9 mscorwks!CallDescrWorkerWithHandler+0xa3, calling mscorwks!CallDescrWorker
0d70e6b4 7c90df4a ntdll!ZwWaitForMultipleObjects+0xc
0d70e6b8 7c809574 kernel32!WaitForMultipleObjectsEx+0x12c, calling ntdll!NtWaitForMultipleObjects
0d70e6c4 7c8095b6 kernel32!WaitForMultipleObjectsEx+0x187, calling ntdll!RtlDeactivateActivationContextUnsafeFast
0d70e6cc 7c8095a4 kernel32!WaitForMultipleObjectsEx+0x17a, calling kernel32!_SEH_epilog
0d70e71c 79e79d91 mscorwks!UnsafeEELeaveCriticalSection+0x25, calling mscorwks!DECTHREADNONHOSTLOCKCOUNT
0d70e728 79e79d52 mscorwks!CrstBase::Leave+0x8c, calling mscorwks!UnsafeEELeaveCriticalSection
0d70e72c 79e79d6b mscorwks!CrstBase::Leave+0xab, calling mscorwks!_EH_epilog3
0d70e754 79e79d6b mscorwks!CrstBase::Leave+0xab, calling mscorwks!_EH_epilog3
0d70e758 79e79d30 mscorwks!Holder<CrstBase *,&CrstBase::AcquireLock,&CrstBase::ReleaseLock,0,&CompareDefault<CrstBase *>,1>::~Holder<CrstBase *,&CrstBase::AcquireLock,&CrstBase::ReleaseLock,0,&CompareDefault<CrstBase
*>,1>+0x2b, calling mscorwks!_EH_epilog3
0d70e77c 79e79d30 mscorwks!Holder<CrstBase *,&CrstBase::AcquireLock,&CrstBase::ReleaseLock,0,&CompareDefault<CrstBase *>,1>::~Holder<CrstBase *,&CrstBase::AcquireLock,&CrstBase::ReleaseLock,0,&CompareDefault<CrstBase
*>,1>+0x2b, calling mscorwks!_EH_epilog3
0d70e794 7a2db49d mscorwks!Debugger::LastChanceManagedException+0x14d, calling mscorwks!Debugger::SendException
0d70e7a0 7c812aeb kernel32!RaiseException+0x53, calling ntdll!RtlRaiseException
0d70e7d4 7a02f3ec mscorwks!AppDomain::OnUnhandledException+0x96, calling mscorwks!_EH_epilog3
0d70e834 7a0973c9 mscorwks!IsStackOverflowException+0xb4
0d70e8b0 7a0477d7 mscorwks!DoFaultReportWorker+0xe5d, calling mscorwks!_EH_epilog3_catch_GS
0d70e8b4 7a048832 mscorwks!DoFaultReport+0xc3, calling mscorwks!DoFaultReportWorker
0d70e8c8 7a097369 mscorwks!IsStackOverflowException+0x54, calling mscorwks!_alloca_probe_16
0d70e8ec 7a09754a mscorwks!WatsonLastChance+0x140, calling mscorwks!IsStackOverflowException+0x32
0d70e914 7a09c0af mscorwks!CLRAddVectoredHandlers+0x209, calling mscorwks!WatsonLastChance
0d70e954 7c809ef0 kernel32!IsBadReadPtr+0x5c, calling kernel32!_SEH_epilog
0d70e96c 7a09c15b mscorwks!InternalUnhandledExceptionFilter+0x22, calling mscorwks!CLRAddVectoredHandlers+0x70
0d70e974 7c35f0c3 msvcr71!__CxxUnhandledExceptionFilter+0x46, calling mscorwks!COMUnhandledExceptionFilter
0d70e980 00cf6302 ime_srv!CanUnload+0x4452, calling msvcr71!__CxxUnhandledExceptionFilter
0d70e98c 7c864031 kernel32!UnhandledExceptionFilter+0x1c7
0d70e9a0 7c834b66 kernel32!BaseDllFormatMessage+0x29a, calling kernel32!_SEH_epilog
0d70e9b4 79e7e121 mscorwks!HndWriteBarrier+0x21, calling mscorwks!HandleFetchType
0d70e9c0 78132c78 msvcr80!__set_flsgetvalue+0xd, calling kernel32!TlsGetValue
0d70e9cc 78132e24 msvcr80!_getptd_noexit+0x72, calling ntdll!RtlSetLastWin32Error
0d70e9dc 78132e2f msvcr80!_getptd+0x6, calling msvcr80!_getptd_noexit
0d70e9e4 78137021 msvcr80!_LocaleUpdate::_LocaleUpdate+0x14, calling msvcr80!_getptd
0d70e9ec 78152cf7 msvcr80!_towupper_l+0x21, calling msvcr80!_LocaleUpdate::_LocaleUpdate
0d70ea10 78152d8f msvcr80!towupper+0xb, calling msvcr80!_towupper_l
0d70ea1c 79e8ff88 mscorwks!HashiString+0x16, calling msvcr80!towupper
0d70ea30 79f74481 mscorwks!ProbabilisticNameSet::GetBitIndex+0x1e, calling mscorwks!HashiString
0d70ea3c 79f744bc mscorwks!ProbabilisticNameSet::MayContain+0x19, calling mscorwks!ProbabilisticNameSet::GetBitIndex
0d70ea5c 79f744ed mscorwks!REGUTIL::EnvCacheValueNameSeenPerhaps+0x19, calling mscorwks!ProbabilisticNameSet::MayContain
0d70ea68 79e7f1e8 mscorwks!_EH_epilog3_GS+0xa, calling mscorwks!__security_check_cookie
0d70ea6c 79f74423 mscorwks!REGUTIL::EnvGetString+0x110, calling mscorwks!_EH_epilog3_GS
0d70ea78 78132c78 msvcr80!__set_flsgetvalue+0xd, calling kernel32!TlsGetValue
0d70ea84 78132e24 msvcr80!_getptd_noexit+0x72, calling ntdll!RtlSetLastWin32Error
0d70ea94 78132e2f msvcr80!_getptd+0x6, calling msvcr80!_getptd_noexit
0d70ea9c 78137021 msvcr80!_LocaleUpdate::_LocaleUpdate+0x14, calling msvcr80!_getptd
0d70eaa4 78152cf7 msvcr80!_towupper_l+0x21, calling msvcr80!_LocaleUpdate::_LocaleUpdate
0d70eac8 78152d8f msvcr80!towupper+0xb, calling msvcr80!_towupper_l
0d70eae8 79f74481 mscorwks!ProbabilisticNameSet::GetBitIndex+0x1e, calling mscorwks!HashiString
0d70eaf4 79f744bc mscorwks!ProbabilisticNameSet::MayContain+0x19, calling mscorwks!ProbabilisticNameSet::GetBitIndex
0d70eb14 79f74460 mscorwks!REGUTIL::RegCacheValueNameSeenPerhaps+0x32, calling mscorwks!ProbabilisticNameSet::MayContain
0d70eb20 79f74547 mscorwks!REGUTIL::GetConfigDWORD+0x81, calling mscorwks!REGUTIL::RegCacheValueNameSeenPerhaps
0d70eb38 79f52562 mscorwks!ExceptionIsAlwaysSwallowed+0x8c, calling mscorwks!_EH_epilog3
0d70eb50 7a0a5685 mscorwks!ThreadExceptionState::MaybeEagerlyCaptureUnhandledInfoForWatson+0x1d, calling mscorwks!REGUTIL::GetConfigDWORD
0d70eb68 7a09b9f9 mscorwks!DefaultCatchHandler+0x64e, calling mscorwks!ThreadExceptionState::MaybeEagerlyCaptureUnhandledInfoForWatson
0d70eb80 79f525e1 mscorwks!ThreadBaseExceptionSwallowingFilter+0x11, calling mscorwks!DefaultCatchHandler+0x5eb
0d70eb94 79f5180e mscorwks!ManagedThreadCallState::IsAppDomainEqual+0xa7
0d70eb9c 79f5183a mscorwks!ManagedThreadCallState::IsAppDomainEqual+0x56, calling mscorwks!_EH_epilog3
0d70eba0 7c910323 ntdll!RtlpImageNtHeader+0x56, calling ntdll!_SEH_epilog
0d70ebb8 7c90d98a ntdll!NtQueryVirtualMemory+0xc
0d70ebbc 7c880a31 kernel32!_ValidateEH3RN+0xb6, calling ntdll!ZwQueryVirtualMemory
0d70ebfc 7c83ab38 kernel32!BaseThreadStart+0x4d, calling kernel32!UnhandledExceptionFilter
0d70ec04 7c839b21 kernel32!_except_handler3+0x61
0d70ec2c 7c9032a8 ntdll!ExecuteHandler2+0x26
0d70ec50 7c90327a ntdll!ExecuteHandler+0x24, calling ntdll!ExecuteHandler2
0d70ec74 7c92aa0f ntdll!RtlDispatchException+0xb1, calling ntdll!RtlpExecuteHandlerForException
0d70eca0 7c910041 ntdll!RtlFreeHeap+0x1e9, calling ntdll!RtlpFreeToHeapLookaside
0d70eca8 7c91005d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0d70ed00 7c90e48a ntdll!KiUserExceptionDispatcher+0xe, calling ntdll!RtlDispatchException
0d70effc 7c812aeb kernel32!RaiseException+0x53 ====> Exception cxr@d70ed30
0d70ed20 7c812aeb kernel32!RaiseException+0x53, calling ntdll!RtlRaiseException
0d70ed88 3ff7afff msi!CMsiDatabase:erefTemporaryString+0x4
0d70ede4 7c812aeb kernel32!RaiseException+0x53, calling ntdll!RtlRaiseException
0d70ee2c 7c910222 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling ntdll!_SEH_epilog
0d70eedc 7c91005d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0d70eee0 79e7a1b6 mscorwks!EEHeapFree+0x98, calling ntdll!RtlFreeHeap
0d70ef40 7c910222 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling ntdll!_SEH_epilog
0d70ef44 7c91019b ntdll!RtlAllocateHeap+0x1c2, calling ntdll!RtlpAllocateFromHeapLookaside
0d70ef48 7c9101db ntdll!RtlAllocateHeap+0xeac, calling ntdll!_SEH_epilog
0d70ef60 79f4a8bc mscorwks!ThreadpoolMgr:eleteTimer+0x95, calling mscorwks!ThreadpoolMgr::QueueTimerInfoForRelease
0d70ef64 79f4a8c1 mscorwks!ThreadpoolMgr:eleteTimer+0x9a, calling mscorwks!_EH_epilog3
0d70ef78 7c910222 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling ntdll!_SEH_epilog
0d70ef84 7c9100b8 ntdll!RtlpFreeToHeapLookaside+0x22, calling ntdll!RtlpInterlockedPushEntrySList
0d70ef90 7c910041 ntdll!RtlFreeHeap+0x1e9, calling ntdll!RtlpFreeToHeapLookaside
0d70ef98 7c91005d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0d70efe4 7c82c132 kernel32!BaseDispatchAPC+0x38, calling kernel32!_SEH_epilog
0d70efe8 7c90d06a ntdll!NtContinue+0xc
0d70efec 7c90e45f ntdll!KiUserApcDispatcher+0xf, calling ntdll!NtContinue
0d70f008 7c812aeb kernel32!RaiseException+0x53, calling ntdll!RtlRaiseException
0d70f01c 79e8006c mscorwks!Binder::RawGetClass+0x20, calling mscorwks!Module::LookupTypeDef
0d70f02c 79e806cf mscorwks!Binder::IsClass+0x23, calling mscorwks!Binder::RawGetClass
0d70f038 79ef2a4f mscorwks!Binder::IsException+0x14, calling mscorwks!Binder::IsClass
0d70f048 79ef2a76 mscorwks!IsExceptionOfType+0x23, calling mscorwks!Binder::IsException
0d70f050 79ef2bfc mscorwks!RaiseTheExceptionInternalOnly+0x2a8, calling kernel32!RaiseException
0d70f0b0 79f51c84 mscorwks!UnwindAndContinueRethrowHelperAfterCatch+0x70, calling mscorwks!RaiseTheExceptionInternalOnly
0d70f0e8 7a0259c3 mscorwks!ComObject::GetComIPFromRCWEx+0xba, calling mscorwks!UnwindAndContinueRethrowHelperAfterCatch
0d70f150 79fc7d16 mscorwks!ComObject::StaticGetComIPFromRCWEx+0x50, calling mscorwks!ComObject::GetComIPFromRCWEx
0d70f19c 0412b9b7 0412b9b7, calling mscorwks!ComObject::StaticGetComIPFromRCWEx
0d70f208 7c90fdc2 ntdll!RtlQueryInformationActivationContext+0x310, calling ntdll!RtlpQueryInformationActivationContextBasicInformation
0d70f224 7c90fddd ntdll!RtlQueryInformationActivationContext+0x32b, calling ntdll!_SEH_epilog
0d70f274 7c90fddd ntdll!RtlQueryInformationActivationContext+0x32b, calling ntdll!_SEH_epilog
0d70f278 7c82c0a1 kernel32!QueueUserAPC+0x27, calling ntdll!RtlQueryInformationActivationContext
0d70f280 7c90d9aa ntdll!ZwQueueApcThread+0xc
0d70f284 7c82c0cc kernel32!QueueUserAPC+0x64, calling ntdll!NtQueueApcThread
0d70f2a4 79f4a65d mscorwks!Holder<ThreadpoolMgr::TimerInfo *,&ThreadpoolMgr::AcquireTimerInfo,&ThreadpoolMgr::ReleaseTimerInfo,0,&CompareDefault<ThreadpoolMgr::TimerInfo *>,2>::~Holder<ThreadpoolMgr::TimerInfo *,&ThreadpoolMgr::AcquireTimerInfo,&ThreadpoolMgr::ReleaseTimerInfo,0,&CompareDefault<ThreadpoolMgr::TimerInfo
*>,2>+0x2b, calling mscorwks!_EH_epilog3
0d70f30c 79f75e03 mscorwks!WKS::gc_heap::try_allocate_more_space+0x5bb, calling mscorwks!WKS::gc_heap::adjust_limit_clr
0d70f314 79e73219 mscorwks!HelperMethodFrame::LazyInit+0x17, calling (JitHelp: CORINFO_HELP_GET_THREAD)
0d70f31c 79e731fc mscorwks!HelperMethodFrame::HelperMethodFrame+0x1d, calling mscorwks!HelperMethodFrame::LazyInit
0d70f32c 79e7cd2b mscorwks!HelperMethodFrame_PROTECTOBJ::HelperMethodFrame_PROTECTOBJ+0x14, calling mscorwks!HelperMethodFrame::HelperMethodFrame
0d70f348 79e8d3a4 mscorwks!Int32ToDecStr+0xe1, calling mscorwks!_EH_epilog3
0d70f34c 79e8d287 mscorwks!COMNumber::FormatInt32+0x1d8, calling mscorwks!Int32ToDecStr
0d70f354 79e7c85c mscorwks!_EH_epilog3_catch_GS+0xa, calling mscorwks!__security_check_cookie
0d70f358 79e8d2ef mscorwks!COMNumber::FormatInt32+0x244, calling mscorwks!_EH_epilog3_catch_GS
0d70f374 79e79d52 mscorwks!CrstBase::Leave+0x8c, calling mscorwks!UnsafeEELeaveCriticalSection
0d70f39c 79e8d193 mscorwks!COMNumber::FormatInt32+0x39, calling mscorwks!LazyMachStateCaptureState
0d70f40c 79eb6e06 mscorwks!MethodDesc:oBackpatch+0x6d, calling mscorwks!Precode::SetTargetInterlocked
0d70f434 79e7f449 mscorwks!MethodDesc:oPrestub+0x50b, calling mscorwks!MethodDesc:oBackpatch
0d70f43c 79e8127d mscorwks!MethodDesc:oPrestub+0x517, calling mscorwks!_EH_epilog3
0d70f450 79e73219 mscorwks!HelperMethodFrame::LazyInit+0x17, calling (JitHelp: CORINFO_HELP_GET_THREAD)
0d70f458 79e731fc mscorwks!HelperMethodFrame::HelperMethodFrame+0x1d, calling mscorwks!HelperMethodFrame::LazyInit
0d70f468 79e73247 mscorwks!FrameWithCookie<HelperMethodFrame>::FrameWithCookie<HelperMethodFrame>+0x1e, calling mscorwks!HelperMethodFrame::HelperMethodFrame
0d70f48c 79e813e4 mscorwks!PreStubWorker+0x139, calling ntdll!RtlSetLastWin32Error
0d70f490 79e813ec mscorwks!PreStubWorker+0x141, calling mscorwks!_EH_epilog3
0d70f4d4 07e20b81 (MethodDesc 0x6c50914 +0x31 xxx.HAL.xxxDataImportControl.ImportedRunMgr.AssociateToolString()), calling 00939ede
0d70f4f4 07e20b81 (MethodDesc 0x6c50914 +0x31 xxx.HAL.xxxDataImportControl.ImportedRunMgr.AssociateToolString()), calling 00939ede
0d70f510 07e20968 (MethodDesc 0x80e36cc +0x10 xxx.HAL.xxxDataImportControl.CreateJobImporter.AssociateToolstring()), calling (MethodDesc 0x6c50914 +0 xxx.HAL.xxxDataImportControl.ImportedRunMgr.AssociateToolString())
0d70f514 0659d80e (MethodDesc 0x80e4ba0 +0x6e xxx.HAL.xxxDataImportControl.DataImportStateMachine.EventHandlerWorkerThread(System.Object))
0d70f52c 792c9eef (MethodDesc 0x790fc9c0 +0x2f System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(System.Object))
0d70f534 792e02cf (MethodDesc 0x7910277c +0x6f System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object))
0d70f548 792ca453 (MethodDesc 0x790fc9d8 +0x53 System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(System.Threading._ThreadPoolWaitCallback)), calling (MethodDesc 0x7910277c +0 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object))
0d70f560 792ca2e9 (MethodDesc 0x790fc9cc +0x59 System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(System.Object)), calling (MethodDesc 0x790fc9d8 +0 System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(System.Threading._ThreadPoolWaitCallback))
0d70f578 79e71b4c mscorwks!CallDescrWorker+0x33
0d70f588 79e821f9 mscorwks!CallDescrWorkerWithHandler+0xa3, calling mscorwks!CallDescrWorker
0d70f608 79e8285f mscorwks!DispatchCallBody+0x1e, calling mscorwks!CallDescrWorkerWithHandler
0d70f628 79e828a0 mscorwks!DispatchCallDebuggerWrapper+0x3d, calling mscorwks!DispatchCallBody
0d70f68c 79e82911 mscorwks!DispatchCallNoEH+0x51, calling mscorwks!DispatchCallDebuggerWrapper
0d70f6c0 79f47ba5 mscorwks!QueueUserWorkItemManagedCallback+0x59, calling mscorwks!DispatchCallNoEH
0d70f71c 79e984cf mscorwks!Thread:oADCallBack+0x32a
0d70f730 79e9846b mscorwks!Thread::ShouldChangeAbortToUnload+0xe3, calling mscorwks!Thread:oADCallBack+0x2db
0d70f758 79e8c4c7 mscorwks!Thread::EnterRuntimeNoThrow+0xad, calling ntdll!RtlSetLastWin32Error
0d70f75c 79e8c4ce mscorwks!Thread::EnterRuntimeNoThrow+0xb4, calling mscorwks!_EH_epilog3
0d70f7c4 79e98391 mscorwks!Thread::ShouldChangeAbortToUnload+0x30a, calling mscorwks!Thread::ShouldChangeAbortToUnload+0x32
0d70f800 79e9851d mscorwks!Thread::ShouldChangeAbortToUnload+0x33e, calling mscorwks!Thread::ShouldChangeAbortToUnload+0x29d
0d70f828 79ec4ac4 mscorwks!ManagedThreadBase::ThreadPool+0x13, calling mscorwks!Thread::ShouldChangeAbortToUnload+0x319
0d70f840 79f4783a mscorwks!ManagedPerAppDomainTPCount:ispatchWorkItem+0xe9, calling mscorwks!ManagedThreadBase::ThreadPool
0d70f894 79ec4b3f mscorwks!PerAppDomainTPCountList::GetAppDomainIndexForThreadpoolDispatch+0x35
0d70f8a8 79ec475e mscorwks!ThreadpoolMgr::ExecuteWorkRequest+0xaf
0d70f8bc 79ec48d2 mscorwks!ThreadpoolMgr::WorkerThreadStart+0x20b, calling mscorwks!ThreadpoolMgr::ExecuteWorkRequest
0d70f914 79f75765 mscorwks!Thread::intermediateThreadProc+0x49
0d70f938 7c910222 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling ntdll!_SEH_epilog
0d70f93c 7c91019b ntdll!RtlAllocateHeap+0x1c2, calling ntdll!RtlpAllocateFromHeapLookaside
0d70f940 7c9101db ntdll!RtlAllocateHeap+0xeac, calling ntdll!_SEH_epilog
0d70f95c 7c910222 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling ntdll!_SEH_epilog
0d70f988 7c910222 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling ntdll!_SEH_epilog
0d70f98c 7c91019b ntdll!RtlAllocateHeap+0x1c2, calling ntdll!RtlpAllocateFromHeapLookaside
0d70f990 7c9101db ntdll!RtlAllocateHeap+0xeac, calling ntdll!_SEH_epilog
0d70fa0c 7c917e09 ntdll!LdrpGetProcedureAddress+0xa6, calling ntdll!_SEH_epilog
0d70fa10 7c918047 ntdll!LdrpSnapThunk+0x317, calling ntdll!LdrpGetProcedureAddress
0d70fa60 7c917dba ntdll!LdrpGetProcedureAddress+0x186, calling ntdll!LdrpSnapThunk
0d70fa78 7c917e5f ntdll!LdrpGetProcedureAddress+0x29b, calling ntdll!RtlLeaveCriticalSection
0d70fa80 7c917e09 ntdll!LdrpGetProcedureAddress+0xa6, calling ntdll!_SEH_epilog
0d70fb28 7c917e09 ntdll!LdrpGetProcedureAddress+0xa6, calling ntdll!_SEH_epilog
0d70fb2c 7c917ec0 ntdll!LdrGetProcedureAddress+0x18, calling ntdll!LdrpGetProcedureAddress
0d70fb64 7c9101db ntdll!RtlAllocateHeap+0xeac, calling ntdll!_SEH_epilog
0d70fb90 0e511bc6 urlmon!DllMain+0x17e, calling urlmon!TlsDllMain
0d70fb98 564176d4 GenericRoutines!ATL::CAtlDllModuleT<CGenericRoutinesModule>:llMain+0x14 [crogram filesmicrosoft visual studio 9.0vcatlmfcincludeatlbase.h:3180], calling GenericRoutines!ATL::CAtlDllModuleT<CGenericRoutinesModule>::_DllMain
[crogram filesmicrosoft visual studio 9.0vcatlmfcincludeatlbase.h:3093]
0d70fbac 56417355 GenericRoutines!DllMain+0x15 [*t:HALframework_9605srchzframeworkutilitiesgenericroutinesreleasegenericroutines.inj:10:35], calling GenericRoutines!ATL::CAtlDllModuleT<CGenericRoutinesModule>:llMain [crogram filesmicrosoft
visual studio 9.0vcatlmfcincludeatlbase.h:3165]
0d70fbc0 5641d64f GenericRoutines!__DllMainCRTStartup+0x7a [f:ddvctoolscrt_bldself_x86crtsrccrtdll.c:546], calling GenericRoutines!DllMain [*t:HALframework_9605srchzframeworkutilitiesgenericroutinesreleasegenericroutines.inj:10:32]
0d70fbcc 5641d6df GenericRoutines!__DllMainCRTStartup+0x10a [f:ddvctoolscrt_bldself_x86crtsrccrtdll.c:577], calling GenericRoutines!__SEH_epilog4
0d70fc00 5641d6df GenericRoutines!__DllMainCRTStartup+0x10a [f:ddvctoolscrt_bldself_x86crtsrccrtdll.c:577], calling GenericRoutines!__SEH_epilog4
0d70fc04 5641d709 GenericRoutines!_DllMainCRTStartup+0x1e [f:ddvctoolscrt_bldself_x86crtsrccrtdll.c:510], calling GenericRoutines!__DllMainCRTStartup [f:ddvctoolscrt_bldself_x86crtsrccrtdll.c:520]
0d70fc10 7c90118a ntdll!LdrpCallInitRoutine+0x14
0d70fc38 7c91b0c4 ntdll!LdrpInitializeThread+0xdf, calling ntdll!RtlDeactivateActivationContextUnsafeFast
0d70fc40 7c91b1b7 ntdll!LdrpInitializeThread+0x13b, calling ntdll!_SEH_epilog
0d70fca0 7c91b0a4 ntdll!_LdrpInitialize+0x25b, calling ntdll!RtlLeaveCriticalSection
0d70fca4 7c90de9a ntdll!NtTestAlert+0xc
0d70fca8 7c91b02a ntdll!_LdrpInitialize+0x246, calling ntdll!_SEH_epilog
0d70fd18 7c91b02a ntdll!_LdrpInitialize+0x246, calling ntdll!_SEH_epilog
0d70fd1c 7c90d06a ntdll!NtContinue+0xc
0d70fd20 7c90e45f ntdll!KiUserApcDispatcher+0xf, calling ntdll!NtContinue
0d70ffa0 79f75753 mscorwks!Thread::intermediateThreadProc+0x37, calling mscorwks!_alloca_probe_16
0d70ffb4 7c80b713 kernel32!BaseThreadStart+0x37
This crash happens rarely and now I could not reproduce. And I dont know why the crash happens. Can anyone give me a hint?
Thanks a lot!
View the full article