Title: [284811] branches/safari-612-branch/Source/WebKit
- Revision
- 284811
- Author
- [email protected]
- Date
- 2021-10-25 12:10:10 -0700 (Mon, 25 Oct 2021)
Log Message
Cherry-pick r284644. rdar://problem/84153991
Rare crash under DisplayLink::displayLinkCallback()
https://bugs.webkit.org/show_bug.cgi?id=232101
<rdar://84153991>
Reviewed by Tim Horton.
The crash was a divide by zero under m_currentUpdate.nextUpdate(), indicating that
m_currentUpdate.updatesPerSecond was zero. Previous assumptions that this was caused
by weird display configs were wrong. The actual issue is a race condition where
the callback can fire while we're still inside CVDisplayLinkStart(), or at least
before we've updated m_currentUpdate.
The fix is to initialize m_currentUpdate before we call CVDisplayLinkStart().
* UIProcess/mac/DisplayLink.cpp:
(WebKit::DisplayLink::addObserver):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284644 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-612-branch/Source/WebKit/ChangeLog (284810 => 284811)
--- branches/safari-612-branch/Source/WebKit/ChangeLog 2021-10-25 19:10:06 UTC (rev 284810)
+++ branches/safari-612-branch/Source/WebKit/ChangeLog 2021-10-25 19:10:10 UTC (rev 284811)
@@ -1,3 +1,46 @@
+2021-10-25 Null <[email protected]>
+
+ Cherry-pick r284644. rdar://problem/84153991
+
+ Rare crash under DisplayLink::displayLinkCallback()
+ https://bugs.webkit.org/show_bug.cgi?id=232101
+ <rdar://84153991>
+
+ Reviewed by Tim Horton.
+
+ The crash was a divide by zero under m_currentUpdate.nextUpdate(), indicating that
+ m_currentUpdate.updatesPerSecond was zero. Previous assumptions that this was caused
+ by weird display configs were wrong. The actual issue is a race condition where
+ the callback can fire while we're still inside CVDisplayLinkStart(), or at least
+ before we've updated m_currentUpdate.
+
+ The fix is to initialize m_currentUpdate before we call CVDisplayLinkStart().
+
+ * UIProcess/mac/DisplayLink.cpp:
+ (WebKit::DisplayLink::addObserver):
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284644 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2021-10-21 Simon Fraser <[email protected]>
+
+ Rare crash under DisplayLink::displayLinkCallback()
+ https://bugs.webkit.org/show_bug.cgi?id=232101
+ <rdar://84153991>
+
+ Reviewed by Tim Horton.
+
+ The crash was a divide by zero under m_currentUpdate.nextUpdate(), indicating that
+ m_currentUpdate.updatesPerSecond was zero. Previous assumptions that this was caused
+ by weird display configs were wrong. The actual issue is a race condition where
+ the callback can fire while we're still inside CVDisplayLinkStart(), or at least
+ before we've updated m_currentUpdate.
+
+ The fix is to initialize m_currentUpdate before we call CVDisplayLinkStart().
+
+ * UIProcess/mac/DisplayLink.cpp:
+ (WebKit::DisplayLink::addObserver):
+
2021-10-19 Russell Epstein <[email protected]>
Revert r283931. rdar://problem/83953710
Modified: branches/safari-612-branch/Source/WebKit/UIProcess/mac/DisplayLink.cpp (284810 => 284811)
--- branches/safari-612-branch/Source/WebKit/UIProcess/mac/DisplayLink.cpp 2021-10-25 19:10:06 UTC (rev 284810)
+++ branches/safari-612-branch/Source/WebKit/UIProcess/mac/DisplayLink.cpp 2021-10-25 19:10:10 UTC (rev 284811)
@@ -101,16 +101,12 @@
if (!CVDisplayLinkIsRunning(m_displayLink)) {
LOG_WITH_STREAM(DisplayLink, stream << "[UI ] DisplayLink for display " << m_displayID << " starting CVDisplayLink with fps " << m_displayNominalFramesPerSecond);
+
+ m_currentUpdate = { 0, m_displayNominalFramesPerSecond };
+
CVReturn error = CVDisplayLinkStart(m_displayLink);
if (error)
RELEASE_LOG_FAULT(DisplayLink, "DisplayLink: Could not start the display link: %d", error);
-
- if (!m_displayNominalFramesPerSecond) {
- RELEASE_LOG_FAULT(DisplayLink, "DisplayLink: displayNominalFramesPerSecond is 0, using %d", WebCore::FullSpeedFramesPerSecond);
- m_displayNominalFramesPerSecond = WebCore::FullSpeedFramesPerSecond;
- };
-
- m_currentUpdate = { 0, m_displayNominalFramesPerSecond };
}
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes