<?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>175100</bug_id>
          
          <creation_ts>2017-08-02 16:58:23 -0700</creation_ts>
          <short_desc>[Linux] JSTests/wasm/stress/oom.js should not run on Linux</short_desc>
          <delta_ts>2017-08-03 10:41:35 -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>Tools / Tests</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=175140</see_also>
          <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="Carlos Alberto Lopez Perez">clopez</reporter>
          <assigned_to name="Carlos Alberto Lopez Perez">clopez</assigned_to>
          <cc>aperez</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>fpizlo</cc>
    
    <cc>gustavo</cc>
    
    <cc>jfbastien</cc>
    
    <cc>lforschler</cc>
    
    <cc>mark.lam</cc>
    
    <cc>ossy</cc>
    
    <cc>saam</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
    
    <cc>zan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1334493</commentid>
    <comment_count>0</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2017-08-02 16:58:23 -0700</bug_when>
    <thetext>The JSC test JSTests/wasm/stress/oom.js seems to be specifically designed to try to use all the available memory until an out of memory exception happens.

Trying to do something like that on Linux is not fine, as Linux handles very badly out of memory situations. In the best case the system will freeze during several seconds and in the worst case it may be several minutes until it starts responding back.

We should try to avoid running tests like this on Linux.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1334502</commentid>
    <comment_count>1</comment_count>
      <attachid>317035</attachid>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2017-08-02 17:06:22 -0700</bug_when>
    <thetext>Created attachment 317035
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1334505</commentid>
    <comment_count>2</comment_count>
      <attachid>317035</attachid>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2017-08-02 17:13:34 -0700</bug_when>
    <thetext>Comment on attachment 317035
Patch

r=me.  Please add your rationale for why this change is needed in the ChangeLog.  Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1334520</commentid>
    <comment_count>3</comment_count>
    <who name="JF Bastien">jfbastien</who>
    <bug_when>2017-08-02 17:34:20 -0700</bug_when>
    <thetext>I don’t think this is the right fix. Can you instead run under ulimit ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1334523</commentid>
    <comment_count>4</comment_count>
      <attachid>317035</attachid>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2017-08-02 17:35:57 -0700</bug_when>
    <thetext>Comment on attachment 317035
Patch

r=me too.  I know that you elaborated in the bugzilla comment, but it would be even nicer if the ChangeLog also contained the text about why this test doesn&apos;t make sense on Linux.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1334524</commentid>
    <comment_count>5</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2017-08-02 17:37:19 -0700</bug_when>
    <thetext>(In reply to JF Bastien from comment #3)
&gt; I don’t think this is the right fix. Can you instead run under ulimit ?

I think it&apos;s more pragmatic to just do this fix.  We&apos;re always open to ports skipping tests without much fuss.  In particular, I would have even been OK with Carlos landing this change without review, since test gardening technically does not need review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1334564</commentid>
    <comment_count>6</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2017-08-02 18:36:08 -0700</bug_when>
    <thetext>(In reply to JF Bastien from comment #3)
&gt; I don’t think this is the right fix. Can you instead run under ulimit ?

ulimit is pretty broken on Linux, as limiting by rss (ulimit -m) doesn&apos;t work at all on Linux (since kernels 2.4.x) and limiting by vsize (ulimit -v ) requires some hard-to-get-right ad-hoc knowledge about how much virtual size is acceptable for a process to allocate.

For example, this test is allocating ~15GB of RSS and ~57GB of VSZ before giving the out of memory error on a Linux machine with 16GB of RAM. So, how should I know that I should set an ulimit on 57GB other than by try and error? Playing with limiting the vsize seems a bit fragile to me.

The only thing that I know works ok on Linux for limiting memory usage are cgroups. But cgroups are meant to limit the memory usage of a group of process (its usually used with containers). They are not really meant to limit the memory usage of a single process like we would like to do in this case.

There is also the issue that this problem will not only trigger on the bots, but also on the developers machines. Any WebKit Linux developer trying to run this test will likely run into desktop freezes.


I&apos;m seizing this to comment also about a related issue at https://bugs.webkit.org/show_bug.cgi?id=171630#c11 where I observed that WebKit/JSC is pretty unique in the sense that we allow a script to use all possible RAM of the system. Other JS engines seem to limit this value to some sane amount (like 4 GBs). I see how on MacOS allow this is not a problem as the Mac kernel seems to handle fine this situations, but on Linux we run into problems when this happens.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1334566</commentid>
    <comment_count>7</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2017-08-02 18:42:23 -0700</bug_when>
    <thetext>Committed r220173: &lt;http://trac.webkit.org/changeset/220173&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1334567</commentid>
    <comment_count>8</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2017-08-02 18:43:30 -0700</bug_when>
    <thetext>&lt;rdar://problem/33691382&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1334583</commentid>
    <comment_count>9</comment_count>
    <who name="JF Bastien">jfbastien</who>
    <bug_when>2017-08-02 19:08:25 -0700</bug_when>
    <thetext>(In reply to Carlos Alberto Lopez Perez from comment #6)
&gt; (In reply to JF Bastien from comment #3)
&gt; &gt; I don’t think this is the right fix. Can you instead run under ulimit ?
&gt; 
&gt; ulimit is pretty broken on Linux, as limiting by rss (ulimit -m) doesn&apos;t
&gt; work at all on Linux (since kernels 2.4.x) and limiting by vsize (ulimit -v
&gt; ) requires some hard-to-get-right ad-hoc knowledge about how much virtual
&gt; size is acceptable for a process to allocate.
&gt; 
&gt; For example, this test is allocating ~15GB of RSS and ~57GB of VSZ before
&gt; giving the out of memory error on a Linux machine with 16GB of RAM. So, how
&gt; should I know that I should set an ulimit on 57GB other than by try and
&gt; error? Playing with limiting the vsize seems a bit fragile to me.

The test just tries to run out. Doesn’t matter at how much memory. 

&gt; The only thing that I know works ok on Linux for limiting memory usage are
&gt; cgroups. But cgroups are meant to limit the memory usage of a group of
&gt; process (its usually used with containers). They are not really meant to
&gt; limit the memory usage of a single process like we would like to do in this
&gt; case.
&gt; 
&gt; There is also the issue that this problem will not only trigger on the bots,
&gt; but also on the developers machines. Any WebKit Linux developer trying to
&gt; run this test will likely run into desktop freezes.
&gt; 
&gt; 
&gt; I&apos;m seizing this to comment also about a related issue at
&gt; https://bugs.webkit.org/show_bug.cgi?id=171630#c11 where I observed that
&gt; WebKit/JSC is pretty unique in the sense that we allow a script to use all
&gt; possible RAM of the system. Other JS engines seem to limit this value to
&gt; some sane amount (like 4 GBs). I see how on MacOS allow this is not a
&gt; problem as the Mac kernel seems to handle fine this situations, but on Linux
&gt; we run into problems when this happens.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>317035</attachid>
            <date>2017-08-02 17:06:22 -0700</date>
            <delta_ts>2017-08-02 17:13:34 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-175100-20170803020621.patch</filename>
            <type>text/plain</type>
            <size>1050</size>
            <attacher name="Carlos Alberto Lopez Perez">clopez</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjIwMTYwCmRpZmYgLS1naXQgYS9KU1Rlc3RzL0NoYW5nZUxv
ZyBiL0pTVGVzdHMvQ2hhbmdlTG9nCmluZGV4IDk3ZThjNTFjMTVmYmUyNjRkOTMzZDZhZDliYTkz
ODgyNDM5NWVhY2UuLjYyMmE3MWUyNzlkNGUyOGQ3NGU4YmU2NzJlMGEzZjQyODZiMmYxYTAgMTAw
NjQ0Ci0tLSBhL0pTVGVzdHMvQ2hhbmdlTG9nCisrKyBiL0pTVGVzdHMvQ2hhbmdlTG9nCkBAIC0x
LDMgKzEsMTIgQEAKKzIwMTctMDgtMDIgIENhcmxvcyBBbGJlcnRvIExvcGV6IFBlcmV6ICA8Y2xv
cGV6QGlnYWxpYS5jb20+CisKKyAgICAgICAgW0xpbnV4XSBKU1Rlc3RzL3dhc20vc3RyZXNzL29v
bS5qcyBzaG91bGQgbm90IHJ1biBvbiBMaW51eAorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0
Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTc1MTAwCisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZ
IChPT1BTISkuCisKKyAgICAgICAgKiB3YXNtL3N0cmVzcy9vb20uanM6CisKIDIwMTctMDgtMDEg
IE9sZWtzYW5kciBTa2FjaGtvdiAgPGdza2FjaGtvdkBnbWFpbC5jb20+CiAKICAgICAgICAgW0pT
Q10gUmVtb3ZlIHVubmVjZXNzYXJ5IHByaW50IGZyb20gc3RyZXNzXHByb21pc2UtZmluYWxseS5q
cyB0ZXN0CmRpZmYgLS1naXQgYS9KU1Rlc3RzL3dhc20vc3RyZXNzL29vbS5qcyBiL0pTVGVzdHMv
d2FzbS9zdHJlc3Mvb29tLmpzCmluZGV4IDA3NmVhNzYwMzM5ZDc0MzM3ZDJmYzIyMDRlN2M4OTQ4
Y2FhZGQ1MmQuLjZjNjc1YWJhMjYyYzk2ZjMxMmNjZWIwZDUyNTQwZjI0MmRkZDJlZDkgMTAwNjQ0
Ci0tLSBhL0pTVGVzdHMvd2FzbS9zdHJlc3Mvb29tLmpzCisrKyBiL0pTVGVzdHMvd2FzbS9zdHJl
c3Mvb29tLmpzCkBAIC0xLDUgKzEsNSBAQAogLy8gV2UgZG9uJ3QgbmVlZCBOIHZlcnNpb25zIG9m
IHRoaXMgc2ltdWx0YW5lb3VzbHkgZmlsbGluZyB1cCBSQU0uCi0vL0AgcnVuRGVmYXVsdAorLy9A
IGlmICRob3N0T1MgPT0gImxpbnV4IiB0aGVuIHNraXAgZWxzZSBydW5EZWZhdWx0IGVuZAogCiBj
b25zdCB2ZXJib3NlID0gZmFsc2U7CiAK
</data>
<flag name="review"
          id="337632"
          type_id="1"
          status="+"
          setter="mark.lam"
    />
    <flag name="commit-queue"
          id="337633"
          type_id="3"
          status="-"
          setter="mark.lam"
    />
          </attachment>
      

    </bug>

</bugzilla>