wpf icon indicating copy to clipboard operation
wpf copied to clipboard

WPF crashed unexpectedly.

Open ET-KK opened this issue 5 months ago • 10 comments

Description

WPF crashed unexpectedly.

UI stack trace:

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)

Reproduction Steps

TBU

Expected behavior

TBU

Actual behavior

TBU

Regression?

No response

Known Workarounds

No response

Impact

No response

Configuration

.NET Framework 4.6.2 (32-bit) Windows 11

Other information

No response

ET-KK avatar Sep 17 '25 02:09 ET-KK

#439

Symbai avatar Sep 17 '25 04:09 Symbai

I am able to reproduce the problem consistently.

Based on https://learn.microsoft.com/en-us/troubleshoot/developer/dotnet/framework/general/wpf-render-thread-failures,

  1. Updated machine's registry - https://learn.microsoft.com/en-us/dotnet/desktop/wpf/graphics-multimedia/graphics-rendering-registry-settings#disable-hardware-acceleration-option
  2. Run WPF application and still see similar stack trace.

What other information is needed for detail troubleshooting and workable fixes? @SamBent

ET-KK avatar Sep 17 '25 04:09 ET-KK

@ET-KK How about use the debug version wpf and add the breakpoint to MilInstrumentationCallHRCheckFunction when dwFailureFlags be true:

https://github.com/dotnet/wpf/blob/ee7cbb82652173e3a9f4e8feec155eb58eed5f4f/src/Microsoft.DotNet.Wpf/src/WpfGfx/shared/util/UtilLib/Instrumentation.h#L130

And the system log may record some information.

lindexi avatar Sep 17 '25 06:09 lindexi

@ET-KK How about use the debug version wpf and add the breakpoint to MilInstrumentationCallHRCheckFunction when dwFailureFlags be true:

wpf/src/Microsoft.DotNet.Wpf/src/WpfGfx/shared/util/UtilLib/Instrumentation.h

Line 130 in ee7cbb8

MilInstrumentationCallHRCheckFunction( And the system log may record some information.

@lindexi , I don't have the source code. Will full dump file able to help and trace the problems?

ET-KK avatar Sep 17 '25 23:09 ET-KK

@ET-KK

Will full dump file able to help and trace the problems?

I do not think so. Because I do not think you can take the right dump, and I think you will capture the state after the exception occurs.

Because the C# exception raise by the HR value return. And when the HR value return, it means that the state is after the exception occurs.

lindexi avatar Sep 18 '25 00:09 lindexi

@ET-KK How about use the debug version wpf and add the breakpoint to MilInstrumentationCallHRCheckFunction when dwFailureFlags be true:

wpf/src/Microsoft.DotNet.Wpf/src/WpfGfx/shared/util/UtilLib/Instrumentation.h

Line 130 in ee7cbb8

MilInstrumentationCallHRCheckFunction( And the system log may record some information.

@lindexi ,

  1. Is the WPF (debug version) equivalent with .Net Framework 4.6.2 ?
  2. Please advise some sample of system log.

ET-KK avatar Sep 18 '25 23:09 ET-KK

@ET-KK

Is the WPF (debug version) equivalent with .Net Framework 4.6.2 ?

No.

Please advise some sample of system log.

You should not get the samle of my system log, and you should take your device system log when application crash.

How to look the system log?

See: https://www.dell.com/support/kbdoc/en-us/000124382/how-to-export-windows-event-logs

lindexi avatar Sep 19 '25 00:09 lindexi

@ET-KK

Is the WPF (debug version) equivalent with .Net Framework 4.6.2 ?

@lindexi , If I manage to find the source code, which breakdown / debugging steps I should follow ?

No.

Please advise some sample of system log.

You should not get the samle of my system log, and you should take your device system log when application crash.

How to look the system log?

See: https://www.dell.com/support/kbdoc/en-us/000124382/how-to-export-windows-event-logs

@lindexi , which event name/type I should focus on ?

Image

ET-KK avatar Sep 19 '25 03:09 ET-KK

@ET-KK All the relevant information you can obtain. Not only the System Windows logs.

lindexi avatar Sep 19 '25 03:09 lindexi

@ET-KK All the relevant information you can obtain. Not only the System Windows logs.

I not able and should not provide the full event logs, any chance to only provide filtered / lightweight events log ?

ET-KK avatar Sep 19 '25 03:09 ET-KK