Skip to content

Deadlock in ReliableSequencedChannel.HandleAck(ArraySegment<byte> payload) #40

@THplusplus

Description

@THplusplus

Describe the bug
Endless loop due to wrong data type in counter variable i.

To Reproduce
I don't have enough understanding of the inner workings to tell how exactly to reproduce this. However it's obvious that the for loop in ReliableSequencedChannel.HandleAck(ArraySegment<byte> payload) can never complete when bits is greater than 255. Not sure IF bits should ever be greater than 255, but it is in my case. The debugger shows a value of 4128 in my case.
Same issue may probably occur in ReliableChannel as well.

Expected behavior
It shouldn't lock up. Either the counter i should be of type int or it should be guaranteed that bits can never exceed 255.

Environment (please complete the following information):

  • OS: Debian 11
  • Unity Version: N/A (this is a pure .NET 7 application)
  • Ruffles Version: 11.1.9
  • Ruffles Commit: aab94e4

Additional context
The deadlock occurs after a few minutes during loadtests of my game server. It is possible that the game server is sending or receiving too much data which may increase the chance of this issue ocurring.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions