Visual Studio 2013安装完Update 3后启动立刻crash,异常信息为:
System.InvalidOperationException was unhandledMessage: An unhandled exception of type 'System.InvalidOperationException' occurred in WindowsBase.dllAdditional information: Dispatcher processing has been suspended, but messages are still being processed.
选择调试器时下意识又选择Visual Studio 2013,但一想这样不是会再次crash?竟然顺利启动成功。如果再次运行Visual Studio 2013还是会直接crash。
使用devenv /safemode仍然报错,尝试devenv /logs启动查看ActivityLog.xml并无发现错误信息。
1 Information 2 Information 3 Information 4 Information 5 Information 6 Information 7 Information 8 Information 9 Information 10 Information 11 Information 12 Information 13 Information 14 Information 15 Information 16 Information 17 Information 18 Information 19 Information 20 Information 21 Information 22 Information 23 Information 24 Information 25 Information 26 Information 27 Information 28 Information 29 Information 30 Information 31 Information 32 Information 33 Information 34 Information 35 Information 36 Information 37 Information 38 Information
执行devenv /resetsettings启动,一切正常。再次重新启动依然crash。
使用WinDbg启动Visual Studio 2013,查看完整的异常信息:
0:000> !peException object: 04002cf0Exception type: System.InvalidOperationExceptionMessage: Dispatcher processing has been suspended, but messages are still being processed.InnerException:StackTrace (generated): SP IP Function 00AEC540 60695D91 WindowsBase_ni!System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)+0x27aa11 00AEC58C 6041C75B WindowsBase_ni!MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)+0x9b 00AEC5C8 6041C6AB WindowsBase_ni!MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)+0x6b 00AEC5D8 6041C562 WindowsBase_ni!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)+0x52 00AEC5F8 6041C49A WindowsBase_ni!MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)+0x3a 00AEC63C 6041AABE WindowsBase_ni!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)+0x10e 00AEC690 6041BFF1 WindowsBase_ni!MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)+0xf1StackTraceString: HResult: 80131509
非托管call stack:
0:000> kbChildEBP RetAddr Args to Child 00aec3c0 73fb2a42 e0434352 00000001 00000005 KERNELBASE!RaiseException+0x6c00aec464 73fb337f 00000000 8a7460ab 0008060a clr!RaiseTheExceptionInternalOnly+0x276*** WARNING: Unable to verify checksum for C:\Windows\assembly\NativeImages_v4.0.30319_32\WindowsBase\025b365df0afb7ad237ce25d00ca17c5\WindowsBase.ni.dll00aec538 60695d91 00000000 00000000 03a4dbdc clr!IL_Throw+0x13e00aec574 6041c75b 03a4f850 00000000 000010f0 WindowsBase_ni+0x335d9100aec5b0 6041c6ab 03a4f850 00000000 000010f0 WindowsBase_ni+0xbc75b00aec5d0 6041c562 00000001 03a436b4 03a4db88 WindowsBase_ni+0xbc6ab00aec5e8 6041c49a 00000001 03a4f838 00000000 WindowsBase_ni+0xbc56200aec624 6041aabe 00000000 00000001 03a4f838 WindowsBase_ni+0xbc49a00aec674 6041bff1 00000001 03a4f838 03a4f818 WindowsBase_ni+0xbaabe00aec6f0 768177d8 0008060a 0000003d 000010f0 WindowsBase_ni+0xbbff100aec71c 768190e7 02e130e2 0008060a 0000003d USER32!InternalCallWinProc+0x2300aec798 76817b6f 02e130e2 02e130e2 00000000 USER32!UserCallWinProcCheckWow+0xdb00aec7fc 76817c44 01249930 00000000 0000003d USER32!DispatchClientMessage+0x15d00aec838 77a32c22 00aec850 00000000 00aec8e0 USER32!__fnDWORD+0x2b00aec84c 01249930 00000000 0000003d 000010f0 ntdll!KiUserCallbackDispatcher+0x2e*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\SysWOW64\combase.dll - WARNING: Frame IP not in any known module. Following frames may be wrong.00aec8a0 775addf8 00aec934 000906dc 00000400 0x124993000aec8f0 775ae1fe 00aecad8 00aec934 000906dc combase!ClearCleanupFlag+0x85200aec954 775abbe6 00aec974 00000001 00aec980 combase!ClearCleanupFlag+0xc5800aec988 7765efc5 00aecad8 069983c0 00cc4d94 combase!PropVariantCopy+0x213700aecaa4 775ab7f3 00cc4d94 00aecbf8 00aecbe0 combase!NdrOleDllGetClassObject+0x12a900aecb5c 775e115d 00cc4d94 00aecbf8 00aecbe0 combase!PropVariantCopy+0x1d4400aecbb8 7765d39a 00cc4d94 00aecbf8 00aecbe0 combase!CoRegisterSurrogateEx+0x349400aecbd4 76c7bb46 069980d4 00aecc24 76cfb333 combase!NdrExtStubInitialize+0x21a900aecbe0 76cfb333 8e517dd4 00c8efc0 00aed030 RPCRT4!NdrpProxySendReceive+0xe00aecffc 7765c779 77565430 7756a956 00aed030 RPCRT4!NdrClientCall2+0x20c00aed018 77570d77 0000000c 00000008 00aed0b8 combase!NdrExtStubInitialize+0x158800aed028 775e16d5 069980d4 00aed068 8000ffff combase!DcomChannelSetHResult+0xe1a00aed0b8 775e1995 00c8efc0 775e17bc 00000302 combase!CoRegisterSurrogateEx+0x3a0c00aed118 775e21bc 7766ebb0 00000302 77565134 combase!CoRegisterSurrogateEx+0x3ccc00aed154 7758730e 7766ebbc 00aed4f0 00aed170 combase!CoRegisterSurrogateEx+0x44f300aed174 77586d52 7766ebbc 00000001 00000000 combase!CoDisableCallCancellation+0xca300aed194 775872cf 7766ebbc 00aed4f0 00000000 combase!CoDisableCallCancellation+0x6e700aed1cc 775873a9 7766ebbc 00aed4f0 00000000 combase!CoDisableCallCancellation+0xc6400aed1fc 77584fdf 7766ebbc 00000000 00000000 combase!CoDisableCallCancellation+0xd3e00aed23c 775850d7 00aed694 00000000 00aedcac combase!ObjectStublessClient22+0x16df00aed49c 77584fdf 7766ebb8 00000000 00aed694 combase!ObjectStublessClient22+0x17d700aed4dc 77585ba6 00aed694 00000000 00aedcac combase!ObjectStublessClient22+0x16df00aedd88 7757c9c2 00000000 00000001 00000000 combase!ObjectStublessClient22+0x22a6*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Program Files (x86)\NVIDIA Corporation\CoProcManager\nvd3d9wrap.dll - 00aedddc 6a082e60 64981fa8 00000000 00000001 combase!CoCreateInstance+0x169*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\SysWOW64\UIAutomationCore.dll - 00aede04 64981f66 64981fa8 00000000 00000001 nvd3d9wrap!initialise+0x180200aede34 64996c9e 76810000 76f7e7d6 00aedf98 UIAutomationCore!DllCanUnloadNow+0x1b400aede48 649a767e 00aede6c 649a7001 00d06de0 UIAutomationCore!UiaReturnRawElementProvider+0xb061*** WARNING: Unable to verify checksum for C:\Windows\assembly\NativeImages_v4.0.30319_32\UIAutomationTypes\30caed6dd3390553adf0d78426beb375\UIAutomationTypes.ni.dll00aede70 5d4dc3ed 00000001 00aedf98 8ad68e6c UIAutomationCore!UiaLookupId+0x67d00aedeb0 5d4dc6e9 00cc8f54 00000000 00000000 UIAutomationTypes_ni+0x1c3ed00aedf90 5d4e0bff d976c2fc 4a6e66ea 4cc28fb2 UIAutomationTypes_ni+0x1c6e900aedfd8 73e63de2 00d06de0 00aee038 73e73315 UIAutomationTypes_ni+0x20bff00aedfe4 73e73315 00aee098 00aee028 73fb2c66 clr!CallDescrWorkerInternal+0x3400aee038 73e7e214 8a7445ef 5d4c56d0 00aee104 clr!CallDescrWorkerWithHandler+0x6b00aee07c 73e7e24f 00000000 5d4e97ec 5d4e97ec clr!DispatchCallDebuggerWrapper+0x5900aee0b8 73e7e31d 5d4c56d0 00000002 8a7444bf clr!DispatchCallSimple+0x6800aee12c 73e7e3c2 00aee1bc 8a74438b 00000010 clr!MethodTable::RunClassInitEx+0xbf00aee618 73e7e18f 8a744333 04a4d7e8 00000010 clr!MethodTable::DoRunClassInitThrowing+0x45300aee6a0 73e7e1eb 0400176c 0000003f 0000003f clr!JIT_GetSharedGCStaticBase_Helper+0x85*** WARNING: Unable to verify checksum for C:\Windows\assembly\NativeImages_v4.0.30319_32\PresentationCore\dfa608e0b590b73f324ed9b2ff2a3899\PresentationCore.ni.dll00aee6b8 5fa71b27 05b46420 00000004 00000000 clr!JIT_GetSharedGCStaticBase_Portable+0x3000aee988 5fa71a62 03a4dbdc 00000000 00000000 PresentationCore_ni+0x1a1b2700aee9b0 73e63de2 00d06de0 00aeea10 73e73315 PresentationCore_ni+0x1a1a6200aee9bc 73e73315 00aeea70 00aeea00 73fb2c66 clr!CallDescrWorkerInternal+0x3400aeea10 73e7e214 8a744fc7 5fa719f8 00aeeae0 clr!CallDescrWorkerWithHandler+0x6b00aeea54 73e7e24f 00000000 5fb0c23c 5fb0c23c clr!DispatchCallDebuggerWrapper+0x5900aeea94 73e7e31d 5fa719f8 00000002 8a744e9b clr!DispatchCallSimple+0x6800aeeb08 73e7e3c2 00aeeb98 8a744a67 0000048d clr!MethodTable::RunClassInitEx+0xbf00aeeff4 73e7e4be 8a7455ef 03bd7708 0000048d clr!MethodTable::DoRunClassInitThrowing+0x45300aef07c 73e7e522 0400161c 04001364 00000017 clr!JIT_GetSharedNonGCStaticBase_Helper+0x8500aef094 5fa5a555 0400161c 03bd7708 00aef0c0 clr!JIT_GetSharedNonGCStaticBase_Portable+0x2f*** WARNING: Unable to verify checksum for C:\Windows\assembly\NativeImages_v4.0.30319_32\Microsoft.V412add50#\ce5e0d2f9aff38cac2a17df789c43339\Microsoft.VisualStudio.Shell.UI.Internal.ni.dll00aef0a4 6088fde6 03bd7708 0400133c 5fa58698 PresentationCore_ni+0x18a55500aef0c0 5fa5a591 04001404 00aef108 6088e246 Microsoft_VisualStudio_Shell_UI_Internal_ni+0xbfde600aef0cc 6088e246 04a4937c 04a4937c 03bd7968 PresentationCore_ni+0x18a59100aef108 73e63de2 00d06de0 00aef168 73e73315 Microsoft_VisualStudio_Shell_UI_Internal_ni+0xbe24600aef114 73e73315 00aef1ac 00aef158 73fb2c66 clr!CallDescrWorkerInternal+0x3400aef168 73e76cdf 00000566 6096daa4 609713e4 clr!CallDescrWorkerWithHandler+0x6b00aef1e0 73e7dda9 00aef39c 8a7457f7 607f4c6c clr!MethodDescCallSite::CallTargetWorker+0x15200aef264 73ef0518 8a745647 00000001 03bd76ec clr!TryCallMethod+0x4b*** WARNING: Unable to verify checksum for C:\Windows\assembly\NativeImages_v4.0.30319_32\mscorlib\391541c89ed7585fc7e8936c43cee387\mscorlib.ni.dll00aef3d4 72d6c1f2 00aef3f4 00aef3f8 00aef3f0 clr!RuntimeTypeHandle::CreateInstance+0x37b00aef408 72d6c169 00aef454 00000001 00000000 mscorlib_ni+0x2ec1f200aef43c 72d6e2c4 00aef454 00000001 00000000 mscorlib_ni+0x2ec16900aef45c 72dce657 6088dd33 03bd76cc 03bd76bc mscorlib_ni+0x2ee2c400aef474 6088db84 03bd76dc 00000000 00000000 mscorlib_ni+0x34e65700aef4f4 73e6421e 00aef630 06456438 05bb1ad8 Microsoft_VisualStudio_Shell_UI_Internal_ni+0xbdb8400aef528 73ef6fbf 02fc0710 60864030 00aef5c0 clr!COMToCLRDispatchHelper+0x6b00aef598 61b520ad 00000000 02f6ffd0 06456438 clr!COMToCLRWorker+0x3e600aef5fc 61a31cf6 064579b8 05bb1ad8 06456438 msenv!Gel::CreateWPFUIElementContainer+0x4e00aef644 61a31ed0 9deb64d5 621b9274 06456438 msenv!CreateWpfMainFrame+0x8100aef674 61a31e37 9deb6405 621b9274 621b9258 msenv!CreateMainFrame+0x5000aef6a4 61b89114 9deb647d 00000000 621b9258 msenv!InitMainMenuWindow+0x10d00aef6dc 61b89b08 9deb6449 00000000 619f0000 msenv!InitUIThread+0xfa00aef72c 61b0ac88 9deb6599 00000000 619f0000 msenv!InitFMain+0x36700aef7c0 61a55c7f 9deb6549 00c8a568 619f0000 msenv!VStudioMainLogged+0xcb00aef7e8 2f8eb74a 00c89fc8 d7034b7f 00c8a568 msenv!VStudioMain+0x7c00aef828 2f8ec0c7 d70349a7 75374b51 2f8fbdc4 devenv!util_CallVsMain+0xde00aefaf0 2f902490 00000000 00c75ca4 0000000a devenv!CDevEnvAppId::Run+0x9bc00aefb18 2f9024f5 2f8e0000 00000000 00c75ca4 devenv!WinMain+0xbd00aefb64 753786e3 fe3c7000 00aefbb4 77a4be99 devenv!WinMainCRTStartup+0x12f00aefb70 77a4be99 fe3c7000 8f3cbb7e 00000000 KERNEL32!BaseThreadInitThunk+0xe00aefbb4 77a4be6c 2f8fcc31 fe3c7000 ffffffff ntdll!__RtlUserThreadStart+0x7200aefbcc 00000000 2f8fcc31 fe3c7000 00000000 ntdll!_RtlUserThreadStart+0x1b
托管call stack:
0:000> !clrstackOS Thread Id: 0xc44 (0)Child SP IP Call Site00aec484 76f80f22 [HelperMethodFrame: 00aec484] 00aec540 60695d91 System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)00aec58c 6041c75b MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)00aec5c8 6041c6ab MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)00aec5d8 6041c562 System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)00aec5f8 6041c49a MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)00aec63c 6041aabe System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)00aec690 6041bff1 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)00aede84 02dba2cd [InlinedCallFrame: 00aede84] 00aede80 5d4dc3ed DomainNeutralILStubClass.IL_STUB_PInvoke(AutomationIdType, System.Guid ByRef)00aede84 5d4dc6e9 [InlinedCallFrame: 00aede84] MS.Internal.Automation.UiaCoreTypesApi.RawUiaLookupId(AutomationIdType, System.Guid ByRef)00aedeb8 5d4dc6e9 System.Windows.Automation.AutomationIdentifier.Register(AutomationIdType, System.Guid, System.String)00aedfa8 5d4e0bff System.Windows.Automation.InvokePatternIdentifiers..cctor()00aee14c 73e63de2 [GCFrame: 00aee14c] 00aee634 73e63de2 [HelperMethodFrame: 00aee634] 00aee6c0 5fa71b27 System.Windows.Automation.Peers.AutomationPeer.Initialize()00aee990 5fa71a62 System.Windows.Automation.Peers.AutomationPeer..cctor()00aeeb28 73e63de2 [GCFrame: 00aeeb28] 00aef010 73e63de2 [HelperMethodFrame: 00aef010] 00aef09c 5fa5a555 System.Windows.Automation.Peers.UIElementAutomationPeer..ctor(System.Windows.UIElement)00aef0ac 6088fde6 Microsoft.VisualStudio.PlatformUI.MainWindow.OnCreateAutomationPeer()00aef0b8 5fa58698 System.Windows.UIElement.CreateAutomationPeer()00aef0c8 5fa5a591 System.Windows.Automation.Peers.UIElementAutomationPeer.CreatePeerForElement(System.Windows.UIElement)00aef0d4 6088e246 Microsoft.VisualStudio.PlatformUI.MainWindow..ctor()00aef200 73e63de2 [GCFrame: 00aef200] 00aef2f4 73e63de2 [GCFrame: 00aef2f4] 00aef310 73e63de2 [HelperMethodFrame_2OBJ: 00aef310] System.RuntimeTypeHandle.CreateInstance(System.RuntimeType, Boolean, Boolean, Boolean ByRef, System.RuntimeMethodHandleInternal ByRef, Boolean ByRef)00aef3ec 72d6c1f2 System.RuntimeType.CreateInstanceSlow(Boolean, Boolean, Boolean, System.Threading.StackCrawlMark ByRef)00aef41c 72d6c169 System.RuntimeType.CreateInstanceDefaultCtor(Boolean, Boolean, Boolean, System.Threading.StackCrawlMark ByRef)00aef450 72d6e2c4 System.Activator.CreateInstance(System.Type, Boolean)00aef464 72dce657 System.Activator.CreateInstance(System.Type)00aef468 6088dd33 Microsoft.VisualStudio.PlatformUI.WpfHostPrivate.CreateElementContainerInternal(System.String, IntPtr, System.Object)00aef480 6088db84 Microsoft.VisualStudio.PlatformUI.WpfHostPrivate.CreateWPFUIElementContainer(System.String, IntPtr, Microsoft.VisualStudio.Shell.Interop.IVsUIElement, Microsoft.VisualStudio.Shell.Interop.IVsUIDataSource, System.Object, Microsoft.Internal.VisualStudio.Shell.Interop.IVsUIWPFElementContainerPrivate ByRef)00aef4b8 02fc07b7 DomainNeutralILStubClass.IL_STUB_COMtoCLR(IntPtr, Int32, IntPtr, IntPtr, IntPtr, IntPtr)00aef5b0 73e6421e [ComMethodFrame: 00aef5b0]
注意到Visual Studio启动时会载入一个名为TaobaoProtectSE.dll,是阿里的反钓鱼程序,一个Packed Images加载到devenv.exe进程中。将对应注入监控的TaobaoProtect.exe关闭再次启动问题解决。
本来想bp USER32!PostMessageW来观察TaobaoProtectSE.dll到底发了什么消息,个人时间有限也就没再继续深究。
补充:
1、基于WPF 4.0开发的应用程序都受到影响。
2、Visual Studio 2010、Visual Studio 2012版本都未出现该问题,而TaobaoProtectSE.dll也同样注入到其进程。