question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crash using FlowLayout: Layout cycle detected

See original GitHub issue

Describe the bug

When scrolling an ItemsRepeater with FlowLayout, at some point it can randomly crash with an unhandled exception “Layout cycle detected. Layout could not complete.”

Steps to reproduce the bug

Steps to reproduce the behavior:

  1. Open ItemsRepeaters page MUXControlsTestApp
  2. Open “Flowlayout demo page”
  3. Scroll up and down

Expected behavior

The app crashes with the following unhandled exception: image

Stacktrace:

>	MUXControlsTestApp.exe!MUXControlsTestApp.App.InitializeComponent.AnonymousMethod__32_0(sender = {MUXControlsTestApp.App}, e = {Windows.UI.Xaml.UnhandledExceptionEventArgs}) Line 53	C#
 	[Native to Managed Transition]	
 	Windows.UI.Xaml.dll!00007ff985823688()	Unknown
 	Windows.UI.Xaml.dll!00007ff985823885()	Unknown
 	Windows.UI.Xaml.dll!00007ff985867a91()	Unknown
 	Windows.UI.Xaml.dll!00007ff985867938()	Unknown
 	Windows.UI.Xaml.dll!00007ff9858675a3()	Unknown
 	Windows.UI.Xaml.dll!00007ff985867449()	Unknown
 	twinapi.appcore.dll!00007ff99f2127fa()	Unknown
 	twinapi.appcore.dll!00007ff99f21284a()	Unknown
 	twinapi.appcore.dll!00007ff99f2032f3()	Unknown
 	twinapi.appcore.dll!00007ff99f1a30d0()	Unknown
 	twinapi.appcore.dll!00007ff99f1a303d()	Unknown
 	twinapi.appcore.dll!00007ff99f1a2faf()	Unknown
 	twinapi.appcore.dll!00007ff99f1a44fd()	Unknown
 	combase.dll!00007ff9aa382f8c()	Unknown
 	Windows.UI.Xaml.dll!00007ff985867b8a()	Unknown
 	Windows.UI.Xaml.dll!00007ff9855aaa09()	Unknown
 	Windows.UI.Xaml.dll!00007ff98538497a()	Unknown
 	Windows.UI.Xaml.dll!00007ff985201682()	Unknown
 	Windows.UI.Xaml.dll!00007ff985201526()	Unknown
 	Windows.UI.Xaml.dll!00007ff9851fe99b()	Unknown
 	Windows.UI.Xaml.dll!00007ff9851fe88c()	Unknown
 	CoreMessaging.dll!00007ff9a42d8ff2()	Unknown
 	CoreMessaging.dll!00007ff9a42d9241()	Unknown
 	CoreMessaging.dll!00007ff9a42c40ce()	Unknown
 	CoreMessaging.dll!00007ff9a42bf44b()	Unknown
 	CoreMessaging.dll!00007ff9a42be58f()	Unknown
 	CoreMessaging.dll!00007ff9a42be1d3()	Unknown
 	CoreMessaging.dll!00007ff9a4314836()	Unknown
 	CoreMessaging.dll!00007ff9a4313e53()	Unknown
 	CoreMessaging.dll!00007ff9a4314a46()	Unknown
 	user32.dll!00007ff9aaa5ee9e()	Unknown
 	user32.dll!00007ff9aaa5e81c()	Unknown
 	user32.dll!00007ff9aaa73843()	Unknown
 	ntdll.dll!00007ff9ab437b54()	Unknown
 	win32u.dll!00007ff9a8d81064()	Unknown
 	user32.dll!00007ff9aaa59ec3()	Unknown
 	user32.dll!00007ff9aaa59e3a()	Unknown
 	Windows.UI.dll!00007ff99438294e()	Unknown
 	Windows.UI.dll!00007ff994382720()	Unknown
 	Windows.UI.dll!00007ff9943825a3()	Unknown
 	Windows.UI.Xaml.dll!00007ff9853442a0()	Unknown
 	Windows.UI.Xaml.dll!00007ff98534423f()	Unknown
 	twinapi.appcore.dll!00007ff99f1984ba()	Unknown
 	twinapi.appcore.dll!00007ff99f16f81d()	Unknown
 	SHCore.dll!00007ff9aafffdb9()	Unknown
 	kernel32.dll!00007ff9aacc9784()	Unknown
 	ntdll.dll!00007ff9ab3996a1()	Unknown

Screenshots

Version Info

latest commit master branch

NuGet package version:

Windows 10 version Saw the problem?
Insider Build (xxxxx) Yes
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Mobile
Xbox
Surface Hub
IoT

Additional context

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
ad1Dimacommented, Aug 8, 2020

Ok i make 100% layoucycle test page and it’s this simple:

<Page
    x:Class="Repeater_TestUI.Samples.LayoutCycleTestPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Repeater_TestUI.Samples"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="using:Microsoft.UI.Xaml.Controls"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <ScrollViewer>
        <controls:ItemsRepeater x:Name="PartItemsRepeaterName"
                            Grid.Row="1"
                            MaxWidth="1280"
                            Margin="0"
                            ItemsSource="{x:Bind Source}">
            <controls:ItemsRepeater.Layout>
                <controls:UniformGridLayout MinItemWidth="200"
                                        MinItemHeight="300"
                                        MaximumRowsOrColumns="5"
                                        ItemsStretch="Fill"
                                        />
            </controls:ItemsRepeater.Layout>
        </controls:ItemsRepeater>
    </ScrollViewer>
</Page>
public IList Source => new List<string>() { "test" };

Just navigate on it. Even Exception doesn’t appear. Only infinity measures

This is really strange. It even doesn’t hit ArrangeOverride of ItemsRepeater.

0reactions
github-actions[bot]commented, Jul 29, 2023

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Layout cycle detected. Layout could not complete, For ...
I have 8 Grid rows populated via foreach loops in Flyout . When the content was too great, it started to crash with...
Read more >
What is 'Layout Cycle detected' & how to get rid of this?
I am losing my valuable users day by day. System.Exception: Layout cycle detected. Layout could not complete. Layout cycle detected.
Read more >
Layout cycle detected. Layout could not complete
Hello telerik, in my current Silverlight 5 project I am using the SchduleView and unfortunately the program crashes EVERYTIME, when the user ...
Read more >
Getting Started with UICollectionViewCompositionalLayout
We'll start by reviewing how to build a grid with a flow layout, and then show you how to achieve the same design...
Read more >
OpenLAB CDS Report Template Editor
With the Compound Summary RT Amount snippet, you generate an overview of the retention times and amounts for each detected compound. The compounds...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found