Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Deadlock in bstats(..) and sendCtrlAck() #2167

Closed
maxsharabayko opened this issue Oct 15, 2021 · 0 comments · Fixed by #2168
Closed

[BUG] Deadlock in bstats(..) and sendCtrlAck() #2167

maxsharabayko opened this issue Oct 15, 2021 · 0 comments · Fixed by #2168
Assignees
Labels
[core] Area: Changes in SRT library core Priority: Critical Type: Bug Indicates an unexpected problem or unintended behavior
Milestone

Comments

@maxsharabayko
Copy link
Collaborator

CUDT::sendCtrlAck() locks m_RcvBufferLock, and later m_StatsLock.

After PR #2146 CUDT::bstats(..) locks m_StatsLock and later m_RcvBufferLock in getAvailRcvBufferSizeLock().

Possible solutions:

  1. Use getAvailRcvBufferSizeNoLock() instead (not a good one).
  2. Consider reducing the scope of locking in CUDT::sendCtrlAck(). Only access to the receiver buffer must be protected with this mutex. The receiving state of the socket (e.g. m_iRcvLastAck, m_tsLastAckTime, m_ACKWindow, etc.) must be protected with a different mutex (which one?).

SRT version affected: SRT v1.4.5 dev.

@maxsharabayko maxsharabayko added Type: Bug Indicates an unexpected problem or unintended behavior [core] Area: Changes in SRT library core labels Oct 15, 2021
@maxsharabayko maxsharabayko added this to the v1.4.5 milestone Oct 15, 2021
@maxsharabayko maxsharabayko self-assigned this Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Priority: Critical Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant