<?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>163846</bug_id>
          
          <creation_ts>2016-10-22 07:24:01 -0700</creation_ts>
          <short_desc>[GTK] JSC test wasm.yaml/wasm/js-api/test_basic_api.js.default-wasm and wasm.yaml/wasm/js-api/test_Module.js.default-wasm fail with Exception: ReferenceError: Can&apos;t find variable: WebAssembly</short_desc>
          <delta_ts>2016-10-26 14:12: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>JavaScriptCore</component>
          <version>Other</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=163963</see_also>
          <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="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Yusuke Suzuki">ysuzuki</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>jfbastien</cc>
    
    <cc>keith_miller</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>ossy</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1243367</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-10-22 07:24:01 -0700</bug_when>
    <thetext>It looks like this has been broken for a long time. Note that ENABLE_WEBASSEMBLY is still set to OFF for all ports in both WebKitFeatures.cmake and FeatureList.pm:

wasm.yaml/wasm/js-api/test_basic_api.js.default-wasm: Exception: ReferenceError: Can&apos;t find variable: WebAssembly

30747/37492 (failed 1) ............
                                    
wasm.yaml/wasm/js-api/test_basic_api.js.default-wasm: module code@/home/slave/webkitgtk/gtk-linux-64-release-tests/build/WebKitBuild/Release/bin/jsc-stress-results/.tests/wasm.yaml/wasm/js-api/test_basic_api.js:26:28

30747/37492 (failed 1) ............
                                    
wasm.yaml/wasm/js-api/test_basic_api.js.default-wasm: evaluate@[native code]

30747/37492 (failed 1) ............
                                    
wasm.yaml/wasm/js-api/test_basic_api.js.default-wasm: moduleEvaluation@[native code]

30747/37492 (failed 1) ............
                                    
wasm.yaml/wasm/js-api/test_basic_api.js.default-wasm: [native code]

30747/37492 (failed 1) ............
                                    
wasm.yaml/wasm/js-api/test_basic_api.js.default-wasm: promiseReactionJob@[native code]

30747/37492 (failed 1) ............
                                    
wasm.yaml/wasm/js-api/test_basic_api.js.default-wasm: ERROR: Unexpected exit code: 3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1244527</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-10-25 16:41:59 -0700</bug_when>
    <thetext>So I am confused as to how this test is passing on Mac, if WebAssembly is currently disabled everywhere.

If this was a layout test, I would just skip the test. Do we have some mechanism for dealing with this in JS tests? If not, I guess it should be temporarily removed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1244528</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-10-25 16:43:16 -0700</bug_when>
    <thetext>Oh, one more failure now:

30760/37506 ...........
                        
wasm.yaml/wasm/js-api/test_Module.js.default-wasm: Exception: ReferenceError: Can&apos;t find variable: WebAssembly

30760/37506 ...........
                        
wasm.yaml/wasm/js-api/test_Module.js.default-wasm: EmptyModule@/home/slave/webkitgtk/gtk-linux-64-release-tests/build/WebKitBuild/Release/bin/jsc-stress-results/.tests/wasm.yaml/wasm/js-api/test_Module.js:7:35

30760/37506 ...........
                        
wasm.yaml/wasm/js-api/test_Module.js.default-wasm: module code@/home/slave/webkitgtk/gtk-linux-64-release-tests/build/WebKitBuild/Release/bin/jsc-stress-results/.tests/wasm.yaml/wasm/js-api/test_Module.js:9:3

30760/37506 ...........
                        
wasm.yaml/wasm/js-api/test_Module.js.default-wasm: evaluate@[native code]

30760/37506 ...........
                        
wasm.yaml/wasm/js-api/test_Module.js.default-wasm: moduleEvaluation@[native code]

30760/37506 ...........
                        
wasm.yaml/wasm/js-api/test_Module.js.default-wasm: [native code]

30760/37506 ...........
                        
wasm.yaml/wasm/js-api/test_Module.js.default-wasm: promiseReactionJob@[native code]

30760/37506 ...........
30761/37506 .......... 
30761/37506 ..........
                       
wasm.yaml/wasm/js-api/test_basic_api.js.default-wasm: ERROR: Unexpected exit code: 3

30761/37506 ..........
30762/37506 (failed 1) .........
30762/37506 (failed 1) ..........
                                  
wasm.yaml/wasm/js-api/test_Module.js.default-wasm: ERROR: Unexpected exit code: 3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1244541</commentid>
    <comment_count>3</comment_count>
    <who name="JF Bastien">jfbastien</who>
    <bug_when>2016-10-25 16:52:16 -0700</bug_when>
    <thetext>I&apos;m not an expert as how tests work, but I&apos;m guessing the problem came from here:
  https://bugs.webkit.org/attachment.cgi?id=291661

When I added runWebAssembly:
  https://trac.webkit.org/browser/trunk/Tools/Scripts/run-jsc-stress-tests#L1157

Can you confirm that this is the case?
Are the conditions at the top wrong for GTK?

Sorry for asking all these questions, I don&apos;t understand how this all holds together.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1244548</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-10-25 16:59:14 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; I&apos;m not an expert as how tests work, but I&apos;m guessing the problem came from
&gt; here:
&gt;   https://bugs.webkit.org/attachment.cgi?id=291661
&gt; 
&gt; When I added runWebAssembly:
&gt;  
&gt; https://trac.webkit.org/browser/trunk/Tools/Scripts/run-jsc-stress-
&gt; tests#L1157
&gt; 
&gt; Can you confirm that this is the case?

Nope, I honestly don&apos;t know how to check JS test results that far back. :( I&apos;m sure there&apos;s a way....

&gt; Are the conditions at the top wrong for GTK?

They look sane to me.

&gt; Sorry for asking all these questions, I don&apos;t understand how this all holds
&gt; together.

Me either! I think we need to figure out how it is that WebAssembly works at all on the Mac port, then decide if it&apos;s ready to be turned on for other ports or not. If it&apos;s not ready yet, then we should find a way to skip the test conditional on whether or not it&apos;s enabled. 

Alternatively, we could modify the test to pass whenever the WebAssembly variable is not defined, and assume that we would notice if such a major feature accidentally disappeared.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1244561</commentid>
    <comment_count>5</comment_count>
    <who name="JF Bastien">jfbastien</who>
    <bug_when>2016-10-25 17:15:38 -0700</bug_when>
    <thetext>&gt; &gt; Are the conditions at the top wrong for GTK?
&gt; 
&gt; They look sane to me.

Hmm, I don&apos;t think they are:

$isFTLPlatform = !($architecture == &quot;x86&quot; || $architecture == &quot;arm&quot; || $hostOS == &quot;windows&quot; || $hostOS == &quot;linux&quot; &amp;&amp; $architecture == &quot;arm64&quot;)

We&apos;d need a way to see if the platform built with ENABLE(WEBASSEMBLY). I&apos;m not sure how this is done.

&gt; Me either! I think we need to figure out how it is that WebAssembly works at
&gt; all on the Mac port, then decide if it&apos;s ready to be turned on for other
&gt; ports or not. If it&apos;s not ready yet, then we should find a way to skip the
&gt; test conditional on whether or not it&apos;s enabled. 

It&apos;s not ready yet, and we&apos;re only concentrating on Mac bits right now so some of the code will need Linux-isms to work well on Linux. I wouldn&apos;t enable it yet, unless someone is willing to do the Linux work.


&gt; Alternatively, we could modify the test to pass whenever the WebAssembly
&gt; variable is not defined, and assume that we would notice if such a major
&gt; feature accidentally disappeared.

I&apos;d rather not since the entire point is to test that WebAssembly works. It&apos;s unlikely that we&apos;d mess that up, but still it&apos;s not released so nobody would notice.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1244596</commentid>
    <comment_count>6</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2016-10-25 18:42:57 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; &gt; &gt; Are the conditions at the top wrong for GTK?
&gt; &gt; 
&gt; &gt; They look sane to me.
&gt; 
&gt; Hmm, I don&apos;t think they are:
&gt; 
&gt; $isFTLPlatform = !($architecture == &quot;x86&quot; || $architecture == &quot;arm&quot; ||
&gt; $hostOS == &quot;windows&quot; || $hostOS == &quot;linux&quot; &amp;&amp; $architecture == &quot;arm64&quot;)
&gt; 
&gt; We&apos;d need a way to see if the platform built with ENABLE(WEBASSEMBLY). I&apos;m
&gt; not sure how this is done.
&gt; 
&gt; &gt; Me either! I think we need to figure out how it is that WebAssembly works at
&gt; &gt; all on the Mac port, then decide if it&apos;s ready to be turned on for other
&gt; &gt; ports or not. If it&apos;s not ready yet, then we should find a way to skip the
&gt; &gt; test conditional on whether or not it&apos;s enabled. 
&gt; 
&gt; It&apos;s not ready yet, and we&apos;re only concentrating on Mac bits right now so
&gt; some of the code will need Linux-isms to work well on Linux. I wouldn&apos;t
&gt; enable it yet, unless someone is willing to do the Linux work.
&gt; 
&gt; 
&gt; &gt; Alternatively, we could modify the test to pass whenever the WebAssembly
&gt; &gt; variable is not defined, and assume that we would notice if such a major
&gt; &gt; feature accidentally disappeared.
&gt; 
&gt; I&apos;d rather not since the entire point is to test that WebAssembly works.
&gt; It&apos;s unlikely that we&apos;d mess that up, but still it&apos;s not released so nobody
&gt; would notice.

It seems that ENABLE(WEBASSEMBLY) is ON in Mac ports by default, right?
I think adding the following &quot;darwin&quot; check in runWebAssembly is preferable.

if $hostOS == &quot;darwin&quot;

WEBASSEMBLY flag can be enabled even if it is still under the development, and actually it seems that it is enabled in Mac ports.
Why we can do that safely is there is runtime flag Options::useWebAssembly(). It prevents us from exposing the implementation under the heavy development.

Basically, we can enable WEBASSEMBLY flag.
The reason why we would like to disable this in Linux port is we have a part only focusing on Darwin right now.
So, the reasonable choice is disabling the tests based on the $hostOS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1244600</commentid>
    <comment_count>7</comment_count>
      <attachid>292863</attachid>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2016-10-25 18:56:37 -0700</bug_when>
    <thetext>Created attachment 292863
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1244601</commentid>
    <comment_count>8</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2016-10-25 18:58:44 -0700</bug_when>
    <thetext>BTW, still the problem occurs in GTK port on Darwin.
But I think we have a chance to enable it on Darwin.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1244604</commentid>
    <comment_count>9</comment_count>
      <attachid>292863</attachid>
    <who name="JF Bastien">jfbastien</who>
    <bug_when>2016-10-25 19:16:39 -0700</bug_when>
    <thetext>Comment on attachment 292863
Patch

Looks good, though I think we should file a bug to remove this on Linux (and link to it from the comment). Thanks for looking into it, I wasn&apos;t sure what the best fix was :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1244855</commentid>
    <comment_count>10</comment_count>
      <attachid>292863</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-10-26 11:33:57 -0700</bug_when>
    <thetext>Comment on attachment 292863
Patch

OK it looks sane, thanks.

We don&apos;t have any GTK tests bots running Darwin so I don&apos;t really care toooo much if it&apos;s still broken on that platform, but indeed WebAssembly would not be available there either, so testing the port would make more sense than testing the OS, right?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1244863</commentid>
    <comment_count>11</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2016-10-26 11:54:03 -0700</bug_when>
    <thetext>(In reply to comment #10)
&gt; Comment on attachment 292863 [details]
&gt; Patch
&gt; 
&gt; OK it looks sane, thanks.
&gt; 
&gt; We don&apos;t have any GTK tests bots running Darwin so I don&apos;t really care toooo
&gt; much if it&apos;s still broken on that platform, but indeed WebAssembly would not
&gt; be available there either, so testing the port would make more sense than
&gt; testing the OS, right?

(In reply to comment #10)
&gt; Comment on attachment 292863 [details]
&gt; Patch
&gt; 
&gt; OK it looks sane, thanks.
&gt; 
&gt; We don&apos;t have any GTK tests bots running Darwin so I don&apos;t really care toooo
&gt; much if it&apos;s still broken on that platform, but indeed WebAssembly would not
&gt; be available there either, so testing the port would make more sense than
&gt; testing the OS, right?

Yeah, I think theoretically we can. But, in reality, I think it constantly causes some build/runtime errors until the implementation becomes ready to be ported.

Anyway, this should be a transient workaround. As JF suggested, I&apos;ll open a bug and note this in FIXME.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1244896</commentid>
    <comment_count>12</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2016-10-26 14:12:35 -0700</bug_when>
    <thetext>Committed r207913: &lt;http://trac.webkit.org/changeset/207913&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>292863</attachid>
            <date>2016-10-25 18:56:37 -0700</date>
            <delta_ts>2016-10-26 11:33:57 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-163846-20161026105250.patch</filename>
            <type>text/plain</type>
            <size>1545</size>
            <attacher name="Yusuke Suzuki">ysuzuki</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjA3ODU4CmRpZmYgLS1naXQgYS9Ub29scy9DaGFuZ2VMb2cg
Yi9Ub29scy9DaGFuZ2VMb2cKaW5kZXggMTkzMGVjZGJiMDc5NGQ4ZDFjMWE1YjY0NjQ4MDZlOTJm
MjliZGI2MC4uYTk0YzVjYmIyOWE5MGJiYjFlNWI4ZjA2ODg2ZDMyNzU4ODdmNDVkZiAxMDA2NDQK
LS0tIGEvVG9vbHMvQ2hh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JhZDM0ZDJmYy4uMWZhZmU5YzgzNjI2NzVmZTk2NTgzYWQ2NmYzNWM5MmYz
ZjEyZDE4ZSAxMDA3NTUKLS0tIGEvVG9vbHMvU2NyaXB0cy9ydW4tanNjLXN0cmVzcy10ZXN0cwor
KysgYi9Ub29scy9TY3JpcHRzL3J1bi1qc2Mtc3RyZXNzLXRlc3RzCkBAIC0xMTU3LDYgKzExNTcs
NyBAQCBlbmQKIGRlZiBydW5XZWJBc3NlbWJseQogICAgIHJldHVybiBpZiAhJGppdFRlc3RzCiAg
ICAgcmV0dXJuIGlmICEkaXNGVExQbGF0Zm9ybQorICAgIHJldHVybiBpZiAkaG9zdE9TICE9ICJk
YXJ3aW4iICMgVGhlIGN1cnJlbnQgV2ViQXNzZW1ibHkgaW1wbGVtZW50YXRpb24gaW5jbHVkZXMg
RGFyd2luIHNwZWNpZmljIHRoaW5ncy4KICAgICBtb2R1bGVzID0gRGlyW1dBU01URVNUU19QQVRI
ICsgIiouanMiXS5tYXAgeyB8ZnwgRmlsZS5iYXNlbmFtZShmKSB9CiAgICAgcHJlcGFyZUV4dHJh
QWJzb2x1dGVGaWxlcyhXQVNNVEVTVFNfUEFUSCwgWyJ3YXNtLmpzb24iXSkKICAgICBwcmVwYXJl
RXh0cmFSZWxhdGl2ZUZpbGVzKG1vZHVsZXMubWFwIHsgfGZ8ICIuLi8iICsgZiB9LCAkY29sbGVj
dGlvbikK
</data>
<flag name="review"
          id="315847"
          type_id="1"
          status="+"
          setter="mcatanzaro"
    />
          </attachment>
      

    </bug>

</bugzilla>