Changeset 284644 in webkit
- Timestamp:
- Oct 21, 2021, 2:33:01 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/mac/DisplayLink.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r284641 r284644 1 2021-10-21 Simon Fraser <simon.fraser@apple.com> 2 3 Rare crash under DisplayLink::displayLinkCallback() 4 https://bugs.webkit.org/show_bug.cgi?id=232101 5 <rdar://84153991> 6 7 Reviewed by Tim Horton. 8 9 The crash was a divide by zero under m_currentUpdate.nextUpdate(), indicating that 10 m_currentUpdate.updatesPerSecond was zero. Previous assumptions that this was caused 11 by weird display configs were wrong. The actual issue is a race condition where 12 the callback can fire while we're still inside CVDisplayLinkStart(), or at least 13 before we've updated m_currentUpdate. 14 15 The fix is to initialize m_currentUpdate before we call CVDisplayLinkStart(). 16 17 * UIProcess/mac/DisplayLink.cpp: 18 (WebKit::DisplayLink::addObserver): 19 1 20 2021-10-21 Per Arne Vollan <pvollan@apple.com> 2 21 -
trunk/Source/WebKit/UIProcess/mac/DisplayLink.cpp
r283209 r284644 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.