Avalonia icon indicating copy to clipboard operation
Avalonia copied to clipboard

CompositingRenderer.Update: Collection was modified

Open hez2010 opened this issue 1 year ago • 2 comments

Describe the bug

Unhandled exception. System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.Collections.Generic.HashSet`1.Enumerator.MoveNext()
   at Avalonia.Rendering.Composition.CompositingRenderer.Update() in E:\source\repos\Avalonia\src\Avalonia.Base\Rendering\Composition\CompositingRenderer.cs:line 195
   at Avalonia.Threading.JobRunner.RunJobs(Nullable`1 ) in E:\source\repos\Avalonia\src\Avalonia.Base\Threading\JobRunner.cs:line 38
   at Avalonia.Win32.Win32Platform.WndProc(IntPtr , UInt32 , IntPtr , IntPtr ) in E:\source\repos\Avalonia\src\Windows\Avalonia.Win32\Win32Platform.cs:line 296
   at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& )
   at Avalonia.Win32.Win32Platform.RunLoop(CancellationToken ) in E:\source\repos\Avalonia\src\Windows\Avalonia.Win32\Win32Platform.cs:line 223
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken ) in E:\source\repos\Avalonia\src\Avalonia.Base\Threading\Dispatcher.cs:line 61
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] ) in E:\source\repos\Avalonia\src\Avalonia.Controls\ApplicationLifetimes\ClassicDesktopStyleApplicationLifetime.cs:line 120
   at ControlCatalog.NetCore.Program.Main(String[] ) in E:\source\repos\Avalonia\samples\ControlCatalog.NetCore\Program.cs:line 103

To Reproduce Steps to reproduce the behavior:

  1. Enable UseWgl in CC.NetCore
  2. Build and run
  3. Navigate to OpenGL page
  4. Drag "Disco"

Expected behavior No exception should be thrown

Desktop (please complete the following information):

  • OS: Windows
  • Version: build from master

hez2010 avatar Jul 21 '22 17:07 hez2010

I can reliably reproduce this.

  • Clone and build https;//github.com/mike-ward/Loon.git (dotnet build)
  • Run program
  • Follow directions to get a PIN for twitter account
  • After timeline populates resize window horizontally

mike-ward avatar Aug 26 '22 14:08 mike-ward

Seems to be caused by InlineUIContainer that wants to do layout from a Render call for some reason image

kekekeks avatar Aug 29 '22 11:08 kekekeks

Crash this morning in 11, preview1 on Windows 10. Probably related to this. Here for documentation.

System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.Collections.Generic.HashSet`1.Enumerator.MoveNext()
   at Avalonia.Rendering.Composition.CompositingRenderer.Update() in /_/src/Avalonia.Base/Rendering/Composition/CompositingRenderer.cs:line 197
   at Avalonia.Threading.JobRunner.Job.Avalonia.Threading.JobRunner.IJob.Run() in /_/src/Avalonia.Base/Threading/JobRunner.cs:line 193
   at Avalonia.Threading.JobRunner.RunJobs(Nullable`1 priority) in /_/src/Avalonia.Base/Threading/JobRunner.cs:line 38
   at Avalonia.Win32.Win32Platform.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in /_/src/Windows/Avalonia.Win32/Win32Platform.cs:line 267
   at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)
   at Avalonia.Win32.Win32Platform.RunLoop(CancellationToken cancellationToken) in /_/src/Windows/Avalonia.Win32/Win32Platform.cs:line 214
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) in /_/src/Avalonia.Base/Threading/Dispatcher.cs:line 61
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 120
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 209
   at Loon.Desktop.Program.Main(String[] args) in C:\Users\mward\Documents\Github\Loon\src\Loon.Desktop\Program.cs:line 14

mike-ward avatar Oct 03 '22 13:10 mike-ward

Y this issue is fixed in master

Gillibald avatar Oct 03 '22 13:10 Gillibald

Is there any schedule for 11.0-preview2?

hez2010 avatar Oct 03 '22 14:10 hez2010

No specific date, but you can use nightly builds. As they are mostly compatible with preview1.

maxkatz6 avatar Oct 03 '22 19:10 maxkatz6