Changeset 284811 in webkit
- Timestamp:
- Oct 25, 2021, 12:10:10 PM (5 years ago)
- Location:
- branches/safari-612-branch/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/mac/DisplayLink.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-612-branch/Source/WebKit/ChangeLog
r284482 r284811 1 2021-10-25 Null <null@apple.com> 2 3 Cherry-pick r284644. rdar://problem/84153991 4 5 Rare crash under DisplayLink::displayLinkCallback() 6 https://bugs.webkit.org/show_bug.cgi?id=232101 7 <rdar://84153991> 8 9 Reviewed by Tim Horton. 10 11 The crash was a divide by zero under m_currentUpdate.nextUpdate(), indicating that 12 m_currentUpdate.updatesPerSecond was zero. Previous assumptions that this was caused 13 by weird display configs were wrong. The actual issue is a race condition where 14 the callback can fire while we're still inside CVDisplayLinkStart(), or at least 15 before we've updated m_currentUpdate. 16 17 The fix is to initialize m_currentUpdate before we call CVDisplayLinkStart(). 18 19 * UIProcess/mac/DisplayLink.cpp: 20 (WebKit::DisplayLink::addObserver): 21 22 23 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284644 268f45cc-cd09-0410-ab3c-d52691b4dbfc 24 25 2021-10-21 Simon Fraser <simon.fraser@apple.com> 26 27 Rare crash under DisplayLink::displayLinkCallback() 28 https://bugs.webkit.org/show_bug.cgi?id=232101 29 <rdar://84153991> 30 31 Reviewed by Tim Horton. 32 33 The crash was a divide by zero under m_currentUpdate.nextUpdate(), indicating that 34 m_currentUpdate.updatesPerSecond was zero. Previous assumptions that this was caused 35 by weird display configs were wrong. The actual issue is a race condition where 36 the callback can fire while we're still inside CVDisplayLinkStart(), or at least 37 before we've updated m_currentUpdate. 38 39 The fix is to initialize m_currentUpdate before we call CVDisplayLinkStart(). 40 41 * UIProcess/mac/DisplayLink.cpp: 42 (WebKit::DisplayLink::addObserver): 43 1 44 2021-10-19 Russell Epstein <repstein@apple.com> 2 45 -
branches/safari-612-branch/Source/WebKit/UIProcess/mac/DisplayLink.cpp
r283691 r284811 102 102 if (!CVDisplayLinkIsRunning(m_displayLink)) { 103 103 LOG_WITH_STREAM(DisplayLink, stream << "[UI ] DisplayLink for display " << m_displayID << " starting CVDisplayLink with fps " << m_displayNominalFramesPerSecond); 104 105 m_currentUpdate = { 0, m_displayNominalFramesPerSecond }; 106 104 107 CVReturn error = CVDisplayLinkStart(m_displayLink); 105 108 if (error) 106 109 RELEASE_LOG_FAULT(DisplayLink, "DisplayLink: Could not start the display link: %d", error); 107 108 if (!m_displayNominalFramesPerSecond) {109 RELEASE_LOG_FAULT(DisplayLink, "DisplayLink: displayNominalFramesPerSecond is 0, using %d", WebCore::FullSpeedFramesPerSecond);110 m_displayNominalFramesPerSecond = WebCore::FullSpeedFramesPerSecond;111 };112 113 m_currentUpdate = { 0, m_displayNominalFramesPerSecond };114 110 } 115 111 }
Note:
See TracChangeset
for help on using the changeset viewer.