<?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>231157</bug_id>
          
          <creation_ts>2021-10-04 01:37:16 -0700</creation_ts>
          <short_desc>Safari crashes when GPU Process: Canvas Rendering is enabled with large paths</short_desc>
          <delta_ts>2022-02-15 05:20:12 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Canvas</component>
          <version>Safari 15</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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>timocov</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bdon</cc>
    
    <cc>bfulgham</cc>
    
    <cc>dino</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1799990</commentid>
    <comment_count>0</comment_count>
      <attachid>440038</attachid>
    <who name="">timocov</who>
    <bug_when>2021-10-04 01:37:16 -0700</bug_when>
    <thetext>Created attachment 440038
The page you need to open to get a safari crashed

0. It seems that since iOS v15 the option &quot;GPU Process: Canvas Rendering&quot; is enabled by default, but if it is disabled, go to setting and enable it explicitly
1. Open the page https://bl.ocks.org/timocov/raw/648966ce5c57492e82864b4d78a7c1cb/?raw=true (the same page in attachments or here https://gist.github.com/timocov/648966ce5c57492e82864b4d78a7c1cb)
2. Wait some time until the page is crashed

If you disable this page, everything will be good and no page crash.

On iOS 15.1 the issue still persist.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1800123</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2021-10-04 10:48:43 -0700</bug_when>
    <thetext>I can reproduce, getting this:

Requesting termination of web process 1779 for reason: &quot;Detected invalid display list item or extent&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1800124</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-10-04 10:49:22 -0700</bug_when>
    <thetext>&lt;rdar://problem/83842976&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1801561</commentid>
    <comment_count>3</comment_count>
    <who name="">timocov</who>
    <bug_when>2021-10-07 04:16:26 -0700</bug_when>
    <thetext>Is it possible to disable this feature from iOS app somehow? We have a lot of users which are facing this issue in our app continuously and most likely the issue is not with what we render there. We’re continue getting negative reviews in the store because of that. Or maybe disable this feature in the following patch-release until all issues regarding this will be fixed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1803666</commentid>
    <comment_count>4</comment_count>
    <who name="Brandon Liu">bdon</who>
    <bug_when>2021-10-13 00:44:24 -0700</bug_when>
    <thetext>Hi,

Thanks for creating this example page. I was able to modify it to be more specific, please see these links to 8 different test cases:

https://bdon.github.io/protomaps-experiments/safari15/

JavaScript code is here: https://github.com/bdon/protomaps-experiments/tree/master/safari15

In each frame it does 2 things:
1. it strokes or fills a path with N subpaths, where N can be controlled by the URL query parameter “count”. The subpaths are each a filled circle, a stroked line with 2 vertices, a triangle or a quad. 
2. It fillRects 1000 times with random height. This # of 1000 does not seem to matter.

For each case, there is an exact value of the # of subpaths N at which the hanging/crash will reproduce immediately; below this # there is no issue.

For arc filling, it hangs at 400 arcs
For line drawing, it hangs at 2728 lines
For triangles, it hangs at 1819 triangles
For quads, it hangs at 1364 quads

It seems like exactly 5,456 vertices in a single path draw call is causing the crash. If the 2nd part, 1000 fillRects, is left out, it also works fine. 

I can reproduce this perfectly on 3 devices of varying specs: x86 MacBook, iPhone XS and iPad Air 2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1809956</commentid>
    <comment_count>5</comment_count>
    <who name="Cameron McCormack (:heycam)">heycam</who>
    <bug_when>2021-10-28 21:22:08 -0700</bug_when>
    <thetext>*** Bug 230751 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1833020</commentid>
    <comment_count>6</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2022-01-22 10:35:12 -0800</bug_when>
    <thetext>This is fixed on trunk, after r284079.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1839008</commentid>
    <comment_count>7</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2022-02-08 21:09:29 -0800</bug_when>
    <thetext>This change should be present in STP 139, iOS 15.4 Beta, and macOS 12.3 Beta.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1841662</commentid>
    <comment_count>8</comment_count>
    <who name="Brandon Liu">bdon</who>
    <bug_when>2022-02-15 05:20:12 -0800</bug_when>
    <thetext>Confirming that STP 139+ resolves this for us in both isolated test case and real-world application. Thank you WebKit team!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>440038</attachid>
            <date>2021-10-04 01:37:16 -0700</date>
            <delta_ts>2021-10-04 01:37:16 -0700</delta_ts>
            <desc>The page you need to open to get a safari crashed</desc>
            <filename>safari-crash.html</filename>
            <type>text/html</type>
            <size>1368</size>
            <attacher>timocov</attacher>
            
              <data encoding="base64">PGh0bWw+Cgk8aGVhZD4KCQk8c2NyaXB0IGxhbmd1YWdlPSJqYXZhc2NyaXB0Ij4KCQkJZnVuY3Rp
b24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