<?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>185608</bug_id>
          
          <creation_ts>2018-05-14 03:54:18 -0700</creation_ts>
          <short_desc>REGRESSION (iOS 11.3) Crash on windy.com, and in the Windy app (jetsam?)</short_desc>
          <delta_ts>2019-09-24 03:35:36 -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>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>https://www.windy.com</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tomas Slavkovsky">tomas.slavkovsky</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>dino</cc>
    
    <cc>jonlee</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>tomas.slavkovsky</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1423557</commentid>
    <comment_count>0</comment_count>
    <who name="Tomas Slavkovsky">tomas.slavkovsky</who>
    <bug_when>2018-05-14 03:54:18 -0700</bug_when>
    <thetext>After upgrade of WebKit in iOS 11.3 &amp; 11.3.1 Safari and webView in our Apache Cordova app started to crash. The crash occurs in iPhone on this URL [1] and also on the page inside the Cordova App [3].

Part of the JS that renders this component uses safe and old prooven ES5 only Javascript and uses canvas to render two big retina graphs.

When we connect iPhone Safari to remote debugger the bug does not occur. Standalone iPhone crashes on most of the occasions.

We are not 100% sure that bug is related to Canvas element or JS around it, but we suspect Canvas.

On a thread in our community forum [2] you can find a screen video of the bug. 

How to reproduce the bug:
1. On your iPhone in Safari open www.windy.com or app Windy [3]
2. Go to the menu (yellow three dots) and on the top of the menu click on “Find my location”
3. On picker in the map click to open the detail forecast
4. In detail forecast click airgram
5. In standard behavior, it will open airgram. However, now it stays in the loop and it is trying to open the page again and again. 



[1] https://www.windy.com/
[2] https://community.windy.com/topic/5780/ios-airgram-malfuction-on-iphone-ipad
[3] https://itunes.apple.com/cz/app/windy-wind-and-waves-forecast/id1161387262</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1423995</commentid>
    <comment_count>1</comment_count>
    <who name="Tomas Slavkovsky">tomas.slavkovsky</who>
    <bug_when>2018-05-15 04:43:49 -0700</bug_when>
    <thetext>We found where it fails. It is on entry into the imageData field. Everytime it fails on a different place. Image has size 500x2000px.

Here is the code:

var w = nx * sx
            , imageData = ctx.createImageData( w, h )
            , data = imageData.data

            var p = 0
            , len = ( data.length - 4 ) // last item

            for( j = 0; j &lt; h; j++ ) {

                if(p &gt;= len) break

                for( i = 0; i &lt; w; i++ ) {

                    if(p &gt;= len) break

                    o = j * w + i

                    var br = 1.0

                    if( (j &gt; 0) &amp;&amp; (j &lt; (h - 1)) &amp;&amp; (i &gt; 0) &amp;&amp; (i &lt; w - 1) ) {
                        br = this.edge( dst, w, o )
                    }

                    var rgb = this.steps_[ dst[o] ] || [0, 0, 0]

                    if( br &lt; 0.99 ) {
                        data[p++] = Math.round(rgb[0] * br)
                        data[p++] = Math.round(rgb[1] * br)
                        data[p++] = Math.round(rgb[2] * br)
                    }
                    else if( br &gt; 2.0 ) {
                        data[p++] = Math.min(rgb[0] + br, 255)
                        data[p++] = Math.min(rgb[1] + br, 255)
                        data[p++] = Math.min(rgb[2] + br, 255)
                    }
                    else {
                        data[p++] = rgb[0]
                        data[p++] = rgb[1]
                        data[p++] = rgb[2]
                    }
                    data[p++] = 255;

                }

            }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1424014</commentid>
    <comment_count>2</comment_count>
    <who name="Tomas Slavkovsky">tomas.slavkovsky</who>
    <bug_when>2018-05-15 07:55:33 -0700</bug_when>
    <thetext>This is what xCode writes when it crash:

2018-05-14 18:56:10.293185+0200 Windy[904:179798] [ProcessSuspension]  0x1c0c6d180 - ProcessAssertion() Unable to acquire assertion for process with PID 0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1424026</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-05-15 08:59:56 -0700</bug_when>
    <thetext>&lt;rdar://problem/40257897&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1424343</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-05-16 09:24:56 -0700</bug_when>
    <thetext>Do you have any crash logs?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1425061</commentid>
    <comment_count>5</comment_count>
    <who name="Tomas Slavkovsky">tomas.slavkovsky</who>
    <bug_when>2018-05-17 23:02:01 -0700</bug_when>
    <thetext>Unfortunately, not. When you connect it to xcode it works fine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1425070</commentid>
    <comment_count>6</comment_count>
    <who name="Tomas Slavkovsky">tomas.slavkovsky</who>
    <bug_when>2018-05-18 00:51:06 -0700</bug_when>
    <thetext>This is the code [1] where it crashes, see the line 287.

[1] https://gist.github.com/ilblog/11863f97f25a4c2478649f5b618fcc16</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1425123</commentid>
    <comment_count>7</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-05-18 08:39:51 -0700</bug_when>
    <thetext>I think this is probably your process getting killed because it uses too much memory. If you use the Layers panel in the web inspector, you can see that your page uses about 122MB of layer memory in steady state, spiking up to 150MB on interaction. This is really high.

You need to reduce the number of elements on which you apply -webkit-backface-visibility: hidden; and translate3d().

BTW,  -webkit-backface-visibility: hidden; doesn&apos;t really do anything any more unless you&apos;re really doing 3D.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1425589</commentid>
    <comment_count>8</comment_count>
    <who name="Tomas Slavkovsky">tomas.slavkovsky</who>
    <bug_when>2018-05-20 23:46:08 -0700</bug_when>
    <thetext>As suggested, we have reduced the number of elements applying -WebKit-backface-visibility: hidden; and translate3d(). However, the airgram is still not working.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1425711</commentid>
    <comment_count>9</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-05-21 10:57:41 -0700</bug_when>
    <thetext>By &quot;airgram&quot; you mean the main canvas showing the wind?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1425728</commentid>
    <comment_count>10</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-05-21 11:24:32 -0700</bug_when>
    <thetext>Nm, I found the Airgram page.

You&apos;re still using too much layer memory here. With the Airgram screen open, you have 145MB of layer memory. Here are some debugging tips:
https://webkit.org/blog/6425/memory-debugging-with-web-inspector/
https://webkit.org/blog/8262/visualizing-layers-in-web-inspector/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1426066</commentid>
    <comment_count>11</comment_count>
    <who name="Tomas Slavkovsky">tomas.slavkovsky</who>
    <bug_when>2018-05-22 01:04:00 -0700</bug_when>
    <thetext>We have reduced the number of elements and tested it on a test internal server. The result is the same. It&apos;s broken something else, so we cannot push it to the production.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1426076</commentid>
    <comment_count>12</comment_count>
    <who name="Tomas Slavkovsky">tomas.slavkovsky</who>
    <bug_when>2018-05-22 01:56:38 -0700</bug_when>
    <thetext>In our opinion the problem is somewhere in the JIT compiler.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1426162</commentid>
    <comment_count>13</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-05-22 08:29:28 -0700</bug_when>
    <thetext>What specific iOS device and OS version are you testing on?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1426202</commentid>
    <comment_count>14</comment_count>
    <who name="Tomas Slavkovsky">tomas.slavkovsky</who>
    <bug_when>2018-05-22 11:00:14 -0700</bug_when>
    <thetext>the bug started occurring after the release of the iOS 11.3. We are experiencing it on iPhone SE, iPhone 6S and iOS 11.3.1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1426640</commentid>
    <comment_count>15</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-05-23 10:48:28 -0700</bug_when>
    <thetext>I have reproduced, and I agree that it looks like a JIT bug. The crash looks like:

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   ???                           	0x0000000edb98beb4 0 + 63813762740
1   ???                           	0x0000000edbad9054 0 + 63815127124
2   JavaScriptCore                	0x0000000188c7bd20 llint_entry + 29232
3   JavaScriptCore                	0x0000000188c7bd20 llint_entry + 29232
4   JavaScriptCore                	0x0000000188c7bd20 llint_entry + 29232
5   ???                           	0x0000000edb9def6c 0 + 63814102892
6   JavaScriptCore                	0x0000000188c74920 vmEntryToJavaScript + 272
7   JavaScriptCore                	0x0000000189237e98 JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 184
8   JavaScriptCore                	0x0000000188b7db50 JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&amp;, JSC::JSValue, JSC::ArgList const&amp;) + 464
9   JavaScriptCore                	0x000000018935fc2c JSC::profiledCall(JSC::ExecState*, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&amp;, JSC::JSValue, JSC::ArgList const&amp;) + 168
10  JavaScriptCore                	0x0000000189415aa8 JSC::JSJobMicrotask::run(JSC::ExecState*) + 488
11  WebCore                       	0x000000018ab49dd0 WebCore::JSDOMWindowMicrotaskCallback::call() + 152</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1427386</commentid>
    <comment_count>16</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-05-25 12:01:49 -0700</bug_when>
    <thetext>This crash appears to be fixed on trunk. We&apos;ll let you know when there&apos;s an iOS beta you can test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1573617</commentid>
    <comment_count>17</comment_count>
    <who name="Tomas Slavkovsky">tomas.slavkovsky</who>
    <bug_when>2019-09-24 03:35:36 -0700</bug_when>
    <thetext>This bug was fixed by the release of the next iOS version. You can close it now. Thanks</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>