Open DHancock opened 1 year ago
Thanks for the report! Looking at the stowed exception stacks in your dump, this stack appears to be the cause:
0:000> !pde.dse
... snipping out header and Stowed Exception microsoft/WindowsAppSDK#1, which is just a noisy exception...
...
Stowed Exception microsoft/WindowsAppSDK#2 @ 0x000001f443066078
0x8000FFFF (FACILITY_NULL - Default): E_UNEXPECTED - Unexpected failure
Stack : 0x1f443065060
7ffd9f0988a7 Microsoft_ui_xaml!DirectUI::DXamlCore::GetInputPaneOccludeRect+0xeb
7ffd9f09890b Microsoft_ui_xaml!DirectUI::DXamlCore::GetInputPaneOccludeRect+0x47
7ffd9ef86a6f Microsoft_ui_xaml!DirectUI::ContentDialog::AdjustVisualStateForInputPane+0x43
7ffd9ef88a04 Microsoft_ui_xaml!DirectUI::ContentDialog::ChangeVisualState+0x684
7ffd9eaad87d Microsoft_ui_xaml!DirectUI::Control::UpdateVisualState+0x21
7ffd9ef8d54b Microsoft_ui_xaml!DirectUI::ContentDialog::OnFinishedClosing+0x4b
7ffd9ef8da99 Microsoft_ui_xaml!DirectUI::ContentDialog::OnPopupChildUnloaded+0x29
7ffd9eb41028 Microsoft_ui_xaml!std::_Func_class<long,IInspectable *,IInspectable *>::operator()+0x3c
7ffd9eb40fda Microsoft_ui_xaml!ctl::event_handler_base<ABI::Windows::Foundation::IEventHandler<IInspectable *>,IInspectable,IInspectable,DirectUI::FrameworkElementLayoutUpdatedTraits>::Invoke+0x1a
7ffd9e93d3c1 Microsoft_ui_xaml!DirectUI::CRoutedEventSourceBase<DirectUI::IUntypedEventSource,ABI::Microsoft::UI::Xaml::IRoutedEventHandler,IInspectable,ABI::Microsoft::UI::Xaml::IRoutedEventArgs>::Raise+0xd9
7ffd9e93d1f2 Microsoft_ui_xaml!DirectUI::CRoutedEventSourceBase<DirectUI::IUntypedEventSource,ABI::Microsoft::UI::Xaml::IRoutedEventHandler,IInspectable,ABI::Microsoft::UI::Xaml::IRoutedEventArgs>::UntypedRaise+0x92
7ffd9ea68a9f Microsoft_ui_xaml!CCoreServices::CLR_FireEvent+0x3cf
...
It looks like shutdown of the window has proceeded enough that the ContentDialog is disconnected from the tree, which the top frames of this stack don't support.
Describe the bug
My app is an unpackaged self contained c# desktop app that can support multiple windows. Each window can display an about box, implemented as a pop up content dialog. When the user closes a window the about box is hidden to allow another content dialog to be shown prompting the user to save first. If the window contents aren't dirty then the window is just closed. I've found that if there are two windows open, both displaying about boxes and the user closes a window that doesn't need it's contents to be saved then the app traps.
It's a little contrived but not difficult to reproduce.
I have uploaded a dump file to OneDrive
Stack trace...
Steps to reproduce the bug
That usually causes it to trap, at least on my machine. Attaching WinDbg-Preview to the running process usually makes it more difficult to repro but still fairly easy.
CrashOnClose.zip
Expected behavior
No response
Screenshots
No response
NuGet package version
Windows App SDK 1.3 Preview 1: 1.3.230228005-preview1
Packaging type
Unpackaged
Windows version
Windows 11 version 22H2 (22621, 2022 Update)
IDE
Visual Studio 2022
Additional context
I can also reproduce this with WinAppSdk 1.2.4 and 1.2.5