AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
25.24k stars 2.19k forks source link

Exception: 'Infinite layout loop detected' when using SharedSizeGroup #16425

Open jpmikkers opened 1 month ago

jpmikkers commented 1 month ago

Describe the bug

In a ListBox where the ItemTemplate has a Grid containing a SharedSizeGroup (the ListBox itself has IsSharedSizeScope=true), after filling the list with random sized items, resizing the window or scrolling results in a 'Infinite layout loop detected' crash (fails about 50% of the time)

To Reproduce

layoutlooprepro.zip

repro also available here: https://github.com/jpmikkers/AvaHash/tree/crashrepro

Expected behavior

No crash. Note that Avalonia 11.0.x did not show this issue.

Avalonia version

11.1.0, 11.1.1, 11.1.2, 11.1.3, 11.2.999-cibuild0051600-alpha

OS

Windows, Linux (raspbian on rpi4)

Additional context

https://github.com/user-attachments/assets/a9b840d4-db01-4909-9a58-1474538765a3

Dmitrii-a11 commented 1 week ago

Avalonia 11.0.11 also throws the exception.

timunie commented 1 week ago

Could anyone check with nightly builds as well?

jpmikkers commented 1 week ago

@timunie just tried, same crash happens with '11.2.999-cibuild0051600-alpha'