Skip to content

Error while drawing square #172

@austin-owensby

Description

@austin-owensby

Version: 1.11
IDE: Visual Studio 2022 v17.6.5
Platform: Windows 10

I forked the repo on v1.11 and tried to simulate MyBot vs. EvilBot without changing anything just to see what the baseline statistics would come out as, and while running I got this exception in BoardUI.cs's DrawSquare function on line 305:

System.InvalidOperationException
  HResult=0x80131509
  Message=Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct.
  Source=System.Private.CoreLib
  StackTrace:
   at System.ThrowHelper.ThrowInvalidOperationException_ConcurrentOperationsNotSupported()
   at System.Collections.Generic.Dictionary`2.FindValue(TKey key)
   at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
   at ChessChallenge.Application.BoardUI.DrawSquare(Int32 file, Int32 rank) in C:\Users\aowen\Source\Repos\austin-owensby\Chess-Challenge\Chess-Challenge\src\Framework\Application\UI\BoardUI.cs:line 305
   at ChessChallenge.Application.BoardUI.Draw() in C:\Users\aowen\Source\Repos\austin-owensby\Chess-Challenge\Chess-Challenge\src\Framework\Application\UI\BoardUI.cs:line 203
   at ChessChallenge.Application.ChallengeController.Draw() in C:\Users\aowen\Source\Repos\austin-owensby\Chess-Challenge\Chess-Challenge\src\Framework\Application\Core\ChallengeController.cs:line 380
   at ChessChallenge.Application.Program.Main() in C:\Users\aowen\Source\Repos\austin-owensby\Chess-Challenge\Chess-Challenge\src\Framework\Application\Core\Program.cs:line 41

ChessBug

Trying to include as much debug info as possible since it looks like there may not be a reliable way to reproduce this since from some quick research it may be based on different threads modifying the same collection at once.
Locals1
Locals2
Locals3
Locals4

Threads

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions