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.95k stars 2.25k forks source link

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

Open jpmikkers opened 3 months ago

jpmikkers commented 3 months 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, 11.1.4

OS

Windows, Linux (raspbian on rpi4)

Additional context

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

Dmitrii-a11 commented 2 months ago

Avalonia 11.0.11 also throws the exception.

timunie commented 2 months ago

Could anyone check with nightly builds as well?

jpmikkers commented 2 months ago

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