microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.26k stars 673 forks source link

Crash when touching CompactSizing after ScratchPad #9811

Open huoyaoyuan opened 1 month ago

huoyaoyuan commented 1 month ago

Which version of the app?

WinUI 3 Gallery

Description

  1. Navigate to System->Scratch Pad example
  2. Click "load" and "reset" for several times
  3. Navigate to Styles->Compact Sizing
  4. Switch to "Compact" in the page, the gallery app crashes

Screenshots

No response

Windows version

Windows 11 23H2 (22631)

Additional context

WinUI 3 Gallery version 2.4.3.0

codendone commented 1 month ago

This is the top of the error stack:

Callstack for hr=80004005 - Unspecified error

    Microsoft_ui_xaml!DirectUI::DXamlCore::GetPeerPrivate+0x262e8c  (7ffaf827c30c) [C:\__w\1\s\dxaml\xcp\dxaml\lib\DXamlCore.cpp @ 1738]
    Microsoft_ui_xaml!DirectUI::VisualTreeHelper::GetVisualRelative+0xec  (7ffaf872c17c) [C:\__w\1\s\dxaml\xcp\dxaml\lib\VisualTreeHelper.cpp @ 596]
    Microsoft_ui_xaml!DirectUI::VisualTreeHelper::GetRootStatic+0x1c  (7ffaf872bf58) [C:\__w\1\s\dxaml\xcp\dxaml\lib\VisualTreeHelper.cpp @ 513]
    Microsoft_ui_xaml!DirectUI::RadioButton::GetParentForGroup+0x60  (7ffaf87fb2d0) [C:\__w\1\s\dxaml\xcp\dxaml\lib\RadioButton_Partial.cpp @ 475]
    Microsoft_ui_xaml!DirectUI::RadioButton::UpdateRadioButtonGroup+0x24f  (7ffaf87fc7e3) [C:\__w\1\s\dxaml\xcp\dxaml\lib\RadioButton_Partial.cpp @ 419]
    Microsoft_ui_xaml!DirectUI::RadioButton::OnChecked+0x12  (7ffaf87fb3b2) [C:\__w\1\s\dxaml\xcp\dxaml\lib\RadioButton_Partial.cpp @ 171]
    Microsoft_ui_xaml!DirectUI::ToggleButton::OnIsCheckedChanged+0xa0  (7ffaf879c990) [C:\__w\1\s\dxaml\xcp\dxaml\lib\ToggleButton_Partial.cpp @ 324]
    Microsoft_ui_xaml!DirectUI::ToggleButton::OnPropertyChanged2+0x15e848  (7ffaf83226b8) [C:\__w\1\s\dxaml\xcp\dxaml\lib\ToggleButton_Partial.cpp @ 44]
    Microsoft_ui_xaml!DirectUI::RadioButton::OnPropertyChanged2+0x39  (7ffaf87fb899) [C:\__w\1\s\dxaml\xcp\dxaml\lib\RadioButton_Partial.cpp @ 67]

I can repro the same issue by just going directly to the Compact Sizing page, switching to Compact mode, switching to the IconElement page, and then repeating back through these steps until the switch to Compact mode fails.