Skip to content

Fix occasional crash on send manager startup#4856

Open
kunkku wants to merge 1 commit intopjsip:masterfrom
kunkku:fix-send-mgr-start
Open

Fix occasional crash on send manager startup#4856
kunkku wants to merge 1 commit intopjsip:masterfrom
kunkku:fix-send-mgr-start

Conversation

@kunkku
Copy link
Contributor

@kunkku kunkku commented Mar 13, 2026

This PR ensures the video stream send manager's group lock has a positive reference count before the thread starts. Otherwise, an assertion may fail in pj_grp_lock_acquire, which is about the first thing called by the new thread.

This commit ensures the manager's group lock has a positive reference
count before the thread starts. Otherwise, an assertion may fail in
pj_grp_lock_acquire.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an occasional startup crash in the video stream send manager by ensuring the send manager’s group lock has a positive reference count before its worker thread can attempt pj_grp_lock_acquire().

Changes:

  • Move pj_grp_lock_add_ref() to occur before creating the send manager thread.
  • Refactor the pool variable scope so thread creation can be gated on whether the manager was initialized in this call.
  • Return PJ_SUCCESS after successful attach (instead of returning the add-ref result at the end).

You can also share your feedback on Copilot code review. Take the survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants