Changeset 225985 in webkit


Ignore:
Timestamp:
Dec 15, 2017 1:32:07 PM (6 years ago)
Author:
rniwa@webkit.org
Message:

Add a release assert that Timer::m_wasDeleted is false in setNextFireTime
https://bugs.webkit.org/show_bug.cgi?id=180860
<rdar://problem/36066500>

Reviewed by David Kilzer.

Turn an exist debug-only assertion into a release assertion to help diagnose a crash
which appears to be caused by a freed timer getting scheduled back into the timer heap.

  • platform/Timer.cpp:

(WebCore::TimerBase::~TimerBase):
(WebCore::TimerBase::setNextFireTime):

  • platform/Timer.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r225983 r225985  
     12017-12-15  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Add a release assert that Timer::m_wasDeleted is false in setNextFireTime
     4        https://bugs.webkit.org/show_bug.cgi?id=180860
     5        <rdar://problem/36066500>
     6
     7        Reviewed by David Kilzer.
     8
     9        Turn an exist debug-only assertion into a release assertion to help diagnose a crash
     10        which appears to be caused by a freed timer getting scheduled back into the timer heap.
     11
     12        * platform/Timer.cpp:
     13        (WebCore::TimerBase::~TimerBase):
     14        (WebCore::TimerBase::setNextFireTime):
     15        * platform/Timer.h:
     16
    1172017-12-15  Simon Fraser  <simon.fraser@apple.com>
    218
  • trunk/Source/WebCore/platform/Timer.cpp

    r225470 r225985  
    194194    stop();
    195195    ASSERT(!inHeap());
    196 #ifndef NDEBUG
    197196    m_wasDeleted = true;
    198 #endif
    199197}
    200198
     
    361359{
    362360    ASSERT(canAccessThreadLocalDataForThread(m_thread.get()));
    363     ASSERT(!m_wasDeleted);
     361    RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(!m_wasDeleted);
    364362
    365363    if (m_unalignedNextFireTime != newTime)
  • trunk/Source/WebCore/platform/Timer.h

    r225470 r225985  
    101101    int m_heapIndex { -1 }; // -1 if not in heap
    102102    unsigned m_heapInsertionOrder; // Used to keep order among equal-fire-time timers
     103    bool m_wasDeleted { false };
    103104    Vector<TimerBase*>* m_cachedThreadGlobalTimerHeap { nullptr };
    104105
    105106#ifndef NDEBUG
    106107    Ref<Thread> m_thread { Thread::current() };
    107     bool m_wasDeleted { false };
    108108#endif
    109109
Note: See TracChangeset for help on using the changeset viewer.