<?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>247644</bug_id>
          
          <creation_ts>2022-11-08 14:34:30 -0800</creation_ts>
          <short_desc>Segfault in JSC::IdentifierArena::makeBigIntDecimalIdentifier</short_desc>
          <delta_ts>2022-11-09 14:31:27 -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>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</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="David Degazio">d_degazio</reporter>
          <assigned_to name="David Degazio">d_degazio</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1911105</commentid>
    <comment_count>0</comment_count>
      <attachid>463459</attachid>
    <who name="David Degazio">d_degazio</who>
    <bug_when>2022-11-08 14:34:30 -0800</bug_when>
    <thetext>Created attachment 463459
Reproducing case

The attached source fails with a segmentation fault when lexing the 0x1n bigint identifier. This seems to be because we use a JSBigInt value within the parser to handle converting non-decimal integer constants to decimal identifiers. When allocating this JSBigInt fails (in this case, because we have exhausted all memory in the previous invocation of foo), we try to throw an exception. In the lexer/parser however, there is no global object to throw an exception to, so the bigint implementation falls back to returning a null pointer, which causes the segfault when we use it later in makeBigIntDecimalIdentifier.

rdar://98566429</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1911123</commentid>
    <comment_count>1</comment_count>
    <who name="David Degazio">d_degazio</who>
    <bug_when>2022-11-08 15:11:34 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/6271</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1911365</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-11-09 14:31:25 -0800</bug_when>
    <thetext>Committed 256501@main (32b972813979): &lt;https://commits.webkit.org/256501@main&gt;

Reviewed commits have been landed. Closing PR #6271 and removing active labels.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>463459</attachid>
            <date>2022-11-08 14:34:30 -0800</date>
            <delta_ts>2022-11-08 14:34:30 -0800</delta_ts>
            <desc>Reproducing case</desc>
            <filename>segfault-in-identifierarena-makebigdecimalidentifier.js</filename>
            <type>text/plain</type>
            <size>218</size>
            <attacher name="David Degazio">d_degazio</attacher>
            
              <data encoding="base64">ZnVuY3Rpb24gZm9vKCkgewogIGxldCBtID0gbmV3IFdlYkFzc2VtYmx5Lk1lbW9yeSh7aW5pdGlh
bDogMTAwMH0pOwogIHRyeSB7CiAgICBmb28oKTsKICB9IGNhdGNoIHt9CiAgZm9yIChsZXQgaSA9
IDA7IGkgPCAxMDAwOyBpKyspIHsKICAgIG5ldyBVaW50OEFycmF5KGkpOwogIH0KfQoKdHJ5IHsK
ICBmb28oKTsKfSBjYXRjaCAoeCkge30KCmV2YWwoJ2NsYXNzIEN7MHgxbicpOwo=
</data>
<flag name="commit-queue"
          id="491937"
          type_id="3"
          status="-"
          setter="d_degazio"
    />
          </attachment>
      

    </bug>

</bugzilla>