<?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>181781</bug_id>
          
          <creation_ts>2018-01-17 20:42:07 -0800</creation_ts>
          <short_desc>iOS 11.2.2 and 11.2.5b6 WebAssembly regression (error or hang)</short_desc>
          <delta_ts>2018-03-26 21:05:46 -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>WebAssembly</component>
          <version>Safari 11</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 11</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brooke Vibber">bvibber</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ashley</cc>
    
    <cc>fpizlo</cc>
    
    <cc>hello</cc>
    
    <cc>jfbastien</cc>
    
    <cc>keith_miller</cc>
    
    <cc>mark.lam</cc>
    
    <cc>msaboff</cc>
    
    <cc>rmorisset</cc>
    
    <cc>saam</cc>
    
    <cc>shader.yang</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1390383</commentid>
    <comment_count>0</comment_count>
    <who name="Brooke Vibber">bvibber</who>
    <bug_when>2018-01-17 20:42:07 -0800</bug_when>
    <thetext>At Wikipedia we use an emscripten-based decoder in Safari for some video and audio formats, and are looking at deploying a WebAssembly build for both desktop and mobile.

In iOS 11.2.2 there&apos;s a major regression in wasm which breaks things with &quot;out of bounds memory access&quot; errors, which I believe is rdar:://problem/36236004 and supposed to be fixed; however the latest version I can test is iOS 11.2.5beta 6, where instead of emitting an error the entire web content process hangs without emitting any console messages.

Sample using asm.js build:
* https://brionv.com/misc/ogv.js/demo/#player=js
^ works

Sample using wasm build:
* https://brionv.com/misc/ogv.js/demo/#player=wasm
^ errors out on 11.2.2, hangs on 11.2.5b6

The hang comes during initialization or early execution, making it tricky to connect with the Safari remote debugger.

Downstream issues:
* https://phabricator.wikimedia.org/T179108
* https://github.com/brion/ogv.js/issues/485
* https://github.com/kripken/emscripten/issues/6042</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1390644</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-01-18 13:17:44 -0800</bug_when>
    <thetext>&lt;rdar://problem/36631309&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1391959</commentid>
    <comment_count>2</comment_count>
    <who name="Brooke Vibber">bvibber</who>
    <bug_when>2018-01-22 20:16:48 -0800</bug_when>
    <thetext>11.2.5 beta 7 on iPad Pro 9.7&quot; no longer seems to hang the web content process; I get the original out of bounds memory access error, now caught by surrounding code and logged internally as opposed to outputting direct to console:

[Log] [3395ms] i/o error: Error: Out of bounds memory access (evaluating &apos;Module[&quot;asm&quot;][&quot;_ogv_demuxer_receive_input&quot;].apply(null,arguments)&apos;) (ogv.js, line 1005)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1392445</commentid>
    <comment_count>3</comment_count>
    <who name="Brooke Vibber">bvibber</who>
    <bug_when>2018-01-23 22:54:28 -0800</bug_when>
    <thetext>I&apos;ve identified a smaller test case which I&apos;ve posted at https://github.com/brion/min-wasm-fail

Does an i32.store of a value at index 4 and reads it back -- on iOS I get 0 instead of the expected value. (At index 0, we get the expected value back.)

The actual out of bounds exception in emscripten&apos;d code seems to be a side effect of failing to load/store correctly, so pointers get screwed up and something ends up trying to access outside of mem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1392833</commentid>
    <comment_count>4</comment_count>
    <who name="Brooke Vibber">bvibber</who>
    <bug_when>2018-01-24 16:30:47 -0800</bug_when>
    <thetext>Confirmed resolved in iOS 11.3 beta 1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1394107</commentid>
    <comment_count>5</comment_count>
    <who name="JF Bastien">jfbastien</who>
    <bug_when>2018-01-29 08:53:21 -0800</bug_when>
    <thetext>*** Bug 181598 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1394108</commentid>
    <comment_count>6</comment_count>
    <who name="Ashley Gullen">ashley</who>
    <bug_when>2018-01-29 08:59:03 -0800</bug_when>
    <thetext>For those of us who can&apos;t see rdar links, is there any news on this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1394110</commentid>
    <comment_count>7</comment_count>
    <who name="Brooke Vibber">bvibber</who>
    <bug_when>2018-01-29 09:16:15 -0800</bug_when>
    <thetext>(In reply to Ashley Gullen from comment #6)
&gt; For those of us who can&apos;t see rdar links, is there any news on this?

Bug is resolved in iOS 11.3 betas; presumably the fix won&apos;t reach the public until 11.3 is complete, so for now people will need to detect the bug and either throw a user-visible error or switch to an asm.js build. I&apos;ve created a small test case at https://github.com/brion/min-wasm-fail/blob/master/min-wasm-fail.js which can be used to check at runtime whether the bug is present, which I&apos;ve integrated into my project. Please feel free to copy that test case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1394124</commentid>
    <comment_count>8</comment_count>
    <who name="Ashley Gullen">ashley</who>
    <bug_when>2018-01-29 09:54:26 -0800</bug_when>
    <thetext>OK, thanks. Is there any indication when 11.3 is due out? We can hack in a workaround but it won&apos;t fix all the content that&apos;s already been deployed with our software. I can&apos;t believe that a key web technology is completely broken and it&apos;s being left like that!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1394129</commentid>
    <comment_count>9</comment_count>
    <who name="Brooke Vibber">bvibber</who>
    <bug_when>2018-01-29 10:02:14 -0800</bug_when>
    <thetext>I&apos;m sure the Apple folks can&apos;t comment on that, but what indications I have seen in public are &quot;spring&quot; which could mean anywhere from March to May of this year. I would love an earlier fix on the 11.2.x branch too, but I know engineering scheduling is a hard problem...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1394130</commentid>
    <comment_count>10</comment_count>
    <who name="Ashley Gullen">ashley</who>
    <bug_when>2018-01-29 10:05:28 -0800</bug_when>
    <thetext>Wow. Okay. Seriously, it would have been better to simply turn off WebAssembly, so existing fallbacks to asm.js are activated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1400721</commentid>
    <comment_count>11</comment_count>
    <who name="Ashley Gullen">ashley</who>
    <bug_when>2018-02-20 04:38:38 -0800</bug_when>
    <thetext>WebAssembly is still enabled, and non-functional, on iOS 11.2.6.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1409474</commentid>
    <comment_count>12</comment_count>
    <who name="">shader.yang</who>
    <bug_when>2018-03-26 21:05:46 -0700</bug_when>
    <thetext>I think there is no fundamental improvement for this issue, because I have tested it on all kinds of iOS version from 11.0.1 to 11.3 b6, only 11.2.1 can work well so far, I have submitted related issues but the issues&apos; status all are &quot;NEW&quot;.

Please refer to:
https://bugs.webkit.org/show_bug.cgi?id=181723
https://bugs.webkit.org/show_bug.cgi?id=183101
https://github.com/kripken/emscripten/issues/6042
https://forum.unity.com/threads/webgl-builds-crash-issue-on-ios-browsers-unity3d.518240/

I think apple/webkit should face this issue seriously and fix it ASAP, this issue should be reopened.

Thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>