Changeset 263852 in webkit
- Timestamp:
- Jul 2, 2020, 11:45:34 AM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/Network/NetworkProcessProxy.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r263843 r263852 1 2020-07-02 Chris Dumez <cdumez@apple.com> 2 3 Crash under WebKit::NetworkProcessProxy::updateProcessAssertion() 4 https://bugs.webkit.org/show_bug.cgi?id=213891 5 <rdar://problem/65017909> 6 7 Reviewed by Alex Christensen. 8 9 The crash was due to NetworkProcessProxy::updateProcessAssertion() re-entering while 10 in the middle of the `m_activityFromWebProcesses = nullptr;` assignment. Calling 11 the ProcessThrottler::BackgroundActivity destructor, could cause updateProcessAssertion() 12 to get called again, in which case we may dereference m_activityFromWebProcesses and 13 crash. To address the issue, use `std::exchange(m_activityFromWebProcesses, nullptr);` 14 instead, so that m_activityFromWebProcesses becomes null BEFORE the BackgroundActivity 15 destructor gets called. updateProcessAssertion() will still re-enter but 16 m_activityFromWebProcesses will be nullptr and updateProcessAssertion() will do the 17 right thing. 18 19 * UIProcess/Network/NetworkProcessProxy.cpp: 20 (WebKit::NetworkProcessProxy::updateProcessAssertion): 21 1 22 2020-07-02 Carlos Garcia Campos <cgarcia@igalia.com> 2 23 -
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
r263695 r263852 1526 1526 return; 1527 1527 } 1528 m_activityFromWebProcesses = nullptr; 1528 // Use std::exchange() instead of a simple nullptr assignment to avoid re-entering this 1529 // function during the destructor of the ProcessThrottler activity, before setting 1530 // m_activityFromWebProcesses. 1531 std::exchange(m_activityFromWebProcesses, nullptr); 1529 1532 } 1530 1533
Note:
See TracChangeset
for help on using the changeset viewer.