zoukankan      html  css  js  c++  java
  • WPF 后台Render线程崩溃, Exception from HRESULT: 0x88980406

    近期遇到一个问题。窗口在Loaded同一时候Resize会出现黑屏或者直接崩溃, 调查发现是WPF后端的Render线程渲染UI到DirectX时崩溃。

    硬件环境:WES7 + .Net4.0



    WPF 应用程序从两个线程開始:一个用于处理呈现,一个用于管理 UI。呈现线程有效地隐藏在后台执行,而 UI 线程则接收输入、处理事件、绘制屏幕以及执行应用程序代码。



    遇到的这个问题就是用于处理呈现的线程挂了,异常例如以下:
    Exception from HRESULT: 0x88980406

    Stack Trace:
    0000000021a4d8d8 000007fef7a66869 [HelperMethodFrame: 0000000021a4d8d8]
    0000000021a4da20 000007fee485ae0f System.Windows.Media.Composition.DUCE+Channel.SyncFlush()*** WARNING: Unable to verify checksum for PresentationCore.ni.dll
    0000000021a4dae0 000007fee3e95615 System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean, System.Nullable`1<ChannelSet>)
    0000000021a4dd10 000007fee3eabfec System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean)
    0000000021a4dd80 000007fee3eabd0e System.Windows.Interop.HwndTarget.UpdateWindowPos(IntPtr)
    0000000021a4dee0 000007fee3e95fd7 System.Windows.Interop.HwndTarget.HandleMessage(MS.Internal.Interop.WindowMessage, IntPtr, IntPtr)
    0000000021a4e070 000007fee3e93d14 System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
    0000000021a4e0c0 000007fee4b2b450 MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)

    1. Update your video drivers, and/or try different video hardware in the problem machine(s). 【试过560、660、770、970显卡都不会解决这个问题。 试过320.18, 320.49, 353.30等驱动也都不会解决这个问题】

    2. Disable Hardware rendering. As a quick test, you can use the DisableHWAcceleration registry value discussed here. You would set the value to 1 in order to disable WPF's hardware rendering pipeline. Note that this affects all WPF applications running in that user's session, so be advised you might be impacting more than one application. There are other options for disabling hardware acceleration at a more granular level. Starting in .Net 3.5, you can disable it programmatically on a per-window basis by using the HwndTarget.RenderMode property. Starting in .Net 4.0, you can disable it programmatically on a per-process basis by using the RenderOptions.ProcessRenderMode property. 【更改注冊表不会解决这个问题】

    3. Upgrade to the latest version and service pack level of the .Net Framework available for your target platform. 【升级到Net 4.5后。问题解决。降级到4.0后。又出现】

    4. Disable the use of Windows.AllowsTransparency and Popup.AllowsTransparency in your application.【包装的应用窗口的AllowsTransparency为False】

    5. If you are on Windows XP or Windows 2003, test on a newer operating system, and upgrade if possible.【没有測试。升级OS不太可能】

    6. If System.OutOfMemoryExceptions are being reported, then monitor the process's memory usage in Performance Monitor; particularly the ProcessVirtual Bytes, ProcessPrivate Bytes, and .NET CLR Memory# Bytes in All Heaps counters. Also monitor the User Objects and GDI Objects for the process in Windows Task Manager. If you can determine that a specific resource is being exhausted, then troubleshoot the application to fix whatever is causing that resource consumption. Ultimately that should resolve the System.OutOfMemoryException.【查看内存和句柄等,没有内存泄露】




    graphic
  • 相关阅读:
    APP性能之终端兼容优化分享
    Java反射机制
    语音编码的WAVE文件头格式剖析
    【原创】ASP.NET MVC3开发中遇到问题以及解决方法
    linux常用命令(基础)
    vue中粘贴板clipboard的使用方法
    解决部署zabbix中zabbixagent的状态为灰色现象
    IAR Embedded Workbench for ARM: Porting code from V4 to V5 ( for stm32)
    MSDN帮助文档 "无法显示该网页" 的问题解决方案(转)
    二叉排序树求每个结点平衡因子程序
  • 原文地址:https://www.cnblogs.com/tlnshuju/p/7149990.html
Copyright © 2011-2022 走看看