Skip to content
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

Application freezes and becomes unresponsive while using Fluent theme of PresentationFrameWork in .NET 90 project #10203

Open
ushasundarajan opened this issue Dec 24, 2024 · 1 comment
Labels
Investigate Requires further investigation by the WPF team. Win 11 Theming

Comments

@ushasundarajan
Copy link

ushasundarajan commented Dec 24, 2024

Description

We have updated all our controls to support NET 9.0. When using Fluent theme of PresentationFrameWork, the application freezes and becomes unresponsive within few seconds. The application runs fine while using other themes like Aero, Luna, Classic of PresentationFrameWork. We have previously reported similar issue related to custom themes and already reported in #10020 that crashes the application.

Tried the below code as well that was recommended:

The issue is replicating even after using this!

Reproduction Steps

We’ve attached samples project demonstrating this issue and video reference for Issue replication.

Replication Procedure:

  • Run the below sample
  • Right click on the search bar of PropertyGrid
  • See the application freezes and becomes unreponsive

Samples:

Issue replicating sample while using Fluent theme of PresentationFrameWork:
PropertyGridNet90.zip

Issue replicating videos:
https://github.com/user-attachments/assets/48cb5069-4dd9-4c03-b566-8349d23854b9

PropertyGrid_ThemeIssue.webm

Expected behavior

While right clicking the search bar while using Fluent theme the application should not freeze, and the context menu should be visible.

Actual behavior

While right clicking the search bar while using Fluent theme the application freezes and closes automatically within few seconds.

Regression?

No response

Known Workarounds

No response

Impact

No response

Configuration

No response

Other information

No response

@lindexi lindexi added Investigate Requires further investigation by the WPF team. Win 11 Theming labels Dec 25, 2024
@lindexi
Copy link
Member

lindexi commented Dec 25, 2024

I find the 0xC000041D win32 exception in KernelBase.dll. My stacktrace is:

>	KernelBase.dll!RaiseException()
 	user32.dll!UserCallWinProcCheckWow()
 	user32.dll!DispatchClientMessage()
 	user32.dll!__fnINLPWINDOWPOS()
 	ntdll.dll!KiUserCallbackDispatcherContinue()
 	win32u.dll!NtUserSetWindowPos()
 	[Manage to Native]	
 	PresentationCore.dll!System.Windows.Interop.HwndSource.Resize(System.Windows.Size newSize = {System.Windows.Size})	
 	PresentationCore.dll!System.Windows.Interop.HwndSource.OnLayoutUpdated(object obj, System.EventArgs args)	
 	PresentationCore.dll!System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()	
 	PresentationCore.dll!System.Windows.ContextLayoutManager.UpdateLayout()	
 	PresentationCore.dll!System.Windows.Interop.HwndSource.SetLayoutSize()	
 	PresentationCore.dll!System.Windows.Interop.HwndSource.RootVisualInternal.set(System.Windows.Media.Visual value = {System.Windows.Controls.Primitives.PopupRoot})	
 	PresentationFramework.dll!System.Windows.Controls.Primitives.Popup.CreateWindow(bool asyncCall)	
 	PresentationFramework.dll!System.Windows.Controls.Primitives.Popup.OnIsOpenChanged(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e)	
 	PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)	
 	WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args)	
 	WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp = {System.Windows.DependencyProperty}, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry = {System.Windows.EffectiveValueEntry}, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType)	
 	WindowsBase.dll!System.Windows.DependencyObject.SetValueCommon(System.Windows.DependencyProperty dp, object value, System.Windows.PropertyMetadata metadata, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType, bool isInternal)	
 	WindowsBase.dll!System.Windows.DependencyObject.SetValue(System.Windows.DependencyProperty dp, object value)	
 	PresentationFramework.dll!System.Windows.Data.BindingOperations.SetBinding(System.Windows.DependencyObject target, System.Windows.DependencyProperty dp, System.Windows.Data.BindingBase binding)	
 	PresentationFramework.dll!System.Windows.Controls.Primitives.Popup.CreateRootPopupInternal(System.Windows.Controls.Primitives.Popup popup, System.Windows.UIElement child, bool bindTreatMousePlacementAsBottomProperty)	
 	PresentationFramework.dll!System.Windows.Controls.ContextMenu.OnIsOpenChanged(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e)	
 	PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)	
 	WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args)	
 	WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp = {System.Windows.DependencyProperty}, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry = {System.Windows.EffectiveValueEntry}, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType)	
 	WindowsBase.dll!System.Windows.DependencyObject.SetValueCommon(System.Windows.DependencyProperty dp, object value, System.Windows.PropertyMetadata metadata, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType, bool isInternal)	
 	WindowsBase.dll!System.Windows.DependencyObject.SetValue(System.Windows.DependencyProperty dp, object value)	
 	PresentationFramework.dll!System.Windows.Documents.TextEditorContextMenu.OnContextMenuOpening(object sender, System.Windows.Controls.ContextMenuEventArgs e = {System.Windows.Controls.ContextMenuEventArgs})	
 	Syncfusion.Shared.WPF.dll!Syncfusion.Windows.Shared.MaskedTextBox.OnContextMenuOpening(System.Windows.Controls.ContextMenuEventArgs e = {System.Windows.Controls.ContextMenuEventArgs})	
 	PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target)	
 	PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source = {System.Windows.Controls.TextBoxView}, System.Windows.RoutedEventArgs args = {System.Windows.Controls.ContextMenuEventArgs}, bool reRaised = false)	
 	PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender = {System.Windows.Controls.TextBoxView}, System.Windows.RoutedEventArgs args = {System.Windows.Controls.ContextMenuEventArgs})	
 	PresentationCore.dll!System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs args = {System.Windows.Controls.ContextMenuEventArgs})	
 	PresentationFramework.dll!System.Windows.Controls.PopupControlService.RaiseContextMenuOpeningEvent(System.Windows.IInputElement source, double x, double y, bool userInitiated)	
 	PresentationFramework.dll!System.Windows.Controls.PopupControlService.ProcessMouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e = {System.Windows.Input.MouseButtonEventArgs})	
 	PresentationFramework.dll!System.Windows.Controls.PopupControlService.OnPostProcessInput(object sender, System.Windows.Input.ProcessInputEventArgs e)	
 	PresentationCore.dll!System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(System.Tuple<System.Windows.Input.ProcessInputEventHandler, System.Delegate[]> postProcessInput, System.Windows.Input.ProcessInputEventArgs processInputEventArgs = {System.Windows.Input.ProcessInputEventArgs})	
 	PresentationCore.dll!System.Windows.Input.InputManager.ProcessStagingArea()	
 	PresentationCore.dll!System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport inputReport)	
 	PresentationCore.dll!System.Windows.Interop.HwndMouseInputProvider.ReportInput(nint hwnd, System.Windows.Input.InputMode mode, int timestamp, System.Windows.Input.RawMouseActions actions, int x, int y, int wheel)	
 	PresentationCore.dll!System.Windows.Interop.HwndMouseInputProvider.FilterMessage(nint hwnd = 0x0000000002800c9c, MS.Internal.Interop.WindowMessage msg = WM_RBUTTONUP, nint wParam = 0x0000000000000000, nint lParam = 0x00000000000d00f4, ref bool handled = false)	
 	PresentationCore.dll!System.Windows.Interop.HwndSource.InputFilterMessage(nint hwnd = 0x0000000002800c9c, int msg = 0x00000205, nint wParam = 0x0000000000000000, nint lParam = 0x00000000000d00f4, ref bool handled = false)	
 	WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(nint hwnd = 0x0000000002800c9c, int msg, nint wParam = 0x0000000000000000, nint lParam, ref bool handled = false)	
 	WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs)	
 	WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source = {System.Windows.Threading.Dispatcher}, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler = null)	
 	WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs)	
 	WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(nint hwnd = 0x0000000002800c9c, int msg = 0x00000205, nint wParam = 0x0000000000000000, nint lParam = 0x00000000000d00f4)	
 	[Native to Manage]	
 	user32.dll!00007fff3b1883f1()	
 	user32.dll!00007fff3b187eb1()	
 	[Manage to Native]	
 	WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame = {System.Windows.Threading.DispatcherFrame})	
 	PresentationFramework.dll!System.Windows.Application.RunDispatcher(object ignore)	
 	PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window)	
 	ZH.TED.Test.WPF.dll!ZH.TED.Test.WPF.App.Main()	
 	[Native to Manage]	
 	hostpolicy.dll!00007ffe8aa3ec7f()	
 	hostpolicy.dll!00007ffe8aa3ef5c()	
 	hostpolicy.dll!00007ffe8aa3f86a()	
 	hostfxr.dll!00007ffea24fda09()	
 	hostfxr.dll!00007ffea24fff86()	
 	hostfxr.dll!00007ffea250207c()	
 	hostfxr.dll!00007ffea2500553()	
 	hostfxr.dll!00007ffea24f8390()	
 	ZH.TED.Test.WPF.exe!00007ff706ada4a1()	
 	ZH.TED.Test.WPF.exe!00007ff706ada8b6()	
 	ZH.TED.Test.WPF.exe!00007ff706ae21f8()	
 	kernel32.dll!00007fff3c42259d()	
 	ntdll.dll!00007fff3d4aaf38()	

The 0xC000041D win32 exception means STATUS_FATAL_USER_CALLBACK_EXCEPTION:

> error 0xC000041D
# for hex 0xc000041d / decimal -1073740771
  STATUS_FATAL_USER_CALLBACK_EXCEPTION                           ntstatus.h
# An unhandled exception was encountered during a user
# callback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigate Requires further investigation by the WPF team. Win 11 Theming
Projects
None yet
Development

No branches or pull requests

2 participants