[webkit-changes] [WebKit/WebKit] fe792f: Crash under ProcessThrottlerActivity::isValid()

Chris Dumez noreply at github.com
Mon Aug 7 11:03:36 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fe792fdab477f9b81bb3d07089dd39e548041e1f
      https://github.com/WebKit/WebKit/commit/fe792fdab477f9b81bb3d07089dd39e548041e1f
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-08-07 (Mon, 07 Aug 2023)

  Changed paths:
    M Source/WebKit/UIProcess/ProcessThrottler.cpp

  Log Message:
  -----------
  Crash under ProcessThrottlerActivity::isValid()
https://bugs.webkit.org/show_bug.cgi?id=259886
rdar://113459152

Reviewed by Brent Fulgham.

ProcessThrottlerTimedActivity::activityTimedOut() was getting called, it
would set `m_activity` to nullptr, which would destroy the
ProcessThrottlerActivity. Because this was the last activity, it would
cause the prepareToSuspend logic to get called, which could cause
`m_activity` to get queried while in the middle of the assignment, causing
a crash.

To address the issue, I now use std::variant::swap() in activityTimedOut()
so that m_activity is in a good state (nullptr) when the
ProcessThrottlerActivity gets destroyed.

* Source/WebKit/UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottlerTimedActivity::activityTimedOut):

Canonical link: https://commits.webkit.org/266642@main




More information about the webkit-changes mailing list