Bug 187382 - [Crash] Illegal use of uninitialized std::optional value in WebCore::AnimationBase::updateStateMachine
Summary: [Crash] Illegal use of uninitialized std::optional value in WebCore::Animatio...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Frédéric Wang (:fredw)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-07-06 02:10 PDT by Frédéric Wang (:fredw)
Modified: 2018-07-06 03:12 PDT (History)
9 users (show)

See Also:


Attachments
Patch (2.55 KB, patch)
2018-07-06 02:15 PDT, Frédéric Wang (:fredw)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric Wang (:fredw) 2018-07-06 02:10:00 PDT
See bug 186536 comment 41 for a repro case with Google drive and stack trace. With the patch from bug 186536, the crash happens here:

        case AnimationState::PausedWaitTimer:
            ASSERT(input == AnimationStateInput::PlayStateRunning);
            ASSERT(paused());
            // Update the times
            m_startTime = m_startTime.value(0) + beginAnimationUpdateTime() - m_pauseTime.value_or(0);
            m_pauseTime = std::nullopt;

Checking other potential misuses of uninitialized std::optional members in AnimationBase::updateStateMachine(), I only see one possible other place.

I'll just use value_or(0) for these two places to workaround these issues. Antoine Quint mentioned that the old animation code is going to be removed soon, so the actual way we fix these should not be a big deal...
Comment 1 Frédéric Wang (:fredw) 2018-07-06 02:15:29 PDT
Created attachment 344410 [details]
Patch
Comment 2 WebKit Commit Bot 2018-07-06 03:10:56 PDT
Comment on attachment 344410 [details]
Patch

Clearing flags on attachment: 344410

Committed r233574: <https://trac.webkit.org/changeset/233574>
Comment 3 WebKit Commit Bot 2018-07-06 03:10:58 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Radar WebKit Bug Importer 2018-07-06 03:12:23 PDT
<rdar://problem/41885732>