<?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>230548</bug_id>
          
          <creation_ts>2021-09-21 04:31:35 -0700</creation_ts>
          <short_desc>Crash when rendering a non-system font with &apos;small-caps&apos; font variant</short_desc>
          <delta_ts>2021-09-21 10:13:56 -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>Canvas</component>
          <version>Safari Technology Preview</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>Other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>229401</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>paul.watkinson</reporter>
          <assigned_to name="Myles C. Maxfield">mmaxfield</assigned_to>
          <cc>dino</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>paul.watkinson</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>thorton</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1795512</commentid>
    <comment_count>0</comment_count>
    <who name="">paul.watkinson</who>
    <bug_when>2021-09-21 04:31:35 -0700</bug_when>
    <thetext>When rendering a non-system font with the &apos;small-caps&apos; font variant, the page crashes and reloads.

This occurs with the following devices:
    1. Simulated iPhone 13 + iOS 15.0, WebKit/605.1.15
    2. Real iPhone XR + iOS 15.0, WebKit/605.1.15


Reproduction:

Adding the following JavaScript to a HTML page; loads a font, waits 5s, and then renders the text to a canvas.

This immediately causes a crash.

```
var fontFamily = &apos;Luckiest Guy&apos;;
var link = document.createElement(&apos;link&apos;);
link.setAttribute(&apos;rel&apos;, &apos;stylesheet&apos;);
link.setAttribute(&apos;href&apos;, `https://fonts.googleapis.com/css?family=${fontFamily}`);

document.head.appendChild(link);
document.body.style.fontFamily = `&apos;${fontFamily}&apos;`;

var canvas = document.createElement(&apos;canvas&apos;);
document.body.appendChild(canvas);

var ctx = canvas.getContext(&apos;2d&apos;);
ctx.font = `normal small-caps normal 48px &apos;${fontFamily}&apos;`;

setInterval(() =&gt; {
    console.log(&apos;Drawing...&apos;);
    ctx.fillText(&apos;Hello, World!&apos;, 0, 48);
}, 5e3);
```


Actual Results:

The page crashes and is reloaded.


Expected Results:

The canvas should render the text, with the font-variant specified.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1795588</commentid>
    <comment_count>1</comment_count>
      <attachid>438828</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2021-09-21 09:14:19 -0700</bug_when>
    <thetext>Created attachment 438828
test case

Same test as an attachment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1795593</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2021-09-21 09:31:15 -0700</bug_when>
    <thetext>I can reproduce this with 19B50, cannot reproduce with 18F72.

There are several simulated crashes in WebContent and GPU processes when opening this test, but I am not seeing any actual crashes. So maybe we are killing the process, I didn&apos;t analyze the logs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1795594</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-09-21 09:31:29 -0700</bug_when>
    <thetext>&lt;rdar://problem/83355212&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1795595</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2021-09-21 09:32:23 -0700</bug_when>
    <thetext>Pretty sure this has been fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1795596</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2021-09-21 09:34:40 -0700</bug_when>
    <thetext>Actually, one of the simulated crash logs says:

Requesting termination of web process 1156 for reason: &quot;Resource is being released before being cached.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1795623</commentid>
    <comment_count>6</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2021-09-21 10:13:56 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 229401 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>438828</attachid>
            <date>2021-09-21 09:14:19 -0700</date>
            <delta_ts>2021-09-21 09:14:19 -0700</delta_ts>
            <desc>test case</desc>
            <filename>bug230548.html</filename>
            <type>text/html</type>
            <size>594</size>
            <attacher name="Alexey Proskuryakov">ap</attacher>
            
              <data encoding="base64">PGJvZHk+CjxzY3JpcHQ+CnZhciBmb250RmFtaWx5ID0gJ0x1Y2tpZXN0IEd1eSc7CnZhciBsaW5r
ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnbGluaycpOwpsaW5rLnNldEF0dHJpYnV0ZSgncmVs
JywgJ3N0eWxlc2hlZXQnKTsKbGluay5zZXRBdHRyaWJ1dGUoJ2hyZWYnLCBgaHR0cHM6Ly9mb250
cy5nb29nbGVhcGlzLmNvbS9jc3M/ZmFtaWx5PSR7Zm9udEZhbWlseX1gKTsKCmRvY3VtZW50Lmhl
YWQuYXBwZW5kQ2hpbGQobGluayk7CmRvY3VtZW50LmJvZHkuc3R5bGUuZm9udEZhbWlseSA9IGAn
JHtmb250RmFtaWx5fSdgOwoKdmFyIGNhbnZhcyA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2Nh
bnZhcycpOwpkb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkKGNhbnZhcyk7Cgp2YXIgY3R4ID0gY2Fu
dmFzLmdldENvbnRleHQoJzJkJyk7CmN0eC5mb250ID0gYG5vcm1hbCBzbWFsbC1jYXBzIG5vcm1h
bCA0OHB4ICcke2ZvbnRGYW1pbHl9J2A7CgpzZXRJbnRlcnZhbCgoKSA9PiB7CiAgICBjb25zb2xl
LmxvZygnRHJhd2luZy4uLicpOwogICAgY3R4LmZpbGxUZXh0KCdIZWxsbywgV29ybGQhJywgMCwg
NDgpOwp9LCA1ZTMpOwoKPC9zY3JpcHQ+
</data>

          </attachment>
      

    </bug>

</bugzilla>