本文介绍了该应用程序偶尔会挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 几个星期以来,我一直困扰着一个问题。我的应用程序的UI有时会永远忙于,光标处于繁忙状态,并且UI似乎无法接受任何点击事件。这是零星的。 今天我很幸运能在我的测试计算机中发生这种情况。我可以看到这个过程总是占用CPU的25%用法,我的电脑是四核。我使用Windbg并附加了该进程(在此之前我使用Process Explorer并发现线程使用的最多资源是1a24)。 然后我使用以下命令和相应的输出: 0 :011> !threads ThreadCount: 20 UnstartedThread: 0 BackgroundThread: 10 PendingThread: 0 DeadThread: 8 托管运行时:否PreEmptive Lock ID OSID ThreadOBJ状态GC GC Alloc上下文域计数APT异常 0 1 1840 0000000000604c20 2006020 已启用 0000000000000000 : 0000000000000000 00000000005f89f0 0 STA 2 2 200 000000000060af60 b220已启用 0000000000000000 : 0000000000000000 00000000005f89f0 0 MTA(Finalizer)XXXX 3 000000001d5cff50 19820 已启用 0000000000000000 : 0000000000000000 00000000005f89f0 0 MTA 11 4 1a24 000000001d5e1fe0 7020 已启用 0000000000000000 : 0000000000000000 00000000005f89f0 0 STA XXXX 5 000000001d64a600 1019820 已启用 0000000000000000 : 0000000000000000 00000000005f89f0 0 Ukn(Threadpool Worker)XXXX 6 000000001d634c40 1019820 已启用 0000000000000000 : 0000000000000000 00000000005f89f0 0 Ukn(Threadpool Worker)XXXX 7 00000000244efa40 1019820 已启用 0000000000000000 : 0000000000000000 00000000005f89f0 0 Ukn(Threadpool Worker)XXXX 8 0000000024547280 1019820 已启用 0000000000000000 : 0000000000000000 00000000005f89f0 0 Ukn(Threadpool Worker)XXXX 9 0000000024503790 1019820 已启用 0000000000000000 : 0000000000000000 00000000005f89f0 0 Ukn(Threadpool Worker) 23 a 1754 00000000244c8c40 100a220已启用 0000000000000000 : 0000000000000000 00000000005f89f0 0 MTA(Threadpool Worker) 24 b d44 00000000245b5020 1000220 已启用 0000000000000000 : 0000000000000000 00000000005f89f0 0 Ukn(Threadpool Worker) 25 c 1368 0000000024618140 8009220 已启用0000000005f22278:0000000005f236a8 00000000005f89f0 0 MTA(Threadpool完成端口) ) 10 d 1604 0000000024615810 220 启用00000000 05f29338:0000000005f296a8 00000000005f89f0 0 Ukn 29 e 1b5c 00000000244ed820 b220已启用 0000000000000000 : 0000000000000000 00000000005f89f0 0 MTA 30 f 1fb8 00000000246914e0 b220已启用 0000000000000000 : 0000000000000000 00000000005f89f0 0 MTA 16 10 b70 0000000034246b00 220 已启用 0000000000000000 : 0000000000000000 00000000005f89f0 0 Ukn 28 11 20b8 000000003427bdd0 2000220 已启用 0000000000000000 : 0000000000000000 00000000005f89f0 0 Ukn XXXX 12 0000000034361dc0 21019820 已启用 0000000000000000 : 0000000000000000 00000000005f89f0 0 Ukn(Threadpool Worker)XXXX 13 00000000343624d0 21019820 已启用 0000000000000000 : 0000000000000000 00000000005f89f0 0 Ukn(Threadpool Worker) 38 14 1a48 0000000034362be0 1009220 已启用0000000005f299d8:0000000005f2b6a8 00000000005f89f0 0 MTA(Threadpool Worker) 0 :011> !clrstack OS线程ID:0x1a24( 11 )子SP IP呼叫站点0000000020f55b10 000000005d221fc8 [NDirectMethodFrameStandalone:0000000020f55b10] System.Windows.Media.Composition.MilCoreApi.MilUtility_PolygonHitTest(System。 Windows.Media.Composition.MilMatrix3x2D *,System.Windows.Media.Composition.MIL_PEN_DATA *, Double *,System.Windows.Point *,字节 *, UInt32 , UInt32 , Double , Boolean ,System.Windows.Point *, Boolean ByRef)0000000020f55a90 000007fee273aa54 DomainBoundILStubClass.IL_STUB_PInvoke(System.Windows.Media.Composition.MilMatrix3x2D *,System.Windows.Media.Composition.MIL_PEN_DATA *, Double *,System.Windows.Point * ,字节 *, UInt32 , UInt32 , Double , Boolean ,System.Windows.Point *, Boolean ByRef)0000000020f55bc0 000007fee26f8459 System.Windows.Media.Geometry.ContainsInternal(System。 Windows.Media.Pen,System.Windows.Point, Double ,System.Windows.Media.ToleranceType,System.Windows.Point *, UInt32 ,字节 *, UInt32 )0000000020f55d00 000007fee2dbbc07 System.Windows.Media。 LineGeometry.ContainsInternal(System.Windows.Media.Pen,System.Windows.Point, Double ,System.Windows.Media.ToleranceType)0000000020f55e50 000007fee309cd23 System.Windows.Media。 HitTestWithPointDrawingContextWalker.DrawGeometry(System.Windows.Media.Brush,System.Windows.Media.Pen,System.Windo ws.Media.Geometry)0000000020f55f00 000007fee2dce89d System.Windows.Media.HitTestDrawingContextWalker.DrawLine(System.Windows.Media.Pen,System.Windows.Point,System.Windows.Point)0000000020f55f90 000007fee26d4907 System.Windows.Media.RenderData.DrawingContextWalk( System.Windows.Media.DrawingContextWalker)0000000020f56390 000007fee26f86b0 System.Windows.Media.RenderData.HitTestPoint(System.Windows.Point)0000000020f563e0 000007fee2c29a6e System.Windows.Media.DrawingVisual.HitTestCore(System.Windows.Media.PointHitTestParameters)0000000020f56460 000007fee26ab086 System。 Windows.Media.Visual.HitTestPointInternal(System.Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters)0000000020f56490 000007fee26aae70 System.Windows.Media.Visual.HitTestPoint(System.Windows.Media。 HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters)0000000020f568e0 000007fee26aad2c System .Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters)0000000020f56d30 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media .HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters)0000000020f57180 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,System.Windows .Media.PointHitTestParameters)0000000020f575d0 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters)0000000020f57a20 000007fee26aad2c System.Windows.Media.Visual .HitTestPoint(System.Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters) 0000000020f57e70 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters)0000000020f582c0 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System。 Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters)0000000020f58710 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters)0000000020f58b60 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters)0000000020f58fb0 000007fee26aad2c System.Windows。 Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,Syste m.Windows.Media.PointHitTestParameters)0000000020f59400 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters)0000000020f59850 000007fee26aad2c System.Windows。 Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters)0000000020f59ca0 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters)0000000020f5a0f0 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,System.Windows.Media。 PointHitTestParameters)0000000020f5a540 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback,System.Wi ndows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters)0000000020f5a990 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters) 0000000020f5ade0 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters)0000000020f5b230 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System。 Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters)0000000020f5b680 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters)0000000020f5bad0 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Window) s.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters)0000000020f5bf20 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters)0000000020f5c370 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters)0000000020f5c7c0 000007fee26aad2c System.Windows。 Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters)0000000020f5cc10 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters)0000000020f5d060 000007fee26aad2c System.Windows .Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback,System.Windows.Media.HitTestResultCallback,System.Windows.Media.PointHitTestParameters)0000000020f5d4b0 000007fee26aa7c6 System.Windows.Media.Visual.HitTest(System.Windows.Media.HitTestFilterCallback ,System.Windows.Media.HitTestResultCallback,System.Windows.Media.HitTestParameters)0000000020f5d560 000007fee26a4d40 System.Windows.UIElement.InputHitTest(System.Windows.Point,System.Windows.IInputElement ByRef,System.Windows.IInputElement ByRef)0000000020f5d640 000007fee26ddf11 System .Windows.Input.MouseDevice.LocalHitTest( Boolean ,System.Windows.Point,System.Windows.PresentationSource,System.Windows.IInputElement ByRef,System.Windows.IInputElement ByRef )0000000020f5d720 000007fee26ddbdf System.Windows.Input.MouseDevice.GlobalHitTest( Boolean ,System.Windows.Point,System.Windows.PresentationSource,System.Windows.IInputElement ByRef,S ystem.Windows.IInputElement ByRef)0000000020f5d880 000007fee2ba87e0 System.Windows.Input.MouseDevice.GlobalHitTest( Boolean ,System.Windows.Point,System.Windows.PresentationSource)0000000020f5d8e0 000007fee308d638系统.Windows.Input.MouseDevice.PreNotifyInput(System。 Object ,System.Windows.Input.NotifyInputEventArgs)0000000020f5db60 000007fee26ccc69 System.Windows.Input.InputManager.ProcessStagingArea()0000000020f5dbf0 000007fee26dc66d System.Windows.Input.MouseDevice.Synchronize()0000000020f5dca0 000007fee26df32d System.Windows.Input.InputManager.HitTestInvalidatedAsyncCallback(System。 Object )0000000020f5dce0 000007fee478d11a System.Windows.Threading.ExceptionWrapper .InternalRealCall(System.Delegate,System。 Object , Int32 )0000000020f5dd40 000007fee478d0a7 MS.Internal.Threading.ExceptionFilterHelpe r.TryCatchWhen(System。 Object ,System.Delegate,System。 Object , Int32 ,System.Delegate)0000000020f5dda0 000007fee49ba6ad System.Windows.Threading.Dispatcher.WrappedInvoke(System.Delegate,System。 Object , Int32 ,System.Delegate)0000000020f5de00 000007fee4791105 System.Windows.Threading.DispatcherOperation.InvokeImpl()0000000020f5deb0 000007fef6103188 System.Threading.ExecutionContext.runTryCode(System。对象)0000000020f5e5d8 000007fef70935b4 [HelperMethodFrame_PROTECTOBJ:0000000020f5e5d8] System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode,CleanupCode,System。 Object )0000000020f5e700 000007fef60f17f1 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.Conte xtCallback,System。 Object , Boolean )0000000020f5e760 000007fef60f173b System.Threading.ExecutionContext.Run(System.Threading。 ExecutionContext,System.Threading.ContextCallback,System。 Object )0000000020f5e7b0 000007fee4790f3d System.Windows.Threading.DispatcherOperation.Invoke()0000000020f5e820 000007fee478abff System.Windows.Threading.Dispatcher.ProcessQueue ()0000000020f5e8d0 000007fee478af53 System.Windows.Threading.Dispatcher.WndProcHook( IntPtr , Int32 , IntPtr , IntPtr ,布尔 ByRef)0000000020f5e990 000007fee478d440 MS.Win32 .HwndWrapper.WndProc( IntPtr , Int32 , IntPtr , IntPtr , Boolean ByRef)0000000020f5ea40 000007fee478d2b7 MS.Win32.HwndSubclass.DispatcherCallbackOperation(System。对象)0000000020f5ea90 000007fee478d11a System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate,System。 Object , Int32 )0000000020f5eaf0 000007fee478d0a7 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System。 Object ,System.Delegate,System。 Object , Int32 ,System.Delegate)0000000020f5eb50 000007fee49ba6ad System.Windows.Threading.Dispatcher.WrappedInvoke(System.Delegate,System。 Object , Int32 ,System.Delegate)0000000020f5ebb0 000007fee478a258 System.Windows.Threading.Dispatcher.InvokeImpl(System。 Windows.Threading.DispatcherPriority,System.TimeSpan,System.Delegate,System。 Object , Int32 )0000000020f5ec70 000007fee478c914 MS.Win32.HwndSubclass.SubclassWndProc( IntPtr , Int32 , IntPtr , IntPtr )0000000020f5eda0 000007fee4936cc0 DomainBoundILStubClass.IL_STUB_ReversePInvoke( Int64 , Int32 , Int64 , Int64 )0000000020f5f0d8 000007fef7035757 [NDirectMethodFrameStandalone:0000000020f5f0d8] MS .Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)0000000020f5f0a0 000007fee47b0ff0 DomainBoundILStubClass.IL_STUB_PInvoke(System.Windows.Interop.MSG ByRef)0000000020f5f170 000007fee478943a System.Windows.Threadi ng.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)0000000020f5f250 000007ff0017d0d8 MyApplication.StartWindow()0000000020f5f2e0 000007fef60f182c System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System。 Object , Boolean )0000000020f5f340 000007fef60f173b System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System 。 Object )0000000020f5f390 000007fef6186f9d System.Threading.ThreadHelper.ThreadStart()0000000020f5f7e8 000007fef70935b4 [GCFrame:0000000020f5f7e8] 0000000020f5fbd0 000007fef70935b4 [DebuggerU2MCatchHandlerFrame:0000000020f5fbd0] 0 :011〕 ~11s 我发现只有找到的调用堆栈是0000000020f5f250 000007ff0017d0d8 MyApplication.StartWindow()。并且不能跟随下面的调用堆栈。 并且我随时从Process Explorer发现当前线程CallStack是: wpfgfx_v0400.dll!RenderOptions_IsSoftwareRenderingForcedForProcess + 0x23b95 wpfgfx_v0400.dll!RenderOptions_IsSoftwareRenderingForcedForProcess + 0x24ec7 wpfgfx_v0400.dll!RenderOptions_IsSoftwareRenderingForcedForProcess + 0x242bc wpfgfx_v0400。 dll!WgxConnection_Create + 0x2a39 wpfgfx_v0400.dll!MilCompositionEngine_DeinitializePartitionManager + 0x398f wpfgfx_v0400.dll!MilUtility_PolygonBounds + 0x705 wpfgfx_v0400.dll!MilUtility_PolygonBounds + 0x742 wpfgfx_v0400.dll!MilUtility_PolygonBounds + 0x610 wpfgfx_v0400.dll!MilCompositionEngine_DeinitializePartitionManager + 0x3aad wpfgfx_v0400.dll!MilCompositionEngine_DeinitializePartitionManager + 0x39c7 wpfgfx_v0400.dll!MilUtility_PathGeometryBounds + 0x1993 wpfgfx_v0400.dll!RenderOptions_IsSoftwareRenderingForcedForProcess + 0x 235ea wpfgfx_v0400.dll!WgxConnection_Create + 0x204ee clr.dll + 0x17c7 PresentationCore.ni.dll + 0x33aa54 PresentationCore.ni.dll + 0x2f8459 PresentationCore.ni .dll + 0x9bbc07 PresentationCore.ni.dll + 0xc9cd23 PresentationCore.ni.dll + 0x9ce89d PresentationCore.ni.dll + 0x2d4907 PresentationCore.ni.dll + 0x2f86b0 PresentationCore.ni.dll + 0x829a6e PresentationCore.ni.dll + 0x2ab086 PresentationCore.ni.dll + 0x2aae70 PresentationCore.ni.dll + 0x2aad2c PresentationCore.ni。 dll + 0x2aa7c6 PresentationCore.ni.dll + 0x2a4d40 PresentationCore.ni.dll + 0x2ddf11 PresentationCore.ni.dll + 0x2ddbdf PresentationCore.ni.dll + 0x7a87e0 PresentationCore.ni.dll + 0xc8d638 PresentationCore.ni.dll + 0x2ccc69 PresentationCore.ni.dll + 0x2dc66d PresentationCore.ni.dll + 0x2df32d WindowsBase.ni.dll + 0x11d11a WindowsBase.ni.dll + 0x11d0a7 WindowsBase.ni.dll + 0x34a6ad WindowsBase.ni.dll + 0x121105 mscorlib.ni.dll + 0x383188 clr.dll!StrongNameErrorInfo + 0x53f34 clr.dll!StrongNameErrorInfo + 0x54049 clr.dll!StrongNameErrorInfo + 0x540c5 clr.dll!CoUninitializeEE + 0x32872 clr.dll !CoUninitializeEE + 0x32691 mscorlib.ni.dll + 0x3717f1 mscorlib.ni.dll + 0x37173b WindowsBase.ni.dll + 0x120f3d WindowsBase.ni.dll + 0x11abff WindowsBase.ni.dll + 0x11af53 WindowsBase.ni.dll + 0x11d440 WindowsBase.ni.dll + 0x11d2b7 WindowsBase.ni.dll + 0x11d11a WindowsBase.ni。 dll + 0x11d0a7 WindowsBase.ni.dll + 0x34a6ad WindowsBase.ni.dll + 0x11a258 WindowsBase.ni.dll + 0x11c914 WindowsBase.ni.dll + 0x2c6cc0 clr.dll!CoUninitializeEE + 0x31a67 USER32.dll!TranslateMessageEx + 0x2a1 USER32.dll!TranslateMessage + 0x1ea clr.dll + 0x17c7 WindowsBase.ni.dll + 0x140ff0 WindowsBase.ni.dll + 0x11943a 我不知道它是否是.NET的已知错误。 有谁能帮忙告诉我如何找到解决这个问题的方法?非常感谢。解决方案 这实际上取决于您在应用程序中的操作,尝试注释掉部分代码以查看它发生的位置。 I've bothered for a question for weeks. The UI of my application sometimes would run into busy forever, the cursor is at busy state and the UI seems cannot accept any click event. and this is sporadic.Today I'm lucky to get this happend in my test computer.I can see this process always occupy the 25%of CPU usage ,and my computer is quad-core. I use the "Windbg" and attached that process(before that i use "Process Explorer" and found the thread use most resource is 1a24 ).then I use following command and corresponding output:0:011> !threads ThreadCount: 20 UnstartedThread: 0 BackgroundThread: 10 PendingThread: 0 DeadThread: 8 Hosted Runtime: no PreEmptive Lock ID OSID ThreadOBJ State GC GC Alloc Context Domain Count APT Exception 0 1 1840 0000000000604c20 2006020 Enabled 0000000000000000:0000000000000000 00000000005f89f0 0 STA 2 2 200 000000000060af60 b220 Enabled 0000000000000000:0000000000000000 00000000005f89f0 0 MTA (Finalizer) XXXX 3 000000001d5cff50 19820 Enabled 0000000000000000:0000000000000000 00000000005f89f0 0 MTA 11 4 1a24 000000001d5e1fe0 7020 Enabled 0000000000000000:0000000000000000 00000000005f89f0 0 STA XXXX 5 000000001d64a600 1019820 Enabled 0000000000000000:0000000000000000 00000000005f89f0 0 Ukn (Threadpool Worker) XXXX 6 000000001d634c40 1019820 Enabled 0000000000000000:0000000000000000 00000000005f89f0 0 Ukn (Threadpool Worker) XXXX 7 00000000244efa40 1019820 Enabled 0000000000000000:0000000000000000 00000000005f89f0 0 Ukn (Threadpool Worker) XXXX 8 0000000024547280 1019820 Enabled 0000000000000000:0000000000000000 00000000005f89f0 0 Ukn (Threadpool Worker) XXXX 9 0000000024503790 1019820 Enabled 0000000000000000:0000000000000000 00000000005f89f0 0 Ukn (Threadpool Worker) 23 a 1754 00000000244c8c40 100a220 Enabled 0000000000000000:0000000000000000 00000000005f89f0 0 MTA (Threadpool Worker) 24 b d44 00000000245b5020 1000220 Enabled 0000000000000000:0000000000000000 00000000005f89f0 0 Ukn (Threadpool Worker) 25 c 1368 0000000024618140 8009220 Enabled 0000000005f22278:0000000005f236a8 00000000005f89f0 0 MTA (Threadpool Completion Port) 10 d 1604 0000000024615810 220 Enabled 0000000005f29338:0000000005f296a8 00000000005f89f0 0 Ukn 29 e 1b5c 00000000244ed820 b220 Enabled 0000000000000000:0000000000000000 00000000005f89f0 0 MTA 30 f 1fb8 00000000246914e0 b220 Enabled 0000000000000000:0000000000000000 00000000005f89f0 0 MTA 16 10 b70 0000000034246b00 220 Enabled 0000000000000000:0000000000000000 00000000005f89f0 0 Ukn 28 11 20b8 000000003427bdd0 2000220 Enabled 0000000000000000:0000000000000000 00000000005f89f0 0 Ukn XXXX 12 0000000034361dc0 21019820 Enabled 0000000000000000:0000000000000000 00000000005f89f0 0 Ukn (Threadpool Worker) XXXX 13 00000000343624d0 21019820 Enabled 0000000000000000:0000000000000000 00000000005f89f0 0 Ukn (Threadpool Worker) 38 14 1a48 0000000034362be0 1009220 Enabled 0000000005f299d8:0000000005f2b6a8 00000000005f89f0 0 MTA (Threadpool Worker) 0:011> !clrstack OS Thread Id: 0x1a24 (11) Child SP IP Call Site 0000000020f55b10 000000005d221fc8 [NDirectMethodFrameStandalone: 0000000020f55b10] System.Windows.Media.Composition.MilCoreApi.MilUtility_PolygonHitTest(System.Windows.Media.Composition.MilMatrix3x2D*, System.Windows.Media.Composition.MIL_PEN_DATA*, Double*, System.Windows.Point*, Byte*, UInt32, UInt32, Double, Boolean, System.Windows.Point*, Boolean ByRef) 0000000020f55a90 000007fee273aa54 DomainBoundILStubClass.IL_STUB_PInvoke(System.Windows.Media.Composition.MilMatrix3x2D*, System.Windows.Media.Composition.MIL_PEN_DATA*, Double*, System.Windows.Point*, Byte*, UInt32, UInt32, Double, Boolean, System.Windows.Point*, Boolean ByRef) 0000000020f55bc0 000007fee26f8459 System.Windows.Media.Geometry.ContainsInternal(System.Windows.Media.Pen, System.Windows.Point, Double, System.Windows.Media.ToleranceType, System.Windows.Point*, UInt32, Byte*, UInt32) 0000000020f55d00 000007fee2dbbc07 System.Windows.Media.LineGeometry.ContainsInternal(System.Windows.Media.Pen, System.Windows.Point, Double, System.Windows.Media.ToleranceType) 0000000020f55e50 000007fee309cd23 System.Windows.Media.HitTestWithPointDrawingContextWalker.DrawGeometry(System.Windows.Media.Brush, System.Windows.Media.Pen, System.Windows.Media.Geometry) 0000000020f55f00 000007fee2dce89d System.Windows.Media.HitTestDrawingContextWalker.DrawLine(System.Windows.Media.Pen, System.Windows.Point, System.Windows.Point) 0000000020f55f90 000007fee26d4907 System.Windows.Media.RenderData.DrawingContextWalk(System.Windows.Media.DrawingContextWalker) 0000000020f56390 000007fee26f86b0 System.Windows.Media.RenderData.HitTestPoint(System.Windows.Point) 0000000020f563e0 000007fee2c29a6e System.Windows.Media.DrawingVisual.HitTestCore(System.Windows.Media.PointHitTestParameters) 0000000020f56460 000007fee26ab086 System.Windows.Media.Visual.HitTestPointInternal(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f56490 000007fee26aae70 System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f568e0 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f56d30 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f57180 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f575d0 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f57a20 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f57e70 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f582c0 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f58710 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f58b60 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f58fb0 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f59400 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f59850 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f59ca0 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f5a0f0 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f5a540 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f5a990 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f5ade0 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f5b230 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f5b680 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f5bad0 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f5bf20 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f5c370 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f5c7c0 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f5cc10 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f5d060 000007fee26aad2c System.Windows.Media.Visual.HitTestPoint(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.PointHitTestParameters) 0000000020f5d4b0 000007fee26aa7c6 System.Windows.Media.Visual.HitTest(System.Windows.Media.HitTestFilterCallback, System.Windows.Media.HitTestResultCallback, System.Windows.Media.HitTestParameters) 0000000020f5d560 000007fee26a4d40 System.Windows.UIElement.InputHitTest(System.Windows.Point, System.Windows.IInputElement ByRef, System.Windows.IInputElement ByRef) 0000000020f5d640 000007fee26ddf11 System.Windows.Input.MouseDevice.LocalHitTest(Boolean, System.Windows.Point, System.Windows.PresentationSource, System.Windows.IInputElement ByRef, System.Windows.IInputElement ByRef) 0000000020f5d720 000007fee26ddbdf System.Windows.Input.MouseDevice.GlobalHitTest(Boolean, System.Windows.Point, System.Windows.PresentationSource, System.Windows.IInputElement ByRef, System.Windows.IInputElement ByRef) 0000000020f5d880 000007fee2ba87e0 System.Windows.Input.MouseDevice.GlobalHitTest(Boolean, System.Windows.Point, System.Windows.PresentationSource) 0000000020f5d8e0 000007fee308d638 System.Windows.Input.MouseDevice.PreNotifyInput(System.Object, System.Windows.Input.NotifyInputEventArgs) 0000000020f5db60 000007fee26ccc69 System.Windows.Input.InputManager.ProcessStagingArea() 0000000020f5dbf0 000007fee26dc66d System.Windows.Input.MouseDevice.Synchronize() 0000000020f5dca0 000007fee26df32d System.Windows.Input.InputManager.HitTestInvalidatedAsyncCallback(System.Object) 0000000020f5dce0 000007fee478d11a System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) 0000000020f5dd40 000007fee478d0a7 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) 0000000020f5dda0 000007fee49ba6ad System.Windows.Threading.Dispatcher.WrappedInvoke(System.Delegate, System.Object, Int32, System.Delegate) 0000000020f5de00 000007fee4791105 System.Windows.Threading.DispatcherOperation.InvokeImpl() 0000000020f5deb0 000007fef6103188 System.Threading.ExecutionContext.runTryCode(System.Object) 0000000020f5e5d8 000007fef70935b4 [HelperMethodFrame_PROTECTOBJ: 0000000020f5e5d8] System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object) 0000000020f5e700 000007fef60f17f1 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 0000000020f5e760 000007fef60f173b System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) 0000000020f5e7b0 000007fee4790f3d System.Windows.Threading.DispatcherOperation.Invoke() 0000000020f5e820 000007fee478abff System.Windows.Threading.Dispatcher.ProcessQueue() 0000000020f5e8d0 000007fee478af53 System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) 0000000020f5e990 000007fee478d440 MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) 0000000020f5ea40 000007fee478d2b7 MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object) 0000000020f5ea90 000007fee478d11a System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) 0000000020f5eaf0 000007fee478d0a7 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) 0000000020f5eb50 000007fee49ba6ad System.Windows.Threading.Dispatcher.WrappedInvoke(System.Delegate, System.Object, Int32, System.Delegate) 0000000020f5ebb0 000007fee478a258 System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32) 0000000020f5ec70 000007fee478c914 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr) 0000000020f5eda0 000007fee4936cc0 DomainBoundILStubClass.IL_STUB_ReversePInvoke(Int64, Int32, Int64, Int64) 0000000020f5f0d8 000007fef7035757 [NDirectMethodFrameStandalone: 0000000020f5f0d8] MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef) 0000000020f5f0a0 000007fee47b0ff0 DomainBoundILStubClass.IL_STUB_PInvoke(System.Windows.Interop.MSG ByRef) 0000000020f5f170 000007fee478943a System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame) 0000000020f5f250 000007ff0017d0d8 MyApplication.StartWindow() 0000000020f5f2e0 000007fef60f182c System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 0000000020f5f340 000007fef60f173b System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) 0000000020f5f390 000007fef6186f9d System.Threading.ThreadHelper.ThreadStart() 0000000020f5f7e8 000007fef70935b4 [GCFrame: 0000000020f5f7e8] 0000000020f5fbd0 000007fef70935b4 [DebuggerU2MCatchHandlerFrame: 0000000020f5fbd0] 0:011> ~11sand I found that only found call stack is "0000000020f5f250 000007ff0017d0d8 MyApplication.StartWindow()". and cannot follow the following call stack.and anytime I found the current thread "CallStack" from "Process Explorer" is :wpfgfx_v0400.dll!RenderOptions_IsSoftwareRenderingForcedForProcess+0x23b95wpfgfx_v0400.dll!RenderOptions_IsSoftwareRenderingForcedForProcess+0x24ec7wpfgfx_v0400.dll!RenderOptions_IsSoftwareRenderingForcedForProcess+0x242bcwpfgfx_v0400.dll!WgxConnection_Create+0x2a39wpfgfx_v0400.dll!MilCompositionEngine_DeinitializePartitionManager+0x398fwpfgfx_v0400.dll!MilUtility_PolygonBounds+0x705wpfgfx_v0400.dll!MilUtility_PolygonBounds+0x742wpfgfx_v0400.dll!MilUtility_PolygonBounds+0x610wpfgfx_v0400.dll!MilCompositionEngine_DeinitializePartitionManager+0x3aadwpfgfx_v0400.dll!MilCompositionEngine_DeinitializePartitionManager+0x39c7wpfgfx_v0400.dll!MilUtility_PathGeometryBounds+0x1993wpfgfx_v0400.dll!RenderOptions_IsSoftwareRenderingForcedForProcess+0x235eawpfgfx_v0400.dll!WgxConnection_Create+0x204eeclr.dll+0x17c7PresentationCore.ni.dll+0x33aa54PresentationCore.ni.dll+0x2f8459PresentationCore.ni.dll+0x9bbc07PresentationCore.ni.dll+0xc9cd23PresentationCore.ni.dll+0x9ce89dPresentationCore.ni.dll+0x2d4907PresentationCore.ni.dll+0x2f86b0PresentationCore.ni.dll+0x829a6ePresentationCore.ni.dll+0x2ab086PresentationCore.ni.dll+0x2aae70PresentationCore.ni.dll+0x2aad2cPresentationCore.ni.dll+0x2aa7c6PresentationCore.ni.dll+0x2a4d40PresentationCore.ni.dll+0x2ddf11PresentationCore.ni.dll+0x2ddbdfPresentationCore.ni.dll+0x7a87e0PresentationCore.ni.dll+0xc8d638PresentationCore.ni.dll+0x2ccc69PresentationCore.ni.dll+0x2dc66dPresentationCore.ni.dll+0x2df32dWindowsBase.ni.dll+0x11d11aWindowsBase.ni.dll+0x11d0a7WindowsBase.ni.dll+0x34a6adWindowsBase.ni.dll+0x121105mscorlib.ni.dll+0x383188clr.dll!StrongNameErrorInfo+0x53f34clr.dll!StrongNameErrorInfo+0x54049clr.dll!StrongNameErrorInfo+0x540c5clr.dll!CoUninitializeEE+0x32872clr.dll!CoUninitializeEE+0x32691mscorlib.ni.dll+0x3717f1mscorlib.ni.dll+0x37173bWindowsBase.ni.dll+0x120f3dWindowsBase.ni.dll+0x11abffWindowsBase.ni.dll+0x11af53WindowsBase.ni.dll+0x11d440WindowsBase.ni.dll+0x11d2b7WindowsBase.ni.dll+0x11d11aWindowsBase.ni.dll+0x11d0a7WindowsBase.ni.dll+0x34a6adWindowsBase.ni.dll+0x11a258WindowsBase.ni.dll+0x11c914WindowsBase.ni.dll+0x2c6cc0clr.dll!CoUninitializeEE+0x31a67USER32.dll!TranslateMessageEx+0x2a1USER32.dll!TranslateMessage+0x1eaclr.dll+0x17c7WindowsBase.ni.dll+0x140ff0WindowsBase.ni.dll+0x11943aI don't know is it a known bug of .NET or not.Can anyone help to tell me how to find the way to solve this problem? Thanks a lot. 解决方案 It really depends on what you are doing in your application, try commenting out portions of your code to see where it is happening. 这篇关于该应用程序偶尔会挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-19 00:26