Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

0x88980406 SyncFlush() ...Is there a workaround?

Tags:

wpf

crash

wpf-4.0

I get this exception in my application. I have found links discussing it on the web but nothing indicating how to track it down and/or workaround it.

Please do not reply with links from the internet. Please reply with strategies of tracking the source. Please reply with workarounds if you found them.

Source: PresentationCore Message: Exception from HRESULT: 0x88980406 Stack Trace:    at System.Windows.Media.Composition.DUCE.Channel.SyncFlush()    at System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget, Nullable`1 channelSet)    at System.Windows.Interop.HwndTarget.UpdateWindowPos(IntPtr lParam)    at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage 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, Int32 numArgs)    at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) 
like image 323
cbuteau Avatar asked Mar 18 '13 15:03

cbuteau


2 Answers

This is old, but I will answer anyways, since I had the same issue that I just resolved.https://stackoverflow.com/a/18003004/1415307

Basically, my issue with this error came down to an outdated video card driver. After updating to the newest driver, the issue has been resolved.

like image 179
TrialAndError Avatar answered Oct 15 '22 03:10

TrialAndError


In my case it turned out the application in question was already pressing up on memory limits of its specced hardware. Any time I added code that used a decent amount of memory this would crop up.

I ended up using a MemoryFailPoint mechanism when I implemented a feature that placed processing an image buffer on another thread.

https://docs.microsoft.com/en-us/dotnet/api/system.runtime.memoryfailpoint

First implementation did the trick but after many tries QA caused a OOM bomb. So I implemented a MemoryFailPoint() with GC.Collect() loop (hackish I know...but sometimes...get er done).

The main things I learned were:

  1. This is a really bad bug in WPF.
  2. You only have to worry about it if you have truly consumed an inordinate amount of memory.
like image 30
cbuteau Avatar answered Oct 15 '22 02:10

cbuteau