Skip to content

OOM: DUCE+Channel.SyncFlush() #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
clairernovotny opened this issue Dec 8, 2018 · 13 comments
Closed

OOM: DUCE+Channel.SyncFlush() #128

clairernovotny opened this issue Dec 8, 2018 · 13 comments
Labels
Bug Product bug (most likely) needs more information Not enough information has been provided. Please share more detail as requested needs-watson-data Needs data from telemetry
Milestone

Comments

@clairernovotny
Copy link

From telemetry, app crash:

System.OutOfMemoryException: Insufficient memory to continue the execution of the program.
   at MS.Internal.HRESULT.Check(int hr)
   at System.Windows.Media.Composition.DUCE+Channel.SyncFlush()
   at System.Windows.Interop.HwndTarget.UpdateWindowSettings(bool enableRenderTarget, Nullable<T> channelSet)
   at System.Windows.Interop.HwndTarget.UpdateWindowSettings(bool enableRenderTarget)
   at System.Windows.Interop.HwndTarget.OnShowWindow(bool enableRenderTarget)
   at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, object args, int numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, Delegate callback, object args, int numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, object args, int numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, object args, int numArgs)
   at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, object arg)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam)
@vatsan-madhavan
Copy link
Member

We’ll need a heap dump to investigate this further. Syncflush is a catch-all signature.

This can be a real OOM, or a proxy for another kind of resource exhaustion (GDI handle, which incidentally has a per-session limit).

@vatsan-madhavan vatsan-madhavan added Bug Product bug (most likely) needs more information Not enough information has been provided. Please share more detail as requested labels Dec 8, 2018
@clairernovotny
Copy link
Author

Not sure I'll be able to get that, but WER may have it. Unfortunately, I don't have access to that data. It's coming from telemetry :/

@vatsan-madhavan vatsan-madhavan added this to the Future milestone Dec 8, 2018
@vatsan-madhavan
Copy link
Member

I’ll see if I can find additional data and/or crash dumps.

@vatsan-madhavan vatsan-madhavan self-assigned this Dec 8, 2018
@clairernovotny
Copy link
Author

If it helps, they might be tied to its Store AppId: 9WZDNCRDMDM3. It has a bunch of crash data that's not available to me. It might be available to you.

@mrbcmorris
Copy link

Hi @vatsan-madhavan,

I'm encountering this issue as well, I've got a memory dump that was captured while our managed code in the UnhandledDispatcherException. How can I provide this to you? One thing to note, our application is using WindowsFormIntegration.

@itsho
Copy link

itsho commented Sep 8, 2020

I'm having the same crash with slightly different stack:

System.OutOfMemoryException: Insufficient memory to continue the execution of the program. 	
	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.OnWindowPosChanging(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 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) 	
	at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) 	
	at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) 	

System.OutOfMemoryException: Insufficient memory to continue the execution of the program. 	
	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.OnWindowPosChanging(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 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) 	
	at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) 	
	at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) 	

System.OutOfMemoryException: Insufficient memory to continue the execution of the program. 	
	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.OnWindowPosChanging(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 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) 	
	at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) 	
	at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) 	

System.OutOfMemoryException: Insufficient memory to continue the execution of the program. 	
	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.OnWindowPosChanging(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 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) 	
	at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) 	
	at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) 
  1. The bug is reproducible but it takes a while to do so.
  2. The app is composed from WinForms and WPF.
  3. Can it be related to this error in StackOverflow?

@vatsan-madhavan
Copy link
Member

@itsho, Is this in .NET Core of .NET Framework?
@SamBent Did you make wpfx.dll work on .NET Core yet?

@itsho
Copy link

itsho commented Sep 8, 2020

@vatsan-madhavan it's .NET framework

@milos12345
Copy link

I have been getting this for years in telemetry from hundreds of users, with slight variation of Stack Trace:

System.OutOfMemoryException: Insufficient memory to continue the execution of the program.
   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 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

and

System.Runtime.InteropServices.COMException (0x88980406): UCEERR_RENDERTHREADFAILURE (Excepción de HRESULT: 0x88980406)
   en System.Windows.Media.Composition.DUCE.Channel.SyncFlush()
   en System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget, Nullable`1 channelSet)
   en System.Windows.Interop.HwndTarget.UpdateWindowPos(IntPtr lParam)
   en System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
   en System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   en MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   en MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   en System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   en System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

-Sometimes happening seconds after starting program and sometimes after hours of running.
-Sometimes first time it happens after 100 runs
-All possible graphic cards, from Quadro to integrated; From Windows 7 to latest one
-Most recenlty one user reached out, checked that they had the lastest GPU driver, and he said it happened as he restored the window, seeing "only empty windows aero frame/container is visible", computer went to sleep a few times during that day, and after restarting PC he could not reproduce the error
-WPF, from .NET 4.5 - 4.8; no winforms elements

I have never caught it, but if there is something that an average user could do to help debug, or any other info, I can popup a message the next time exception contains SyncFlush() asking user to send more specific information

@jingsong-liu
Copy link

Same issue in my application, in .net framework 4.6.
Same log with above.

@theindra
Copy link

I have the same issue but only on Windows Server 2012 and Windows 8.

Exact same stacktrace as above.

@SamBent
Copy link
Contributor

SamBent commented Nov 30, 2020

To everyone who has the same exception and callstack: You probably don't have the same issue, it may not be WPF's fault, and the WPF team can't help you without more detailed information. Please read https://docs.microsoft.com/en-us/troubleshoot/dotnet/framework/wpf-render-thread-failures for a fuller discussion.

I'm closing this issue, as it's not actionable without more information.

@SamBent SamBent closed this as completed Nov 30, 2020
@milos12345
Copy link

milos12345 commented Apr 16, 2021

In my crash log this error precedes SyncFlush crash by a second

   в Standard.NativeMethods.DwmExtendFrameIntoClientArea(IntPtr hwnd, MARGINS& pMarInset)
   в System.Windows.Shell.WindowChromeWorker._ExtendGlassFrame()
   в System.Windows.Shell.WindowChromeWorker._UpdateFrameState(Boolean force)
   в System.Windows.Shell.WindowChromeWorker._HandleDwmCompositionChanged(WM uMsg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   в System.Windows.Shell.WindowChromeWorker._WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   в System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   в MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   в MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   в System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Unless I've made mistake in the logging, the window was minimized at the time of the crash and didn't have a focus. I also have that GDI handles count in moment of crash were 120

@ghost ghost locked as resolved and limited conversation to collaborators Apr 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Product bug (most likely) needs more information Not enough information has been provided. Please share more detail as requested needs-watson-data Needs data from telemetry
Projects
None yet
Development

No branches or pull requests

8 participants