<?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>157595</bug_id>
          
          <creation_ts>2016-05-11 16:45:15 -0700</creation_ts>
          <short_desc>r199812 broke test262</short_desc>
          <delta_ts>2016-05-19 11:39:12 -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>WebKit Local 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>
          
          <blocked>156832</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Saam Barati">saam</reporter>
          <assigned_to name="Michael Saboff">msaboff</assigned_to>
          <cc>benjamin</cc>
    
    <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>gskachkov</cc>
    
    <cc>keith_miller</cc>
    
    <cc>mark.lam</cc>
    
    <cc>msaboff</cc>
    
    <cc>oliver</cc>
    
    <cc>ossy</cc>
    
    <cc>saam</cc>
    
    <cc>sukolsak</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1192148</commentid>
    <comment_count>0</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2016-05-11 16:45:15 -0700</bug_when>
    <thetext>It fails around the 38% mark.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1192151</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2016-05-11 16:48:31 -0700</bug_when>
    <thetext>&lt;rdar://problem/26234295&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1194315</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2016-05-18 10:36:01 -0700</bug_when>
    <thetext>We believe that this is due to String.prototype.match() going into an infinite loop. This can happen when the argument RegExp object has an override for .global that always returns true, but the global flag on the base RegExp is false.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1194430</commentid>
    <comment_count>3</comment_count>
      <attachid>279288</attachid>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2016-05-18 14:54:58 -0700</bug_when>
    <thetext>Created attachment 279288
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1194463</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2016-05-18 15:35:02 -0700</bug_when>
    <thetext>Committed r201105: &lt;http://trac.webkit.org/changeset/201105&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1194492</commentid>
    <comment_count>5</comment_count>
      <attachid>279288</attachid>
    <who name="Saam Barati">saam</who>
    <bug_when>2016-05-18 16:15:30 -0700</bug_when>
    <thetext>Comment on attachment 279288
Patch

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

&gt; Source/JavaScriptCore/builtins/RegExpPrototype.js:113
&gt; +            throw new @Error(&quot;Out of memory&quot;);

Maybe this could be more descriptive about where we&apos;re throwing the OOM from?
Or maybe the error object itself nicely handles this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1194530</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2016-05-18 17:08:40 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; Comment on attachment 279288 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=279288&amp;action=review
&gt; 
&gt; &gt; Source/JavaScriptCore/builtins/RegExpPrototype.js:113
&gt; &gt; +            throw new @Error(&quot;Out of memory&quot;);
&gt; 
&gt; Maybe this could be more descriptive about where we&apos;re throwing the OOM from?
&gt; Or maybe the error object itself nicely handles this?

The Error object has a .stack property.  For the added tests it shows:
match@[native code]
test@Source/JavaScriptCore/tests/stress/regress-157595.js:19:23
global code@Source/JavaScriptCore/tests/stress/regress-157595.js:23:9</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1194784</commentid>
    <comment_count>7</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2016-05-19 09:27:07 -0700</bug_when>
    <thetext>JSC consumes terribly much memory during executing this test:
This new Source/JavaScriptCore/tests/stress/regress-157595.js

It made my desktop machine useless for long minutes and swapped.
I tried it on a server machine with huge RAM, it passed after 26
seconds long running and consumed 8Gb memory.

It&apos;s not so good having a test consumes 8Gb memory. :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1194785</commentid>
    <comment_count>8</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2016-05-19 09:33:07 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; JSC consumes terribly much memory during executing this test:
&gt; This new Source/JavaScriptCore/tests/stress/regress-157595.js
&gt; 
&gt; It made my desktop machine useless for long minutes and swapped.
&gt; I tried it on a server machine with huge RAM, it passed after 26
&gt; seconds long running and consumed 8Gb memory.
&gt; 
&gt; It&apos;s not so good having a test consumes 8Gb memory. :(

It does consume 8GB.  That is why I add the &quot;runOneLargeHeap&quot; option in run-jsc-stress-tests and configured it to run that way.  You can use the --memory-limited option when you run the regression tests.

The test is checking that String.prototype.match() doesn&apos;t infinite loop in a corner case.  Just like in the C++ code, we set an upper bound on how many results .match() can return before throwing out of memory.  The test runs till it hits that bound, thus the large memory usage.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1194810</commentid>
    <comment_count>9</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2016-05-19 10:21:43 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; JSC consumes terribly much memory during executing this test:
&gt; &gt; This new Source/JavaScriptCore/tests/stress/regress-157595.js
&gt; &gt; 
&gt; &gt; It made my desktop machine useless for long minutes and swapped.
&gt; &gt; I tried it on a server machine with huge RAM, it passed after 26
&gt; &gt; seconds long running and consumed 8Gb memory.
&gt; &gt; 
&gt; &gt; It&apos;s not so good having a test consumes 8Gb memory. :(
&gt; 
&gt; It does consume 8GB.  That is why I add the &quot;runOneLargeHeap&quot; option in
&gt; run-jsc-stress-tests and configured it to run that way.  You can use the
&gt; --memory-limited option when you run the regression tests.

run-javascriptcore-tests doesn&apos;t have --memory-limited option, only 
run-jsc-stress-tests has. :( And buildbots uses the first script. 

&gt; The test is checking that String.prototype.match() doesn&apos;t infinite loop in
&gt; a corner case.  Just like in the C++ code, we set an upper bound on how many
&gt; results .match() can return before throwing out of memory.  The test runs
&gt; till it hits that bound, thus the large memory usage.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1194845</commentid>
    <comment_count>10</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2016-05-19 11:39:12 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; (In reply to comment #8)
&gt; &gt; (In reply to comment #7)
&gt; &gt; &gt; JSC consumes terribly much memory during executing this test:
&gt; &gt; &gt; This new Source/JavaScriptCore/tests/stress/regress-157595.js
&gt; &gt; &gt; 
&gt; &gt; &gt; It made my desktop machine useless for long minutes and swapped.
&gt; &gt; &gt; I tried it on a server machine with huge RAM, it passed after 26
&gt; &gt; &gt; seconds long running and consumed 8Gb memory.
&gt; &gt; &gt; 
&gt; &gt; &gt; It&apos;s not so good having a test consumes 8Gb memory. :(
&gt; &gt; 
&gt; &gt; It does consume 8GB.  That is why I add the &quot;runOneLargeHeap&quot; option in
&gt; &gt; run-jsc-stress-tests and configured it to run that way.  You can use the
&gt; &gt; --memory-limited option when you run the regression tests.
&gt; 
&gt; run-javascriptcore-tests doesn&apos;t have --memory-limited option, only 
&gt; run-jsc-stress-tests has. :( And buildbots uses the first script. 
&gt; 
&gt; &gt; The test is checking that String.prototype.match() doesn&apos;t infinite loop in
&gt; &gt; a corner case.  Just like in the C++ code, we set an upper bound on how many
&gt; &gt; results .match() can return before throwing out of memory.  The test runs
&gt; &gt; till it hits that bound, thus the large memory usage.

Landed change set r201172 that skips the test.  I filed &lt;https://bugs.webkit.org/show_bug.cgi?id=157903&gt; to track fixing the memory usage.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>279288</attachid>
            <date>2016-05-18 14:54:58 -0700</date>
            <delta_ts>2016-05-18 14:56:39 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>157595.patch</filename>
            <type>text/plain</type>
            <size>4201</size>
            <attacher name="Michael Saboff">msaboff</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMjAxMDg1KQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDI0IEBA
CisyMDE2LTA1LTE4ICBNaWNoYWVsIFNhYm9mZiAgPG1zYWJvZmZAYXBwbGUuY29tPgorCisgICAg
ICAgIHIxOTk4MTIgYnJva2UgdGVzdDI2MgorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9y
Zy9zaG93X2J1Zy5jZ2k/aWQ9MTU3NTk1CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChP
T1BTISk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PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gVG9vbHMvU2NyaXB0cy9ydW4t
anNjLXN0cmVzcy10ZXN0cwkocmV2aXNpb24gMjAxMDg1KQorKysgVG9vbHMvU2NyaXB0cy9ydW4t
anNjLXN0cmVzcy10ZXN0cwkod29ya2luZyBjb3B5KQpAQCAtNzg0LDYgKzc4NCwxNSBAQCBkZWYg
cnVuV2l0aFJBTVNpemUoc2l6ZSkKICAgICBydW4oInJhbS1zaXplLSN7c2l6ZX0iLCAiLS1mb3Jj
ZVJBTVNpemU9I3tzaXplfSIpCiBlbmQKIAorZGVmIHJ1bk9uZUxhcmdlSGVhcAorICAgIGlmICRt
ZW1vcnlMaW1pdGVkCisgICAgICAgICRkaWRBZGRSdW5Db21tYW5kID0gdHJ1ZQorICAgICAgICBw
dXRzICJTa2lwcGluZyAjeyRjb2xsZWN0aW9uTmFtZX0vI3skYmVuY2htYXJrfSIKKyAgICBlbHNl
CisgICAgICAgIHJ1bigiZGVmYXVsdCIpCisgICAgZW5kCitlbmQKKwogZGVmIHJ1bk5vSklUCiAg
ICAgcnVuKCJuby1qaXQiLCAiLS11c2VKSVQ9ZmFsc2UiKQogZW5kCg==
</data>
<flag name="review"
          id="303351"
          type_id="1"
          status="+"
          setter="fpizlo"
    />
          </attachment>
      

    </bug>

</bugzilla>