Title: [261102] trunk/Source/WebCore
Revision
261102
Author
[email protected]
Date
2020-05-04 12:49:11 -0700 (Mon, 04 May 2020)

Log Message

REGRESSION: [ Mac WK1 ] inspector/console/console-api.html is flaky crashing
https://bugs.webkit.org/show_bug.cgi?id=211386

Reviewed by David Kilzer.

Add some temporary logging code to get data from Mojave bots related to this
NSScrollerImp crash.

* platform/mac/ScrollAnimatorMac.mm:
(WebCore::dumpPaintersWithDelegates):
(WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
(WebCore::ScrollAnimatorMac::~ScrollAnimatorMac):
(WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
(WebCore::ScrollAnimatorMac::willRemoveVerticalScrollbar):
(WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
(WebCore::ScrollAnimatorMac::willRemoveHorizontalScrollbar):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (261101 => 261102)


--- trunk/Source/WebCore/ChangeLog	2020-05-04 19:46:27 UTC (rev 261101)
+++ trunk/Source/WebCore/ChangeLog	2020-05-04 19:49:11 UTC (rev 261102)
@@ -1,3 +1,22 @@
+2020-05-04  Simon Fraser  <[email protected]>
+
+        REGRESSION: [ Mac WK1 ] inspector/console/console-api.html is flaky crashing
+        https://bugs.webkit.org/show_bug.cgi?id=211386
+
+        Reviewed by David Kilzer.
+
+        Add some temporary logging code to get data from Mojave bots related to this
+        NSScrollerImp crash.
+
+        * platform/mac/ScrollAnimatorMac.mm:
+        (WebCore::dumpPaintersWithDelegates):
+        (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
+        (WebCore::ScrollAnimatorMac::~ScrollAnimatorMac):
+        (WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
+        (WebCore::ScrollAnimatorMac::willRemoveVerticalScrollbar):
+        (WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
+        (WebCore::ScrollAnimatorMac::willRemoveHorizontalScrollbar):
+
 2020-05-04  Doug Kelly  <[email protected]>
 
         Add additional null checks to MediaPlayerPrivateMediaSourceAVFObjC

Modified: trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm (261101 => 261102)


--- trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm	2020-05-04 19:46:27 UTC (rev 261101)
+++ trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm	2020-05-04 19:49:11 UTC (rev 261102)
@@ -730,6 +730,23 @@
     return makeUnique<ScrollAnimatorMac>(scrollableArea);
 }
 
+#define INVESTIGATE_211386 1
+
+#if INVESTIGATE_211386
+static HashSet<NSScrollerImp *> paintersWithDelegates()
+{
+    static NeverDestroyed<HashSet<NSScrollerImp *>> painterSet;
+    return painterSet;
+}
+
+static void dumpPaintersWithDelegates(const char* msg)
+{
+    WTFLogAlways("%s: %u NSScrollerImp with delegates", msg, paintersWithDelegates().size());
+    for (auto* painter : paintersWithDelegates())
+        WTFLogAlways(" painter %p", painter);
+}
+#endif
+
 ScrollAnimatorMac::ScrollAnimatorMac(ScrollableArea& scrollableArea)
     : ScrollAnimator(scrollableArea)
     , m_initialScrollbarPaintTimer(*this, &ScrollAnimatorMac::initialScrollbarPaintTimerFired)
@@ -744,6 +761,10 @@
     m_scrollerImpPair = adoptNS([[NSScrollerImpPair alloc] init]);
     [m_scrollerImpPair setDelegate:m_scrollerImpPairDelegate.get()];
     [m_scrollerImpPair setScrollerStyle:ScrollerStyle::recommendedScrollerStyle()];
+
+#if INVESTIGATE_211386
+    dumpPaintersWithDelegates("ScrollAnimatorMac ctor: ");
+#endif
 }
 
 ScrollAnimatorMac::~ScrollAnimatorMac()
@@ -755,6 +776,10 @@
     [m_verticalScrollerImpDelegate invalidate];
     [m_scrollAnimationHelperDelegate invalidate];
     END_BLOCK_OBJC_EXCEPTIONS;
+    
+#if INVESTIGATE_211386
+    dumpPaintersWithDelegates("ScrollAnimatorMac dtor: ");
+#endif
 }
 
 static bool scrollAnimationEnabledForSystem()
@@ -1110,6 +1135,10 @@
     m_verticalScrollerImpDelegate = adoptNS([[WebScrollerImpDelegate alloc] initWithScrollbar:scrollbar]);
 
     [painter setDelegate:m_verticalScrollerImpDelegate.get()];
+#if INVESTIGATE_211386
+    paintersWithDelegates().add(painter);
+#endif
+
     if (GraphicsLayer* layer = scrollbar->scrollableArea().layerForVerticalScrollbar())
         [painter setLayer:layer->platformLayer()];
 
@@ -1129,6 +1158,10 @@
     m_verticalScrollerImpDelegate = nullptr;
 
     [painter setDelegate:nil];
+#if INVESTIGATE_211386
+    paintersWithDelegates().remove(painter);
+#endif
+
     [m_scrollerImpPair setVerticalScrollerImp:nil];
 }
 
@@ -1142,6 +1175,10 @@
     m_horizontalScrollerImpDelegate = adoptNS([[WebScrollerImpDelegate alloc] initWithScrollbar:scrollbar]);
 
     [painter setDelegate:m_horizontalScrollerImpDelegate.get()];
+#if INVESTIGATE_211386
+    paintersWithDelegates().add(painter);
+#endif
+
     if (GraphicsLayer* layer = scrollbar->scrollableArea().layerForHorizontalScrollbar())
         [painter setLayer:layer->platformLayer()];
 
@@ -1161,6 +1198,10 @@
     m_horizontalScrollerImpDelegate = nullptr;
 
     [painter setDelegate:nil];
+#if INVESTIGATE_211386
+    paintersWithDelegates().remove(painter);
+#endif
+
     [m_scrollerImpPair setHorizontalScrollerImp:nil];
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to