<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>194538</bug_id>
          
          <creation_ts>2019-02-12 06:43:36 -0800</creation_ts>
          <short_desc>Crash in WebCore::ScrollingTree::updateTreeFromStateNode</short_desc>
          <delta_ts>2019-05-08 07:22:10 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Scrolling</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Antti Koivisto">koivisto</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ajuma</cc>
    
    <cc>cmarcelo</cc>
    
    <cc>commit-queue</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>fred.wang</cc>
    
    <cc>ggaren</cc>
    
    <cc>jamesr</cc>
    
    <cc>justincohen</cc>
    
    <cc>justincohen</cc>
    
    <cc>luiz</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>tonikitoo</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1505211</commentid>
    <comment_count>0</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2019-02-12 06:43:36 -0800</bug_when>
    <thetext>3 libsystem_c.dylib: abort
          3 libc++abi.dylib: abort_message
            3 libc++abi.dylib: __cxa_pure_virtual
       ==&gt; 3 WebCore: WebCore::ScrollingTree::updateTreeFromStateNode(WebCore::ScrollingStateNode const*, WTF::HashMap&lt;unsigned long long, WTF::RefPtr&lt;WebCore::ScrollingTreeNode, WTF::DumbPtrTraits&lt;WebCore::ScrollingTreeNode&gt; &gt;, WTF::IntHash&lt;unsigned long long&gt;, WTF::HashTraits&lt;unsigned long long&gt;, WTF::HashTraits&lt;WTF::RefPtr&lt;WebCore::ScrollingTreeNode, WTF::DumbPtrTraits&lt;WebCore::ScrollingTreeNode&gt; &gt; &gt; &gt;&amp;) &lt;==
                3 WebCore: WebCore::ScrollingTree::updateTreeFromStateNode(WebCore::ScrollingStateNode const*, WTF::HashMap&lt;unsigned long long, WTF::RefPtr&lt;WebCore::ScrollingTreeNode, WTF::DumbPtrTraits&lt;WebCore::ScrollingTreeNode&gt; &gt;, WTF::IntHash&lt;unsigned long long&gt;, WTF::HashTraits&lt;unsigned long long&gt;, WTF::HashTraits&lt;WTF::RefPtr&lt;WebCore::ScrollingTreeNode, WTF::DumbPtrTraits&lt;WebCore::ScrollingTreeNode&gt; &gt; &gt; &gt;&amp;)
                  pruning: 2 WebCore: WebCore::ScrollingTree::commitTreeState(std::__1::unique_ptr&lt;WebCore::ScrollingStateTree, std::__1::default_delete&lt;WebCore::ScrollingStateTree&gt; &gt;)
                  pruning: 1 WebCore: WebCore::ScrollingTree::updateTreeFromStateNode(WebCore::ScrollingStateNode const*, WTF::HashMap&lt;unsigned long long, WTF::RefPtr&lt;WebCore::ScrollingTreeNode, WTF::DumbPtrTraits&lt;WebCore::ScrollingTreeNode&gt; &gt;, WTF::IntHash&lt;unsigned long long&gt;, WTF::HashTraits&lt;unsigned long long&gt;, WTF::HashTraits&lt;WTF::RefPtr&lt;WebCore::ScrollingTreeNode, WTF::DumbPtrTraits&lt;WebCore::ScrollingTreeNode&gt; &gt; &gt; &gt;&amp;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1505212</commentid>
    <comment_count>1</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2019-02-12 06:44:08 -0800</bug_when>
    <thetext>&lt;rdar://problem/47841926&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1505214</commentid>
    <comment_count>2</comment_count>
      <attachid>361794</attachid>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2019-02-12 06:55:42 -0800</bug_when>
    <thetext>Created attachment 361794
patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1505223</commentid>
    <comment_count>3</comment_count>
      <attachid>361794</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-02-12 08:22:24 -0800</bug_when>
    <thetext>Comment on attachment 361794
patch

Clearing flags on attachment: 361794

Committed r241296: &lt;https://trac.webkit.org/changeset/241296&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1505224</commentid>
    <comment_count>4</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-02-12 08:22:26 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1533908</commentid>
    <comment_count>5</comment_count>
    <who name="Justin Cohen">justincohen</who>
    <bug_when>2019-05-07 07:34:10 -0700</bug_when>
    <thetext>Chrome for iOS is seeing a big increase in this crash on 12.2.  And while volume is low, we also see it on 12.3


For example:
0x000000019ae7d0dc	(libsystem_kernel.dylib + 0x000230dc )	__pthread_kill
0x000000019aef6090	(libsystem_pthread.dylib + 0x00002090 )	pthread_kill$VARIANT$mp
0x000000019add6ea4	(libsystem_c.dylib + 0x0005aea4 )	abort
0x000000019a4a3784	(libc++abi.dylib + 0x00001784 )	abort_message
0x000000019a4b0a3c	(libc++abi.dylib + 0x0000ea3c )	__cxa_pure_virtual
0x00000001a4cd68d4	(WebCore + 0x011da8d4 )	WebCore::ScrollingTree::updateTreeFromStateNode(WebCore::ScrollingStateNode const*, WTF::HashMap&lt;unsigned long long, WTF::RefPtr&lt;WebCore::ScrollingTreeNode, WTF::DumbPtrTraits&lt;WebCore::ScrollingTreeNode&gt; &gt;, WTF::IntHash&lt;unsigned long long&gt;, WTF::HashTraits&lt;unsigned long long&gt;, WTF::HashTraits&lt;WTF::RefPtr&lt;WebCore::ScrollingTreeNode, WTF::DumbPtrTraits&lt;WebCore::ScrollingTreeNode&gt; &gt; &gt; &gt;&amp;)
0x00000001a4cd69bc	(WebCore + 0x011da9bc )	WebCore::ScrollingTree::updateTreeFromStateNode(WebCore::ScrollingStateNode const*, WTF::HashMap&lt;unsigned long long, WTF::RefPtr&lt;WebCore::ScrollingTreeNode, WTF::DumbPtrTraits&lt;WebCore::ScrollingTreeNode&gt; &gt;, WTF::IntHash&lt;unsigned long long&gt;, WTF::HashTraits&lt;unsigned long long&gt;, WTF::HashTraits&lt;WTF::RefPtr&lt;WebCore::ScrollingTreeNode, WTF::DumbPtrTraits&lt;WebCore::ScrollingTreeNode&gt; &gt; &gt; &gt;&amp;)
0x00000001a4cd636c	(WebCore + 0x011da36c )	WebCore::ScrollingTree::commitTreeState(std::__1::unique_ptr&lt;WebCore::ScrollingStateTree, std::__1::default_delete&lt;WebCore::ScrollingStateTree&gt; &gt;)
0x00000001aaa080cc	(WebKit + 0x002a50cc )	WebKit::RemoteScrollingCoordinatorProxy::commitScrollingTreeState(WebKit::RemoteScrollingCoordinatorTransaction const&amp;, WebKit::RemoteScrollingCoordinatorProxy::RequestedScrollInfo&amp;)
0x00000001aa9115d0	(WebKit + 0x001ae5d0 )	WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree(WebKit::RemoteLayerTreeTransaction const&amp;, WebKit::RemoteScrollingCoordinatorTransaction const&amp;)
0x00000001aa7b915c	(WebKit + 0x0005615c )	void IPC::handleMessage&lt;Messages::RemoteLayerTreeDrawingAreaProxy::CommitLayerTree, WebKit::RemoteLayerTreeDrawingAreaProxy, void (WebKit::RemoteLayerTreeDrawingAreaProxy::*)(WebKit::RemoteLayerTreeTransaction const&amp;, WebKit::RemoteScrollingCoordinatorTransaction const&amp;)&gt;(IPC::Decoder&amp;, WebKit::RemoteLayerTreeDrawingAreaProxy*, void (WebKit::RemoteLayerTreeDrawingAreaProxy::*)(WebKit::RemoteLayerTreeTransaction const&amp;, WebKit::RemoteScrollingCoordinatorTransaction const&amp;))
0x00000001aa79ceac	(WebKit + 0x00039eac )	IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&amp;, IPC::Decoder&amp;)
0x00000001aa95a31c	(WebKit + 0x001f731c )	WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;)
0x00000001aa78da1c	(WebKit + 0x0002aa1c )	IPC::Connection::dispatchMessage(std::__1::unique_ptr&lt;IPC::Decoder, std::__1::default_delete&lt;IPC::Decoder&gt; &gt;)
0x00000001aa79050c	(WebKit + 0x0002d50c )	IPC::Connection::dispatchIncomingMessages()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1534090</commentid>
    <comment_count>6</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2019-05-07 13:35:27 -0700</bug_when>
    <thetext>Any information you can gather about reproducibility would help in the diagnosis.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1534303</commentid>
    <comment_count>7</comment_count>
    <who name="Ali Juma">ajuma</who>
    <bug_when>2019-05-08 07:22:10 -0700</bug_when>
    <thetext>(In reply to Simon Fraser (smfr) from comment #6)
&gt; Any information you can gather about reproducibility would help in the
&gt; diagnosis.

We don&apos;t have specific repro steps, but we know that users that have our new session restoration logic enabled are running into this crash at a rate that&apos;s 30 times higher than other users, and are crashing much earlier -- the median process uptime when this particular crash occurs is about 16 seconds for those users, compared to 4.3 minutes for other users.

This new session restoration logic works by loading a sequence of file URLs that each return a page that can redirect to the actual site the user visited. So as the user navigates back/forward, we&apos;d first visit that file URL, then get a redirect, and then load the actual URL. (We have to restore sessions in this weird way in order to workaround bug 169618.)

This approach has the side effect of adding process swaps. So suppose the user&apos;s actual history is:
a) www.google.com/search?q=cats
b) www.google.com/search?q=dogs
c) www.google.com/search?q=mice

And say that at startup, we restore this history and the user is now at (c). At this point, if the user taps on the back button, we&apos;d first load our file URL that then redirects to (b). So ordinarily on a navigation from (c) to (b) there wouldn&apos;t be a process swap and we&apos;d continue committing to the same ScrollTree, but with this change we swap to a different process for the file URL and then back to the original process after the redirect. And this time, when we continue in the original process, we&apos;re committing to a new scroll tree.

So my guess is that somehow we&apos;re winding up with a parent-less ScrollTreeNode at the end of all this. (And afaik, https://bugs.webkit.org/show_bug.cgi?id=193907 is not in 12.2 or 12.3, so we don&apos;t have the change there to track and remove unvisited nodes in ScrollingTree::commitTreeState.)</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>361794</attachid>
            <date>2019-02-12 06:55:42 -0800</date>
            <delta_ts>2019-02-12 08:22:24 -0800</delta_ts>
            <desc>patch</desc>
            <filename>scrollingtree-nodemap-remove.patch</filename>
            <type>text/plain</type>
            <size>1338</size>
            <attacher name="Antti Koivisto">koivisto</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDI0MTI5MykKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE2IEBACisyMDE5LTAyLTEyICBBbnR0aSBL
b2l2aXN0byAgPGFudHRpQGFwcGxlLmNvbT4KKworICAgICAgICBDcmFzaCBpbiBXZWJDb3JlOjpT
Y3JvbGxpbmdUcmVlOjp1cGRhdGVUcmVlRnJvbVN0YXRlTm9kZQorICAgICAgICBodHRwczovL2J1
Z3Mud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ZS0+c2V0UGFyZW50KHBhcmVudCk7CiAgICAgICAgICAgICBwYXJlbnQtPmFwcGVu
ZENoaWxkKCpub2RlKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIC8vIEZJWE1FOiBV
c2UgV2Vha1B0ciBpbiBtX25vZGVNYXAuCisgICAgICAgICAgICBtX25vZGVNYXAucmVtb3ZlKG5v
ZGVJRCk7CiAgICAgICAgIH0KICAgICB9CiAK
</data>

          </attachment>
      

    </bug>

</bugzilla>