Skip to content

Fix videoroom crash on janus_videoroom_hangup_media_internal#3628

Open
spscream wants to merge 1 commit intomeetecho:masterfrom
spscream:fix-vr-crash
Open

Fix videoroom crash on janus_videoroom_hangup_media_internal#3628
spscream wants to merge 1 commit intomeetecho:masterfrom
spscream:fix-vr-crash

Conversation

@spscream
Copy link
Copy Markdown
Contributor

@spscream spscream commented Mar 3, 2026

possible fix of #3627

@lminiero
Copy link
Copy Markdown
Member

lminiero commented Mar 4, 2026

From a quick glance, the use of a mutex in janus_videoroom_subscriber_free is a big no. That's the callback that's invoked when the reference count gets to zero, and it's unpredictable when it will be called, especially in terms of which mutex is locked when it happens. There's a high risk of encountering random inverse order of mutex locking because of this.

@spscream
Copy link
Copy Markdown
Contributor Author

spscream commented Mar 5, 2026

ok, I see.
Another idea is to make increment of subscriber->ref on adding to publisher streams? So subscriber won't be freed early and crash won't occure.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants