Better-Scenes / RimConnect-mod

A Twitch integration for the game RimWorld
GNU General Public License v3.0
15 stars 8 forks source link

Freeze when running Zetrith's MP and spawning cargo pod event x5 #24

Open TurkeyKittin opened 3 years ago

TurkeyKittin commented 3 years ago

In the process of trying to reproduce a desync issue, I stumbled upon an exception where a vote of Cargo Pods x5 event causes the following in the debug log:

Exception while executing action queue: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00029] in <567df3e0919241ba98db88bec4c6696f>:0 
  at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <567df3e0919241ba98db88bec4c6696f>:0 
  at Multiplayer.Client.ClientSyncOpinion.GetFormattedStackTracesForRange (System.Int32 diffAt) [0x0007d] in <70e2a53003de4f0a83e3fb3542856a17>:0 
  at Multiplayer.Client.SyncCoordinator.SaveStackTracesToDisk (Multiplayer.Client.ClientSyncOpinion local, Multiplayer.Client.ClientSyncOpinion remote) [0x0007a] in <70e2a53003de4f0a83e3fb3542856a17>:0 
  at Multiplayer.Client.SyncCoordinator.HandleDesync (Multiplayer.Client.ClientSyncOpinion oldOpinion, Multiplayer.Client.ClientSyncOpinion newOpinion, System.String desyncMessage) [0x00039] in <70e2a53003de4f0a83e3fb3542856a17>:0 
  at Multiplayer.Client.SyncCoordinator+<>c__DisplayClass8_0.<AddClientOpinionAndCheckDesync>b__0 () [0x00000] in <70e2a53003de4f0a83e3fb3542856a17>:0 
  at Multiplayer.Common.ActionQueue.RunQueue () [0x0007f] in <70e2a53003de4f0a83e3fb3542856a17>:0 
Verse.Log:Message(String, Boolean)
Multiplayer.Client.<>c:<.cctor>b__47_0(String)
Multiplayer.Common.MpLog:Log(String)
Multiplayer.Common.ActionQueue:RunQueue()
Multiplayer.Client.OnMainThread:Update()

The game promptly and permanently pauses (and remains stuck displaying the speed mode it was most recently in)

To reproduce: Have Zetrith's MP server running via steam & desync traces & arbiter enabled, start a poll on twitch with a cargo pod drop event x5 executed as the winner of the poll.

Mod load order: Harmony Core Multiplayer RimConnect

TurkeyKittin commented 3 years ago

Interestingly the error continues to happen each time I start MP without rebooting the whole game after encountering the first error.

Though while trying to reproduce it over and over, I have encountered the Desync bug I was currently trying to track while waiting for the x5 Cargo pod events to drop. I was planning to submit these as separate issues but I'm having a hard time reproducing them individually. I thought I found a pattern but it's still unreliable.

InfinitySamurai commented 3 years ago

Thanks for the report TurkeyKittin, really appreciate it. Could you join our discord so I can get some more info to debug this one? If it keeps triggering this makes me think that the server isn't removing the event from the backlog and is continuing to try to send it to the game which isn't ideal.