-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
ThreadSanitizer: data race in ViewLayer.forceRender.setter #3827
Comments
This commit will: - Change VideoLaye.draw to queue a task to the mpvGLQueue queue - Change MPVController.mpvUpdateCallback to call draw directly - Change MainWindowController.enterInteractiveMode to call draw directly - Change mpvGLQueue to be a private constant These changes cause all drawing to occur from tasks submitted to mpvGLQueue . Restricting all drawing to a single serial dispatch queue eliminates the data race with these two properties.
AnalysisThis issue is focused on access to these two private var needsMPVRender = false
private var forceRender = false These properties are used by the
The method Calling the FixingThe proposed fix in the PR restricts all drawing to a single serial dispatch queue, |
This commit will: - Change VideoLaye.draw to queue a task to the mpvGLQueue queue - Change MPVController.mpvUpdateCallback to call draw directly - Change MainWindowController.enterInteractiveMode to call draw directly - Change mpvGLQueue to be a private constant These changes cause all drawing to occur from tasks submitted to mpvGLQueue . Restricting all drawing to a single serial dispatch queue eliminates the data race with these two properties.
This commit will: - Change VideoLaye.draw to queue a task to the mpvGLQueue queue - Change MPVController.mpvUpdateCallback to call draw directly - Change MainWindowController.enterInteractiveMode to call draw directly - Change mpvGLQueue to be a private constant These changes cause all drawing to occur from tasks submitted to mpvGLQueue . Restricting all drawing to a single serial dispatch queue eliminates the data race with these two properties.
This commit will: - Effectively revert the changes made in commit f8811b6 that attempted to always draw using the mpvGLQueue queue - Add an Atomic property wrapper to protect a property with a lock - Add locking to the VideoLayer properties blocked, forceRender and needsMPVRender The commit f8811b6 attempted to standardize drawing to always use the mpvGLQueue queue to resolve TSan detected data races reported in issue #3827 without using locks. However as discussed in issue #4055 drawing can still occur on the main thread. This commit resolves the TSan data races using locks.
This commit will: - Effectively revert the changes made in commit f8811b6 that attempted to always draw using the mpvGLQueue queue - Add an Atomic property wrapper to protect a property with a lock - Add locking to the VideoLayer properties blocked, forceRender and needsMPVRender The commit f8811b6 attempted to standardize drawing to always use the mpvGLQueue queue to resolve TSan detected data races reported in issue iina#3827 without using locks. However as discussed in issue iina#4055 drawing can still occur on the main thread. This commit resolves the TSan data races using locks.
This commit will: - Effectively revert the changes made in commit f8811b6 that attempted to always draw using the mpvGLQueue queue - Add an Atomic property wrapper to protect a property with a lock - Add locking to the VideoLayer properties blocked, forceRender and needsMPVRender The commit f8811b6 attempted to standardize drawing to always use the mpvGLQueue queue to resolve TSan detected data races reported in issue iina#3827 without using locks. However as discussed in issue iina#4055 drawing can still occur on the main thread. This commit resolves the TSan data races using locks.
This commit will: - Effectively revert the changes made in commit f8811b6 that attempted to always draw using the mpvGLQueue queue - Add an Atomic property wrapper to protect a property with a lock - Add locking to the VideoLayer properties blocked, forceRender and needsMPVRender The commit f8811b6 attempted to standardize drawing to always use the mpvGLQueue queue to resolve TSan detected data races reported in issue #3827 without using locks. However as discussed in issue #4055 drawing can still occur on the main thread. This commit resolves the TSan data races using locks.
System and IINA version:
Expected behavior:
IINA runs without error under Xcode with the thread sanitizer enabled.
Actual behavior:
Running under Xcode 13.4 on a M1 MacBookPro18,2 the thread sanitizer reports a data race:
Multiple threads are accessing this
ViewLayer
property:Xcode console:
Steps to reproduce:
This is failing in IINA code.
How often does this happen?
Rarely.
The text was updated successfully, but these errors were encountered: