<?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>145385</bug_id>
          
          <creation_ts>2015-05-26 13:35:33 -0700</creation_ts>
          <short_desc>Integer overflow in XLarge allocation (due to unchecked roundUpToMultipleOf)</short_desc>
          <delta_ts>2015-06-29 18:36:37 -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>New Bugs</component>
          <version>528+ (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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Geoffrey Garen">ggaren</reporter>
          <assigned_to name="Geoffrey Garen">ggaren</assigned_to>
          <cc>cgarcia</cc>
    
    <cc>clopez</cc>
    
    <cc>kling</cc>
    
    <cc>mario</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>mrobinson</cc>
    
    <cc>oliver</cc>
    
    <cc>tpopela</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1097405</commentid>
    <comment_count>0</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2015-05-26 13:35:33 -0700</bug_when>
    <thetext>Integer overflow in XLarge allocation (due to unchecked roundUpToMultipleOf)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1097411</commentid>
    <comment_count>1</comment_count>
      <attachid>253729</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2015-05-26 13:41:01 -0700</bug_when>
    <thetext>Created attachment 253729
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1097418</commentid>
    <comment_count>2</comment_count>
      <attachid>253729</attachid>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2015-05-26 13:50:57 -0700</bug_when>
    <thetext>Comment on attachment 253729
Patch

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

&gt; Source/bmalloc/bmalloc/Allocator.cpp:112
&gt; +        size = roundUpToMultipleOf&lt;xLargeAlignment&gt;(size);
&gt; +        alignment = std::max(superChunkSize, alignment);

Since superChunkSize(32MB) is larger than xLargeAlignment (page size), Isn&apos;t it possible for the size of an aligned extra large allocation to overflow?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1097421</commentid>
    <comment_count>3</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2015-05-26 13:53:30 -0700</bug_when>
    <thetext>&gt; Since superChunkSize(32MB) is larger than xLargeAlignment (page size), Isn&apos;t
&gt; it possible for the size of an aligned extra large allocation to overflow?

Which line of code do you think will overflow?

In the XLarge case, we don&apos;t do math on xLargeAlignment -- we just pass it through to the kernel. As long as there&apos;s no bug in the kernel, we should be OK.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1097511</commentid>
    <comment_count>4</comment_count>
      <attachid>253729</attachid>
    <who name="Andreas Kling">kling</who>
    <bug_when>2015-05-26 15:44:01 -0700</bug_when>
    <thetext>Comment on attachment 253729
Patch

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

r=me

&gt; Source/bmalloc/bmalloc/Allocator.cpp:64
&gt; +        return PerProcess&lt;Heap&gt;::get()-&gt;tryAllocateXLarge(lock, superChunkSize, roundUpToMultipleOf&lt;xLargeAlignment&gt;(size));

Can use getFastCase() here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1097513</commentid>
    <comment_count>5</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2015-05-26 15:48:27 -0700</bug_when>
    <thetext>Committed r184883: &lt;http://trac.webkit.org/changeset/184883&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1105279</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2015-06-28 08:35:31 -0700</bug_when>
    <thetext>In Fedora we have 105 reports of this crash still occurring in our latest build with this patch applied (all from 32-bit computers), so something&apos;s still wrong here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1105360</commentid>
    <comment_count>7</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2015-06-29 02:56:14 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; In Fedora we have 105 reports of this crash still occurring in our latest
&gt; build with this patch applied (all from 32-bit computers), so something&apos;s
&gt; still wrong here.

I&apos;ve seen this since last week in our debian-like Linux system too, right after upgrading to WebKitGTK+ 2.8.3. I&apos;ve applied the patch here but the crash is not gone yet, still trying to find what&apos;s wrong here. Will report back as soon as I have more info.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1105419</commentid>
    <comment_count>8</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2015-06-29 10:47:20 -0700</bug_when>
    <thetext>Which crash?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1105424</commentid>
    <comment_count>9</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2015-06-29 10:58:56 -0700</bug_when>
    <thetext>Can someone who&apos;s seeing this crash put a stack trace in? Preferably with local var info if you can get it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1105425</commentid>
    <comment_count>10</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2015-06-29 11:00:57 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; Which crash?

I think Mario is referring to the crash discussed here: https://lists.webkit.org/pipermail/webkit-gtk/2015-June/002381.html

The stack trace for that one is:
(gdb) bt
#0  allocateXLarge () at
/home/mario/webkit2gtk-2.8.3+dfsg1/Source/bmalloc/bmalloc/Heap.cpp:287
#1  0xb4fc94f5 in allocateXLarge () at
/home/mario/webkit2gtk-2.8.3+dfsg1/Source/bmalloc/bmalloc/Heap.cpp:293
#2  0xb4fc6ac4 in allocateXLarge () at
/home/mario/webkit2gtk-2.8.3+dfsg1/Source/bmalloc/bmalloc/Allocator.cpp:227
#3  0xb4fc6b2e in allocateSlowCase () at
/home/mario/webkit2gtk-2.8.3+dfsg1/Source/bmalloc/bmalloc/Allocator.cpp:245
#4  0xb4f95de2 in allocate () at
/home/mario/webkit2gtk-2.8.3+dfsg1/Source/bmalloc/bmalloc/Allocator.h:86
#5  allocate () at
/home/mario/webkit2gtk-2.8.3+dfsg1/Source/bmalloc/bmalloc/Cache.h:79
#6  malloc () at
/home/mario/webkit2gtk-2.8.3+dfsg1/Source/bmalloc/bmalloc/bmalloc.h:43
#7  fastMalloc () at
/home/mario/webkit2gtk-2.8.3+dfsg1/Source/WTF/wtf/FastMalloc.cpp:270
#8  0xb5592815 in allocateBuffer () at
/home/mario/webkit2gtk-2.8.3+dfsg1/Source/WTF/wtf/Vector.h:269
#9  reserveCapacity () at
/home/mario/webkit2gtk-2.8.3+dfsg1/Source/WTF/wtf/Vector.h:1090
#10 expandCapacity () at
/home/mario/webkit2gtk-2.8.3+dfsg1/Source/WTF/wtf/Vector.h:951
#11 0xb5f766e1 in expandCapacity () at
/home/mario/webkit2gtk-2.8.3+dfsg1/Source/WTF/wtf/Vector.h:958
#12 appendSlowCase&lt;WebCore::FloatRect&amp;&gt; () at
/home/mario/webkit2gtk-2.8.3+dfsg1/Source/WTF/wtf/Vector.h:1219
#13 append&lt;WebCore::FloatRect&amp;&gt; () at
/home/mario/webkit2gtk-2.8.3+dfsg1/Source/WTF/wtf/Vector.h:1210
#14 createOrDestroyTilesIfNeeded () at
/home/mario/webkit2gtk-2.8.3+dfsg1/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:89
#15 0xb5f77001 in updateContents () at
/home/mario/webkit2gtk-2.8.3+dfsg1/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:148
#16 0xb64aefb3 in updateBackingStoreIfNeeded () at
/home/mario/webkit2gtk-2.8.3+dfsg1/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:549
#17 0xb64af095 in updateBackingStoreIncludingSubLayers () at
/home/mario/webkit2gtk-2.8.3+dfsg1/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:519
#18 0xb64af0ed in updateBackingStoreIncludingSubLayers () at
/home/mario/webkit2gtk-2.8.3+dfsg1/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:526
#19 0xb64af0ed in updateBackingStoreIncludingSubLayers () at
/home/mario/webkit2gtk-2.8.3+dfsg1/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:526
[...]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1105441</commentid>
    <comment_count>11</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2015-06-29 11:57:58 -0700</bug_when>
    <thetext>The report on RH bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=1225733
https://retrace.fedoraproject.org/faf/reports/605326/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1105451</commentid>
    <comment_count>12</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2015-06-29 12:08:32 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; Which crash?

Eh, the Fedora crash report was thought to be caused by this bug, but I see there is no report of any crash in this bug. We could create a separate WebKit bug report for this if you want.

We usually always have a full backtrace with local variable info (for whichever variables survived optimization) but this time around we don&apos;t, due to a flaw in the Fedora crash tracker. Maybe Mario can provide that, since he can reproduce it reliably.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1105473</commentid>
    <comment_count>13</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2015-06-29 13:20:54 -0700</bug_when>
    <thetext>That crash is not related to integer overflow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1105484</commentid>
    <comment_count>14</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2015-06-29 13:50:22 -0700</bug_when>
    <thetext>(In reply to comment #12)
&gt; (In reply to comment #8)
&gt; &gt; Which crash?
&gt; 
Sorry about that, I&apos;ve been trying to wrap my head today around so many things that I reply too quickly, without actually realizing that this bug was not about any crash :/

In any case, I was referring to the crash that Martin kindly pasted here, which I&apos;ve been reliably reproducing 100% of the times in my Ubuntu-like 32-bit box whenever I run an application that embeds and uses WebKitGTK+ through GObject Introspection (more details here: https://lists.webkit.org/pipermail/webkit-gtk/2015-June/002381.html)

&gt; Eh, the Fedora crash report was thought to be caused by this bug, but I see
&gt; there is no report of any crash in this bug. We could create a separate
&gt; WebKit bug report for this if you want.
&gt; 

Same here. I also thought that this crash could have be caused by the same issue, and therefore I also associated it somehow with this patch. But perhaps is not related, as Geoffrey mentioned in his last comment.

I&apos;ll file a new bug then, now that it seems pretty obvious that is not only happening to me (the fedora backtrace is nearly identical)...

&gt; We usually always have a full backtrace with local variable info (for
&gt; whichever variables survived optimization) but this time around we don&apos;t,
&gt; due to a flaw in the Fedora crash tracker. Maybe Mario can provide that,
&gt; since he can reproduce it reliably.

Not this time, sorry. The backtrace you are seeing now is the best that I could get so far, which is taken out of a DEBUG build with -O0 and -g1 passed as CFLAGS. I&apos;d love to have passed -g2 or -g3, so that I can get the actual values in the backtrace, but I haven&apos;t found a way to do it because, being a 32-bit build, whenever I get to the linking stage the building process dies trying to link 2.4GB of shared objects.

If you, or anyone else, knows a way I can still get a more meaningful backtrace for this 32-bit build, I&apos;m more than extremely happy to try that out, so please speak up :)

(In reply to comment #13)
&gt; That crash is not related to integer overflow.

Thanks for confirming that. Any idea on what this could be a about then?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1105560</commentid>
    <comment_count>15</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2015-06-29 16:41:35 -0700</bug_when>
    <thetext>(In reply to comment #14)
&gt; [...]
&gt; I&apos;ll file a new bug then, now that it seems pretty obvious that is not only
&gt; happening to me (the fedora backtrace is nearly identical)...

New bug reported: https://bugs.webkit.org/show_bug.cgi?id=146440</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>253729</attachid>
            <date>2015-05-26 13:41:01 -0700</date>
            <delta_ts>2015-05-26 15:44:01 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-145385-20150526134051.patch</filename>
            <type>text/plain</type>
            <size>5599</size>
            <attacher name="Geoffrey Garen">ggaren</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9ibWFsbG9jL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvYm1h
bGxvYy9DaGFuZ2VMb2cJKHJldmlzaW9uIDE4NDg2OSkKKysrIFNvdXJjZS9ibWFsbG9jL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDM0IEBACisyMDE1LTA1LTI2ICBHZW9mZnJl
eSBHYXJlbiAgPGdnYXJlbkBhcHBsZS5jb20+CisKKyAgICAgICAgSW50ZWdlciBvdmVyZmxvdyBp
biBYTGFyZ2UgYWxsb2NhdGlvbiAoZHVlIHRvIHVuY2hlY2tlZCByb3VuZFVwVG9NdWx0aXBsZU9m
KQorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTQ1Mzg1
CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgQWRkZWQg
c29tZSBjaGVja2luZyB0byB2ZXJpZnkgdGhhdCByb3V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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PQotLS0gU291cmNlL2JtYWxsb2MvYm1hbGxvYy9CQXNzZXJ0LmgJKHJldmlzaW9uIDE4
NDg2MikKKysrIFNvdXJjZS9ibWFsbG9jL2JtYWxsb2MvQkFzc2VydC5oCSh3b3JraW5nIGNvcHkp
CkBAIC0yNiwxMCArMjYsMTQgQEAKICNpZm5kZWYgQkFzc2VydF9oCiAjZGVmaW5lIEJBc3NlcnRf
aAogCisjZGVmaW5lIEJDUkFTSCgpIGRvIHsgXAorICAgICooaW50KikweGJiYWRiZWVmID0gMDsg
XAorfSB3aGlsZSAoMCk7CisKICNkZWZpbmUgQkFTU0VSVF9JTVBMKHgpIGRvIHsgXAogICAgIGlm
ICghKHgpKSBcCi0gICAgICAgICooaW50KikweGJiYWRiZWVmID0gMDsgXAotfSB3aGlsZSgwKTsK
KyAgICAgICAgQkNSQVNIKCk7IFwKK30gd2hpbGUgKDApOwogCiAjZGVmaW5lIFJFTEVBU0VfQkFT
U0VSVCh4KSBCQVNTRVJUX0lNUEwoeCkKIApJbmRleDogU291cmNlL2JtYWxsb2MvYm1hbGxvYy9T
aXplcy5oCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT0KLS0tIFNvdXJjZS9ibWFsbG9jL2JtYWxsb2MvU2l6ZXMuaAkocmV2
aXNpb24gMTg0ODYyKQorKysgU291cmNlL2JtYWxsb2MvYm1hbGxvYy9TaXplcy5oCSh3b3JraW5n
IGNvcHkpCkBAIC04MCw2ICs4MCw3IEBAIG5hbWVzcGFjZSBTaXplcyB7CiAgICAgc3RhdGljIGNv
bnN0IHNpemVfdCBsYXJnZU1pbiA9IG1lZGl1bU1heDsKICAgICAKICAgICBzdGF0aWMgY29uc3Qg
c2l6ZV90IHhMYXJnZUFsaWdubWVudCA9IHZtUGFnZVNpemU7CisgICAgc3RhdGljIGNvbnN0IHNp
emVfdCB4TGFyZ2VNYXggPSBzdGQ6Om51bWVyaWNfbGltaXRzPHNpemVfdD46Om1heCgpIC0geExh
cmdlQWxpZ25tZW50OyAvLyBNYWtlIHN1cmUgdGhhdCByb3VuZGluZyB1cCB0byB4TGFyZ2VBbGln
bm1lbnQgZG9lcyBub3Qgb3ZlcmZsb3cuCiAKICAgICBzdGF0aWMgY29uc3Qgc2l6ZV90IGZyZWVM
aXN0U2VhcmNoRGVwdGggPSAxNjsKICAgICBzdGF0aWMgY29uc3Qgc2l6ZV90IGZyZWVMaXN0R3Jv
d0ZhY3RvciA9IDI7Cg==
</data>
<flag name="review"
          id="278670"
          type_id="1"
          status="+"
          setter="kling"
    />
          </attachment>
      

    </bug>

</bugzilla>