-
Notifications
You must be signed in to change notification settings - Fork 54
Guard video client stop with a mutex #684
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
base: development
Are you sure you want to change the base?
Conversation
|
||
eglCore?.release() | ||
eglCore = null | ||
eglCore?.release() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we included this in the mutex scope?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we only put videoClientStateController.stop() under mutex, multiple eglCore?.release() may be triggered at the same time, this is another race condition that will trigger a crash for eglCore reference counter below 0. Added a comment.
videoClientObserver.primaryMeetingPromotionObserver = null | ||
|
||
videoClientStateController.stop() | ||
videoClientStopMutex.withLock { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were we able to reproduce? Was there a stack? Can we add a comment here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was reproducible with new webrtc version. Added a comment here to explain the crash
ℹ️ Description
There are race conditions in video client stop function that may lead to a crashes if multiple threads of video client stop are triggered at the same time (e.g., pointer deallocation, reference counter update). The purpose of this change is to avoid such crashes.
Issue #, if available
Type of change
🧪 How Has This Been Tested?
describe the tests that you ran to verify your changes, any relevant details for your test configuration
Smoke tested and verified crash doesn't happen when ending a meeting
Unit test coverage
Additional Manual Test
📱 Screenshots, if available
provide screenshots/video record if there's a UI change in demo app
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.