<?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>160403</bug_id>
          
          <creation_ts>2016-08-01 07:41:29 -0700</creation_ts>
          <short_desc>[bmalloc] Merging of XLargeRanges can leak the upper range</short_desc>
          <delta_ts>2016-08-04 03:22:28 -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>bmalloc</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="Zan Dobersek">zan</reporter>
          <assigned_to name="Zan Dobersek">zan</assigned_to>
          <cc>ap</cc>
    
    <cc>cgarcia</cc>
    
    <cc>ddkilzer</cc>
    
    <cc>ggaren</cc>
    
    <cc>kling</cc>
    
    <cc>mrobinson</cc>
    
    <cc>msaboff</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1216102</commentid>
    <comment_count>0</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2016-08-01 07:41:29 -0700</bug_when>
    <thetext>merge in XLargeRange.h first deduces the lower range and then checks if the size of the lower range matches the physical size. If so, the two ranges are merged into one, summing both logical and physical sizes.

But if the logical size of the lower range does not match the physical size, the returned range discards any physical size for the upper range. At least on Linux systems, this results in leaking pages that are described in the upper XLargeRange.

Using memfds and some simple tagging, I was able to get bmalloc to differentiate between small, large and misc allocations (Vector and Cache). This helped properly measure which types of allocations used the largest amount of memory, along with verbosely outlining memory mappings for any process using bmalloc.

The JetStream benchmark was used to analyze the issue. After completing, on the GTK+ port, the WebProcess was using over 500MB there. Investigating the mappings, over 200MB was used for large allocations, even when m_largeAllocated map in the bmalloc::Heap object was reporting only 47MB of large allocations. Further inspection then led to the XLargeRange merging, showing that the upper range can have its physical size information ignored if the lower range is not fully allocated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1216110</commentid>
    <comment_count>1</comment_count>
      <attachid>285013</attachid>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2016-08-01 08:19:25 -0700</bug_when>
    <thetext>Created attachment 285013
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1216530</commentid>
    <comment_count>2</comment_count>
      <attachid>285013</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2016-08-02 11:05:20 -0700</bug_when>
    <thetext>Comment on attachment 285013
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=285013&amp;action=review

&gt; Source/bmalloc/ChangeLog:18
&gt; +        ignored. At least on Linux systems, this resulted in such
&gt; +        memory allocations being leaked.

Can you explain in more detail why we end up with a leak on Linux?

On Mac and Windows, at least, it&apos;s OK to call vmAllocatePhysicalPages twice for the same address range.

&gt; Source/bmalloc/bmalloc/XLargeRange.h:70
&gt;  {
&gt; -    if (a.end() == b.begin())
&gt; +    if (a.end() == b.begin() &amp;&amp; (a.size() == a.physicalSize() || (!a.physicalSize() &amp;&amp; !b.physicalSize())))
&gt;          return true;
&gt;      
&gt; -    if (b.end() == a.begin())
&gt; +    if (b.end() == a.begin() &amp;&amp; (b.size() == b.physicalSize() || (!a.physicalSize() &amp;&amp; !b.physicalSize())))
&gt;          return true;
&gt;      

This will cause serious virtual memory fragmentation, triggering jetsam on iOS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1216806</commentid>
    <comment_count>3</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2016-08-02 22:52:40 -0700</bug_when>
    <thetext>I think I understand what you&apos;re reporting now:

If we merge(A, B), and B has physicalSize and A doesn&apos;t, we produce an XLargeRange with no physicalSize.

In principle, this is OK: physicalSize is just an optimization to remember the contiguous committed space at the head of a range, and the optimization has failed since there is none.

The problem happens later, in Heap::scavengeLargeObjects. We scavenge by calling XLargeMap::removePhysical -- but the [A, B] range has no physicalSize, so we never scavenge it.

I still don&apos;t think we want to change the behavior of merge() -- instead, we want to change the behavior of Heap::scavengeLargeObjects.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1216907</commentid>
    <comment_count>4</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2016-08-03 07:13:02 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Comment on attachment 285013 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=285013&amp;action=review
&gt; 
&gt; &gt; Source/bmalloc/ChangeLog:18
&gt; &gt; +        ignored. At least on Linux systems, this resulted in such
&gt; &gt; +        memory allocations being leaked.
&gt; 
&gt; Can you explain in more detail why we end up with a leak on Linux?
&gt; 
&gt; On Mac and Windows, at least, it&apos;s OK to call vmAllocatePhysicalPages twice
&gt; for the same address range.
&gt; 

It&apos;s OK on Linux as well. The problem I&apos;m trying to address here is that right-hand XLargeRanges with some physical size can get ignored during merging if the left-hand ranges have partial physical size or no physical size. So the merged range only has information on any physical allocation that was done for the left-hand range, while the allocated memory from the right-hand range doesn&apos;t get deallocated during scavenging, but instead relies on some future allocation to reuse that range.

(In reply to comment #3)
&gt; I think I understand what you&apos;re reporting now:
&gt; 
&gt; If we merge(A, B), and B has physicalSize and A doesn&apos;t, we produce an
&gt; XLargeRange with no physicalSize.
&gt; 

Also if A has physicalSize that&apos;s less that its size, which can be the case if A was previously merged from A1 that had physicalSize matching its size, and A2 that had no physicalSize.

&gt; In principle, this is OK: physicalSize is just an optimization to remember
&gt; the contiguous committed space at the head of a range, and the optimization
&gt; has failed since there is none.
&gt; 
&gt; The problem happens later, in Heap::scavengeLargeObjects. We scavenge by
&gt; calling XLargeMap::removePhysical -- but the [A, B] range has no
&gt; physicalSize, so we never scavenge it.
&gt; 
&gt; I still don&apos;t think we want to change the behavior of merge() -- instead, we
&gt; want to change the behavior of Heap::scavengeLargeObjects.

How exactly? Would it be acceptable to delay merging of ranges until after all the large allocations have been scavenged?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1217025</commentid>
    <comment_count>5</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2016-08-03 11:17:30 -0700</bug_when>
    <thetext>&gt; &gt; If we merge(A, B), and B has physicalSize and A doesn&apos;t, we produce an
&gt; &gt; XLargeRange with no physicalSize.
&gt; &gt; 
&gt; 
&gt; Also if A has physicalSize that&apos;s less that its size, which can be the case
&gt; if A was previously merged from A1 that had physicalSize matching its size,
&gt; and A2 that had no physicalSize.

If we merge(A, B), and B has no physicalSize and A has physicalSize less than its size, we&apos;ll do this:

    return XLargeRange(
        left.begin(),
        a.size() + b.size(),
        left.physicalSize());

So, A&apos;s physicalSize is not lost.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1217028</commentid>
    <comment_count>6</comment_count>
      <attachid>285252</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2016-08-03 11:22:18 -0700</bug_when>
    <thetext>Created attachment 285252
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1217033</commentid>
    <comment_count>7</comment_count>
      <attachid>285252</attachid>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2016-08-03 11:32:37 -0700</bug_when>
    <thetext>Comment on attachment 285252
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=285252&amp;action=review

r=me

&gt; Source/bmalloc/ChangeLog:11
&gt; +        Recorded physical size is a performance optimization is not the truth,
&gt; +        so depending on it can cause you to forget physical ranges.

Wording seems awkward.  Should the second &quot;is&quot; be &quot;and&quot;?  The second part of the sentence probably needs some work as well.

&gt; Source/bmalloc/ChangeLog:16
&gt; +        Be careful each time through the loop to decrement our iterator if
&gt; +        the map shrunk while we released the lock.

Seems awkward as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1217043</commentid>
    <comment_count>8</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2016-08-03 11:44:35 -0700</bug_when>
    <thetext>Committed r204091: &lt;http://trac.webkit.org/changeset/204091&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1217044</commentid>
    <comment_count>9</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2016-08-03 11:45:34 -0700</bug_when>
    <thetext>&gt; &gt; Source/bmalloc/ChangeLog:11
&gt; &gt; +        Recorded physical size is a performance optimization is not the truth,
&gt; &gt; +        so depending on it can cause you to forget physical ranges.
&gt; 
&gt; Wording seems awkward.  Should the second &quot;is&quot; be &quot;and&quot;?  The second part of
&gt; the sentence probably needs some work as well.

        (bmalloc::Heap::scavengeLargeObjects): Don&apos;t use removePhysical().
        Recorded physical size is a performance optimization. It is not the
        truth. So it might be zero even if a range contains physical pages.

&gt; &gt; Source/bmalloc/ChangeLog:16
&gt; &gt; +        Be careful each time through the loop to decrement our iterator if
&gt; &gt; +        the map shrunk while we released the lock.
&gt; 

        The map can shrink when we release the lock, so we must clamp our
        iterator each time through the loop.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1217077</commentid>
    <comment_count>10</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2016-08-03 12:49:01 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; &gt; &gt; If we merge(A, B), and B has physicalSize and A doesn&apos;t, we produce an
&gt; &gt; &gt; XLargeRange with no physicalSize.
&gt; &gt; &gt; 
&gt; &gt; 
&gt; &gt; Also if A has physicalSize that&apos;s less that its size, which can be the case
&gt; &gt; if A was previously merged from A1 that had physicalSize matching its size,
&gt; &gt; and A2 that had no physicalSize.
&gt; 
&gt; If we merge(A, B), and B has no physicalSize and A has physicalSize less
&gt; than its size, we&apos;ll do this:
&gt; 
&gt;     return XLargeRange(
&gt;         left.begin(),
&gt;         a.size() + b.size(),
&gt;         left.physicalSize());
&gt; 
&gt; So, A&apos;s physicalSize is not lost.

Right, I misread your comment. What I was writing about was that if A has some physicalSize that doesn&apos;t match its whole size, and B has some physicalSize as well, then B&apos;s physicalSize would be lost.

Shouldn&apos;t be a problem anymore though, thanks for the quick fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1217356</commentid>
    <comment_count>11</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2016-08-04 03:22:28 -0700</bug_when>
    <thetext>&lt;rdar://problem/27696655&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>285013</attachid>
            <date>2016-08-01 08:19:25 -0700</date>
            <delta_ts>2016-08-03 11:22:14 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-160403-20160801081805.patch</filename>
            <type>text/plain</type>
            <size>2765</size>
            <attacher name="Zan Dobersek">zan</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjAzOTczCmRpZmYgLS1naXQgYS9Tb3VyY2UvYm1hbGxvYy9D
aGFuZ2VMb2cgYi9Tb3VyY2UvYm1hbGxvYy9DaGFuZ2VMb2cKaW5kZXggYjU3NmY5MzhmMjA2YjNi
NjZjNTFlZGZjYjY1MjJhY2Q3NWFhNjY3Ny4uYjkzN2RiZDAyOWIyMmJiZGZjYjE0ODQ4Mjg0NTk1
ODBjMTdiNDg5MSAxMDA2NDQKLS0tIGEvU291cmNlL2JtYWxsb2MvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9ibWFsbG9jL0NoYW5nZUxvZwpAQCAtMSwzICsxLDI2IEBACisyMDE2LTA4LTAxICBaYW4g
RG9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WlyPFhMYXJnZVJhbmdlLCBYTGFyZ2VSYW5nZT4gWExhcmdlUmFu
Z2U6OnNwbGl0KHNpemVfdCBzaXplKSBjb25zdAo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>285252</attachid>
            <date>2016-08-03 11:22:18 -0700</date>
            <delta_ts>2016-08-03 11:32:37 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-160403-20160803112057.patch</filename>
            <type>text/plain</type>
            <size>3453</size>
            <attacher name="Geoffrey Garen">ggaren</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9ibWFsbG9jL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvYm1h
bGxvYy9DaGFuZ2VMb2cJKHJldmlzaW9uIDIwNDA4OCkKKysrIFNvdXJjZS9ibWFsbG9jL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDMxIEBACisyMDE2LTA4LTAzICBHZW9mZnJl
eSBHYXJlbiAgPGdnYXJlbkBhcHBsZS5jb20+CisKKyAgICAgICAgW2JtYWxsb2NdIE1lcmdpbmcg
b2YgWExhcmdlUmFuZ2VzIGNhbiBsZWFrIHRoZSB1cHBlciByYW5nZQorICAgICAgICBodHRwczov
L2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTYwNDAzCisKKyAgICAgICAgUmV2aWV3
ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgKiBibWFsbG9jL0hlYXAuY3BwOgorICAg
ICAgICAoYm1hbGxvYzo6SGVhcDo6c2NhdmVuZ2VMYXJnZU9iamVjdHMpOiBEb24ndCB1c2UgcmVt
b3ZlUGh5c2ljYWwoKS4KKyAgICAgICAgUmVjb3JkZWQgcGh5c2ljYWwgc2l6ZSBpcyBhIHBlcm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2JtYWxsb2MvWExhcmdlTWFwLmgKPT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQot
LS0gU291cmNlL2JtYWxsb2MvYm1hbGxvYy9YTGFyZ2VNYXAuaAkocmV2aXNpb24gMjAzNjcyKQor
KysgU291cmNlL2JtYWxsb2MvYm1hbGxvYy9YTGFyZ2VNYXAuaAkod29ya2luZyBjb3B5KQpAQCAt
MzYsNyArMzYsNyBAQCBjbGFzcyBYTGFyZ2VNYXAgewogcHVibGljOgogICAgIHZvaWQgYWRkKGNv
bnN0IFhMYXJnZVJhbmdlJik7CiAgICAgWExhcmdlUmFuZ2UgcmVtb3ZlKHNpemVfdCBhbGlnbm1l
bnQsIHNpemVfdCk7Ci0gICAgWExhcmdlUmFuZ2UgcmVtb3ZlUGh5c2ljYWwoKTsKKyAgICBWZWN0
b3I8WExhcmdlUmFuZ2U+JiByYW5nZXMoKSB7IHJldHVybiBtX2ZyZWU7IH0KIAogcHJpdmF0ZToK
ICAgICBWZWN0b3I8WExhcmdlUmFuZ2U+IG1fZnJlZTsK
</data>
<flag name="review"
          id="308874"
          type_id="1"
          status="+"
          setter="msaboff"
    />
          </attachment>
      

    </bug>

</bugzilla>