Application ErrorSystem.InvalidOperationException: An unspecified error occurred on the render thread

2

Our Framework 3.5 sp1, WPF application hangs randomly with the below exception on XP and win 7 machines. We have several 100's of users and this happens in random for anyone and we haven't seen any pattern in the occurrence of the exception. We searched a lot, there is a 3.5 patch release by MS which is also included in 3.5 sp1 that is supposed to fix this issue, but as you see it still happens for us.

ERROR 2012-12-10 08:56:12,348[UI]: Host : Application ErrorSystem.InvalidOperationException: An unspecified error occurred on the render thread.
   at System.Windows.Media.MediaContext.NotifyPartitionIsZombie(Int32 failureCode)
   at System.Windows.Media.MediaContext.NotifyChannelMessage()
   at System.Windows.Interop.HwndTarget.HandleMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 

We see in our logs that the below exception is logged 10-15 times repetitively before the above Renderthread exception is thrown. We also notice a brief period of inactivity (10-15 mins) in the logs before the exception starts appearing

ERROR 2012-12-04 10:38:30,854[UI]: Host : Application ErrorSystem.Runtime.InteropServices.COMException (0x88980406): Exception from HRESULT: 0x88980406
   at System.Windows.Media.Composition.DUCE.Channel.SyncFlush()
   at System.Windows.Media.Composition.DUCE.CompositionTarget.UpdateWindowSettings(ResourceHandle hCompositionTarget, RECT windowRect, Color colorKey, Single constantAlpha, MILWindowLayerType windowLayerType, MILTransparencyFlags transparencyMode, Boolean isChild, Boolean isRTL, Boolean renderingEnabled, Int32 disableCookie, Channel channel)
   at System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget, Nullable`1 channelSet)
   at System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget)
   at System.Windows.Interop.HwndTarget.UpdateWindowPos(IntPtr lParam)
   at System.Windows.Interop.HwndTarget.HandleMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

Restarting the application fixes the issue. However, this is quickly becoming an issue to of priority for us. Would really appreciate any pointers to help sort this issue.

c#
.net
wpf
.net-4.0
asked on Stack Overflow Dec 11, 2012 by praskris • edited Dec 12, 2012 by praskris

1 Answer

0

This is was kind of a Red Herring. This problem was resolved by the engineering team. Our users were using virtual machines and were connecting to the machines using citrix. The reverse seamless setup that citrix enables for using client machine cpu/gpu for offloading graphics and rendering was causing this issue.

answered on Stack Overflow Nov 8, 2013 by praskris

User contributions licensed under CC BY-SA 3.0