<?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>141406</bug_id>
          
          <creation_ts>2015-02-09 15:24:05 -0800</creation_ts>
          <short_desc>REGRESSION: tryFastCalloc is no longer &quot;try&quot;</short_desc>
          <delta_ts>2015-02-10 09:33:48 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Template Framework</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>Regression</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexey Proskuryakov">ap</reporter>
          <assigned_to name="Alexey Proskuryakov">ap</assigned_to>
          <cc>benjamin</cc>
    
    <cc>cmarcelo</cc>
    
    <cc>commit-queue</cc>
    
    <cc>darin</cc>
    
    <cc>ggaren</cc>
    
    <cc>kling</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1067935</commentid>
    <comment_count>0</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2015-02-09 15:24:05 -0800</bug_when>
    <thetext>tryFastCalloc just calls through to fastCalloc, which crashes when allocation fails.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1067938</commentid>
    <comment_count>1</comment_count>
      <attachid>246297</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2015-02-09 15:27:16 -0800</bug_when>
    <thetext>Created attachment 246297
proposed fix

I saw this cause crashes on fast/canvas/webgl/webgl-compressed-texture-size-limit.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1067957</commentid>
    <comment_count>2</comment_count>
      <attachid>246297</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2015-02-09 16:12:43 -0800</bug_when>
    <thetext>Comment on attachment 246297
proposed fix

Clearing flags on attachment: 246297

Committed r179855: &lt;http://trac.webkit.org/changeset/179855&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1067958</commentid>
    <comment_count>3</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2015-02-09 16:12:47 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1068067</commentid>
    <comment_count>4</comment_count>
      <attachid>246297</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2015-02-10 08:34:50 -0800</bug_when>
    <thetext>Comment on attachment 246297
proposed fix

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

&gt; Source/WTF/wtf/FastMalloc.cpp:326
&gt; +    return tryFastZeroedMalloc(numElements * elementSize);

Wait a second, what about overflow checking for the multiplication?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1068068</commentid>
    <comment_count>5</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2015-02-10 08:36:36 -0800</bug_when>
    <thetext>I think that both fastCalloc and tryFastCalloc are missing checking on overflow in the multiplication in the USE_BMALLOC case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1068085</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2015-02-10 09:33:48 -0800</bug_when>
    <thetext>Great catch, I copied the existing code mindlessly.

Darin has a fix in bug 141434.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>246297</attachid>
            <date>2015-02-09 15:27:16 -0800</date>
            <delta_ts>2015-02-09 16:12:43 -0800</delta_ts>
            <desc>proposed fix</desc>
            <filename>TryMalloc.txt</filename>
            <type>text/plain</type>
            <size>1216</size>
            <attacher name="Alexey Proskuryakov">ap</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XVEYvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFNvdXJjZS9XVEYvQ2hh
bmdlTG9nCShyZXZpc2lvbiAxNzk4NDcpCisrKyBTb3VyY2UvV1RGL0NoYW5nZUxvZwkod29ya2lu
ZyBjb3B5KQpAQCAtMSwzICsxLDE0IEBACisyMDE1LTAyLTA5ICBBbGV4ZXkgUHJvc2t1cnlha292
ICA8YXBAYXBwbGUuY29tPgorCisgICAgICAgIFJFR1JFU1NJT046IHRyeUZhc3RDYWxsb2MgaXMg
bm8gbG9uZ2VyICJ0cnkiCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVn
LmNnaT9pZD0xNDE0MDYKKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKwor
ICAgICAgICBUaGlzIGNhdXNlcyBjcmFzaGVzIG9uIHNvbWUgV2ViS2l0IHJlZ3Jlc3Npb24gdGVz
dCBib3RzLgorCisgICAgICAgICogd3RmL0Zhc3RNYWxsb2MuY3BwOiAoV1RGOjp0cnlGYXN0Q2Fs
bG9jKTogRml4IHdoYXQgbG9va3MgbGlrZSBhIGNvcHkvcGFzdGUgbWlzdGFrZS4KKwogMjAxNS0w
Mi0wNyAgQ3NhYmEgT3N6dHJvZ29uw6FjICA8b3NzeUB3ZWJraXQub3JnPgogCiAgICAgICAgIFtB
Uk1dIEdDIHNvbWV0aW1lcyBzdHVjayBpbiBhbiBpbmZpbml0ZSBsb29wIGlmIHBhcmFsbGVsIEdD
IGl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