my problem is related and very similar to this one: Analyzing Outlook HANG dump (with GoogleCalendarSync add-in installed)
The problem is, my addin seems to hang sometimes when a new mail arrives (at least that what it seems to happen, also based on the stack info below. The application log tells me something like "Cross Thread Deadlock". My addin is a managed VSTO addin.
Here is the hang dump analsis:
FAULTING_IP:
+0
00000000 ?? ???
EXCEPTION_RECORD: ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 00000000
ExceptionCode: 80000007 (Wake debugger)
ExceptionFlags: 00000000
NumberParameters: 0
CONTEXT: 00000000 -- (.cxr 0x0;r)
eax=00000000 ebx=00000000 ecx=00000000 edx=00000000 esi=00bd7028 edi=00000000
eip=77bff8d1 esp=0044e44c ebp=0044e4b0 iopl=0 nv up ei pl zr na pe nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00200246
ntdll!ZwWaitForSingleObject+0x15:
77bff8d1 83c404 add esp,4
BUGCHECK_STR: HANG
DEFAULT_BUCKET_ID: APPLICATION_HANG
PROCESS_NAME: OUTLOOK.EXE
ERROR_CODE: (NTSTATUS) 0xcfffffff - <Unable to get error code text>
EXCEPTION_CODE: (NTSTATUS) 0xcfffffff - <Unable to get error code text>
NTGLOBALFLAG: 0
APPLICATION_VERIFIER_FLAGS: 0
APP: outlook.exe
ANALYSIS_VERSION: 6.3.9600.16384 (debuggers(dbg).130821-1623) x86fre
MANAGED_STACK:
(TransitionMU)
0044EA3C 06019026 UNKNOWN!DomainBoundILStubClass.IL_STUB_CLRtoCOM(System.String, System.Object, System.Object)+0x1d6
(TransitionUM)
(TransitionMU)
0044EC2C 06018DD8 UNKNOWN!yasoonBase.Controller.Outlook.OutlookPersistenceSynchronizer.userStore_OnNewMail(System.String)+0x58
(TransitionUM)
(TransitionMU)
0044F01C 642F371D mscorlib_ni!System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object, System.Object[], System.Object[])+0x5d
0044F040 642EF8FA mscorlib_ni!System.Delegate.DynamicInvokeImpl(System.Object[])+0x76
0044F054 64AE1753 mscorlib_ni!System.Runtime.InteropServices.ComEventsMethod+DelegateWrapper.Invoke(System.Object[])+0x8f
0044F068 64AE08BB mscorlib_ni!System.Runtime.InteropServices.ComEventsMethod.Invoke(System.Object[])+0x2f
0044F080 64AE0194 mscorlib_ni!System.Runtime.InteropServices.ComEventsSink.System.Runtime.InteropServices.NativeMethods.IDispatch.Invoke(Int32, System.Guid ByRef, Int32, System.Runtime.InteropServices.ComTypes.INVOKEKIND, System.Runtime.InteropServices.ComTypes.DISPPARAMS ByRef, IntPtr, IntPtr, IntPtr)+0x168
0044F0C8 64951D11 mscorlib_ni!DomainNeutralILStubClass.IL_STUB_COMtoCLR(Int32, IntPtr, Int32, Int32, IntPtr, Int32, Int32, Int32)+0x29
(TransitionUM)
MANAGED_STACK_COMMAND: _EFN_StackTrace
DERIVED_WAIT_CHAIN:
Dl Eid Cid WaitType
-- --- ------- --------------------------
0 1d24.16e4 Event -->
54 1d24.1e20 SendMessage
WAIT_CHAIN_COMMAND: ~0s;k;;~54s;k;;
BLOCKING_THREAD: 00001e20
PRIMARY_PROBLEM_CLASS: APPLICATION_HANG
LAST_CONTROL_TRANSFER: from 76e0216b to 76df72b9
FAULTING_THREAD: 00000036
STACK_TEXT:
2a9bbd48 76e0216b 003e0fd8 0000c382 00000001 user32!NtUserMessageCall+0x15
2a9bbd88 76df96c5 022c5d90 00000000 25ecd700 user32!SendMessageWorker+0x3c6
2a9bbdac 25ecdaa0 003e0fd8 0000c382 00000001 user32!SendMessageW+0x7f
WARNING: Stack unwind information not available. Following frames may be wrong.
2a9bbdcc 18314b60 1d133da0 00000001 2a9bbe10 redemption!InitExtensionLibrary+0x4b31c
2a9bbdec 1832467f 00bd6ff0 00000001 2a9bbe10 PSTPRX32!PRXServiceEntry+0xdbaf
2a9bbe6c 18324485 2a9bc820 29e66080 00000005 PSTPRX32!PRXServiceEntry+0x1d6ce
2a9bbeb0 18323b3a 2a9bc820 e4c3e839 00000001 PSTPRX32!PRXServiceEntry+0x1d4d4
2a9bbee0 18325c83 2a9bc7e4 2a9bc7e4 00000000 PSTPRX32!PRXServiceEntry+0x1cb89
2a9bbef8 1831a506 00000000 2a9bc7e4 00000000 PSTPRX32!PRXServiceEntry+0x1ecd2
2a9bc740 1289e3c8 29e64ab4 2a9bc7e4 00000000 PSTPRX32!PRXServiceEntry+0x13555
2a9bc75c 1289a277 29e64ab4 2a9bc7e4 26bc23b8 OUTLMIME!CloseAllSockets+0xea20
2a9bc854 128999e7 2a9bc93c 00000fff 210428ad OUTLMIME!CloseAllSockets+0xa8cf
2a9bc8c0 12898d24 2a9bc93c 210428a2 2a9bc9ac OUTLMIME!CloseAllSockets+0xa03f
2a9bc8e8 1289c957 2a9bc93c 210428a2 2a9bc980 OUTLMIME!CloseAllSockets+0x937c
2a9bc98c 1289cc65 1802d2b8 00000003 2a9bc9ac OUTLMIME!CloseAllSockets+0xcfaf
2a9bcdbc 12896de5 00000005 26bc23c0 26e38f18 OUTLMIME!CloseAllSockets+0xd2bd
2a9bd254 12890bb7 00000005 00000005 00000003 OUTLMIME!CloseAllSockets+0x743d
2a9bd278 1289150b 00000005 00000003 26e38f18 OUTLMIME!CloseAllSockets+0x120f
2a9bd2b4 1289128c 00000000 1808dcc0 00000000 OUTLMIME!CloseAllSockets+0x1b63
2a9bf2d8 1288ffd6 00000000 00000401 26e38690 OUTLMIME!CloseAllSockets+0x18e4
2a9bf6fc 1289201a 00000401 00002bc4 00000001 OUTLMIME!CloseAllSockets+0x62e
2a9bf718 76df62fa 00580ad4 00000401 00002bc4 OUTLMIME!CloseAllSockets+0x2672
2a9bf744 76df6d3a 12891fd1 00580ad4 00000401 user32!InternalCallWinProc+0x23
2a9bf7bc 76df77c4 00000000 12891fd1 00580ad4 user32!UserCallWinProcCheckWow+0x109
2a9bf81c 76df7bca 12891fd1 00000001 2a9bfc8c user32!DispatchMessageWorker+0x3bc
2a9bf82c 1831beda 2a9bf844 00000001 29eb58c8 user32!DispatchMessageA+0xf
2a9bfc8c 0f598abc 29e64aa8 29eb58c8 1922eb58 PSTPRX32!PRXServiceEntry+0x14f29
2a9bfcb8 0f598a08 29eb5b80 1922eb58 26b13240 OLMAPI32!MemGetMalloc+0xbed
2a9bfcd4 655b5155 1922ebc8 26b13240 655ac3bb OLMAPI32!MemGetMalloc+0xb39
2a9bfd04 655ab3a2 2a9bfd74 2a9bfd58 00598790 MSO!Ordinal5372+0x66
2a9bfd1c 655a817f 2a9bfd74 00000000 00598790 MSO!Ordinal4578+0x1bc
2a9bfd50 655a6e0d 00000000 655a6e0d 2a9bfd74 MSO!Ordinal630+0x18ed
2a9bfda4 756a336a 00598790 2a9bfdf0 77c19f72 MSO!Ordinal630+0x57b
2a9bfdb0 77c19f72 00598790 5671c62f 00000000 kernel32!BaseThreadInitThunk+0xe
2a9bfdf0 77c19f45 655a6db4 00598790 ffffffff ntdll!__RtlUserThreadStart+0x70
2a9bfe08 00000000 655a6db4 00598790 00000000 ntdll!_RtlUserThreadStart+0x1b
FOLLOWUP_IP:
redemption!InitExtensionLibrary+4b31c
25ecdaa0 c3 ret
SYMBOL_STACK_INDEX: 3
SYMBOL_NAME: redemption!InitExtensionLibrary+4b31c
FOLLOWUP_NAME: MachineOwner
MODULE_NAME: redemption
IMAGE_NAME: redemption.dll
DEBUG_FLR_IMAGE_TIMESTAMP: 52791e66
STACK_COMMAND: ~54s ; kb
BUCKET_ID: HANG_redemption!InitExtensionLibrary+4b31c
FAILURE_BUCKET_ID: APPLICATION_HANG_cfffffff_redemption.dll!InitExtensionLibrary
ANALYSIS_SOURCE: UM
FAILURE_ID_HASH_STRING: um:application_hang_cfffffff_redemption.dll!initextensionlibrary
FAILURE_ID_HASH: {c9d67d3f-8e85-921b-11e8-c7a8dfc70981}
Followup: MachineOwner
The OnNewMail event handler does not very much imho:
void userStore_OnNewMail(string entryID)
{
//Get mail from store & raise event
RDOMail mail = mapiSession.GetMessageFromID(entryID, this.storeEntryId);
var args = new MailEventArguments(mail, ChangeType.New);
this.eventPublisher.RaiseEvent(new MailEvent(args));
}
One thing I noticed - This seems to happen especially on non-default Outlook stores, though this event is not expected to be fired on non-default stores anyway...
What I'm trying to understand, what is the other thread which blocks this one, is there any possibility to get that information?
Any feedback would be highly appreciated ...
Thanks!