<?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>113453</bug_id>
          
          <creation_ts>2013-03-27 16:05:10 -0700</creation_ts>
          <short_desc>CodeCache::m_capacity can becoming negative, producing undefined results in pruneSlowCase</short_desc>
          <delta_ts>2013-08-13 14:53:26 -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>JavaScriptCore</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="Mark Hahnenberg">mhahnenberg</reporter>
          <assigned_to name="Mark Hahnenberg">mhahnenberg</assigned_to>
          <cc>ossy</cc>
    
    <cc>simon.fraser</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>864951</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2013-03-27 16:05:10 -0700</bug_when>
    <thetext>I encountered a situation where m_capacity can become negative in pruneSlowCase, which will lead to undefined behavior because we&apos;ll hit the end of m_map, but there&apos;s no check to make sure that m_map.begin() != m_map.end(). Depending on what it-&gt;key gives us, sometimes we&apos;ll crash, sometimes we&apos;ll get a very big number back from length() which will keep us alive by allowing our size to go below our negative m_size, etc. It doesn&apos;t happen during every run, so there&apos;s some non-determinism there. And sometimes we&apos;ll get zero as the length, which will cause an infinite loop.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>864952</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2013-03-27 16:05:26 -0700</bug_when>
    <thetext>&lt;rdar://problem/13519289&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>864971</commentid>
    <comment_count>2</comment_count>
      <attachid>195430</attachid>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2013-03-27 16:32:59 -0700</bug_when>
    <thetext>Created attachment 195430
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>864972</commentid>
    <comment_count>3</comment_count>
      <attachid>195430</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2013-03-27 16:34:28 -0700</bug_when>
    <thetext>Comment on attachment 195430
Patch

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>864975</commentid>
    <comment_count>4</comment_count>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2013-03-27 16:35:45 -0700</bug_when>
    <thetext>Committed r147017: &lt;http://trac.webkit.org/changeset/147017&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>865230</commentid>
    <comment_count>5</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2013-03-28 01:23:11 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; Committed r147017: &lt;http://trac.webkit.org/changeset/147017&gt;

And the buildfix landed in http://trac.webkit.org/changeset/147079. Thanks Zan.
(We could have avoided this build breakage and killing EWS bots if you waited
for the EWS bots a little bit more than 3 minutes. Or watched the bots after landing ...)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>916898</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2013-08-13 14:53:26 -0700</bug_when>
    <thetext>*** Bug 112263 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>195430</attachid>
            <date>2013-03-27 16:32:59 -0700</date>
            <delta_ts>2013-03-27 16:34:27 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-113453-20130327163258.patch</filename>
            <type>text/plain</type>
            <size>1357</size>
            <attacher name="Mark Hahnenberg">mhahnenberg</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTQ3MDE2KQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE0IEBA
CisyMDEzLTAzLTI3ICBNYXJrIEhhaG5lbmJlcmcgIDxtaGFobmVuYmVyZ0BhcHBsZS5jb20+CisK
KyAgICAgICAgQ29kZUNhY2hlOjptX2NhcGFjaXR5IGNhbiBiZWNvbWluZyBuZWdhdGl2ZSwgcHJv
ZHVjaW5nIHVuZGVmaW5lZCByZXN1bHRzIGluIHBydW5lU2xvd0Nhc2UKKyAgICAgICAgaHR0cHM6
Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTExMzQ1MworCisgICAgICAgIFJldmll
d2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgICogcnVudGltZS9Db2RlQ2FjaGUuY3Bw
OgorICAgICAgICAoSlNDOjpDb2RlQ2FjaGVNYXA6OnBydW5lU2xvd0Nhc2UpOiBXZSBtYWtlIHN1
cmUgdGhhdCBtX21pbkNhcGFjaXR5IGRvZXNuJ3QgZHJvcCBiZWxvdyB6ZXJvIG5vdy4KKyAgICAg
ICAgVGhpcyBwcmV2ZW50cyBtX2NhcGFjaXR5IGZyb20gZG9pbmcgdGhlIHNhbWUuCisKIDIwMTMt
MDMtMjcgIEZpbGlwIFBpemxvICA8ZnBpemxvQGFwcGxlLmNvbT4KIAogICAgICAgICBERkcgc2hv
dWxkIHVzZSBDaGVja1N0cnVjdHVyZSBmb3IgdHlwZWQgYXJyYXkgY2hlY2tzIHdoZW5ldmVyIHBv
c3NpYmxlCkluZGV4OiBTb3VyY2UvSmF2YVNjcmlwdENvcmUvcnVudGltZS9Db2RlQ2FjaGUuY3Bw
Cj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT0KLS0tIFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9ydW50aW1lL0NvZGVDYWNoZS5j
cHAJKHJldmlzaW9uIDE0NzAxNikKKysrIFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9ydW50aW1lL0Nv
ZGVDYWNoZS5jcHAJKHdvcmtpbmcgY29weSkKQEAgLTQwLDcgKzQwLDcgQEAgY29uc3QgZG91Ymxl
IENvZGVDYWNoZU1hcDo6d29ya2luZ1NldFRpbQogCiB2b2lkIENvZGVDYWNoZU1hcDo6cHJ1bmVT
bG93Q2FzZSgpCiB7Ci0gICAgbV9taW5DYXBhY2l0eSA9IG1fc2l6ZSAtIG1fc2l6ZUF0TGFzdFBy
dW5lOworICAgIG1fbWluQ2FwYWNpdHkgPSBzdGQ6Om1heChtX3NpemUgLSBtX3NpemVBdExhc3RQ
cnVuZSwgMExMKTsKICAgICBtX3NpemVBdExhc3RQcnVuZSA9IG1fc2l6ZTsKICAgICBtX3RpbWVB
dExhc3RQcnVuZSA9IG1vbm90b25pY2FsbHlJbmNyZWFzaW5nVGltZSgpOwogCg==
</data>
<flag name="review"
          id="217323"
          type_id="1"
          status="+"
          setter="ggaren"
    />
          </attachment>
      

    </bug>

</bugzilla>