<?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>240552</bug_id>
          
          <creation_ts>2022-05-17 17:04:13 -0700</creation_ts>
          <short_desc>WTF::CrashOnOverflow::crash() with /((a{100000000})*b{2100000000})+/.test();</short_desc>
          <delta_ts>2022-11-29 11:06:04 -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="Michael Saboff">msaboff</reporter>
          <assigned_to name="Michael Saboff">msaboff</assigned_to>
          <cc>mark.lam</cc>
    
    <cc>saam</cc>
    
    <cc>tmos4orced</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1869868</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2022-05-17 17:04:13 -0700</bug_when>
    <thetext>Steps To Reproduce:

jsc -e &apos;/((a{100000000})*b{2100000000})+/.test();&apos;


Results:

1   0x110094b49 WTFCrash
2   0x1109e2009 WTF::CrashOnOverflow::crash()
3   0x111bf47c9 WTF::CrashOnOverflow::overflowed()
4   0x11065eade WTF::Checked&lt;unsigned int, WTF::CrashOnOverflow&gt;::Checked(WTF::ResultOverflowedTag)
5   0x11065ea3b WTF::Checked&lt;unsigned int, WTF::CrashOnOverflow&gt;::Checked(WTF::ResultOverflowedTag)
6   0x112289fb3 WTF::Checked&lt;WTF::Result&lt;unsigned int, unsigned int&gt;::ResultType, WTF::CrashOnOverflow&gt; WTF::operator+&lt;unsigned int, unsigned int, WTF::CrashOnOverflow&gt;(WTF::Checked&lt;unsigned int, WTF::CrashOnOverflow&gt;, WTF::Checked&lt;unsigned int, WTF::CrashOnOverflow&gt;)
7   0x11228919c JSC::Yarr::YarrGenerator&lt;JSC::Yarr::YarrJITDefaultRegisters&gt;::opCompileParenthesesSubpattern(WTF::Checked&lt;unsigned int, WTF::CrashOnOverflow&gt;, JSC::Yarr::PatternTerm*)
8   0x112287992 JSC::Yarr::YarrGenerator&lt;JSC::Yarr::YarrJITDefaultRegisters&gt;::opCompileAlternative(WTF::Checked&lt;unsigned int, WTF::CrashOnOverflow&gt;, JSC::Yarr::PatternAlternative*)
9   0x1122891ee JSC::Yarr::YarrGenerator&lt;JSC::Yarr::YarrJITDefaultRegisters&gt;::opCompileParenthesesSubpattern(WTF::Checked&lt;unsigned int, WTF::CrashOnOverflow&gt;, JSC::Yarr::PatternTerm*)
10  0x112287992 JSC::Yarr::YarrGenerator&lt;JSC::Yarr::YarrJITDefaultRegisters&gt;::opCompileAlternative(WTF::Checked&lt;unsigned int, WTF::CrashOnOverflow&gt;, JSC::Yarr::PatternAlternative*)
11  0x112281739 JSC::Yarr::YarrGenerator&lt;JSC::Yarr::YarrJITDefaultRegisters&gt;::opCompileBody(JSC::Yarr::PatternDisjunction*)
12  0x11225fb54 JSC::Yarr::YarrGenerator&lt;JSC::Yarr::YarrJITDefaultRegisters&gt;::compile(JSC::Yarr::YarrCodeBlock&amp;)
13  0x11225f936 JSC::Yarr::jitCompile(JSC::Yarr::YarrPattern&amp;, WTF::StringView, JSC::Yarr::CharSize, JSC::VM*, JSC::Yarr::YarrCodeBlock&amp;, JSC::Yarr::JITCompileMode)
14  0x111e505ca JSC::RegExp::compileMatchOnly(JSC::VM*, JSC::Yarr::CharSize)
15  0x111e657ef JSC::RegExp::compileIfNecessaryMatchOnly(JSC::VM&amp;, JSC::Yarr::CharSize)
16  0x111e507e1 JSC::MatchResult JSC::RegExp::matchInline&lt;(JSC::Yarr::MatchFrom)0&gt;(JSC::JSGlobalObject*, JSC::VM&amp;, WTF::String const&amp;, unsigned int)
17  0x111e50744 JSC::RegExp::match(JSC::JSGlobalObject*, WTF::String const&amp;, unsigned int)
18  0x1112c1f3d JSC::RegExpGlobalData::performMatch(JSC::JSGlobalObject*, JSC::RegExp*, JSC::JSString*, WTF::String const&amp;, int)
19  0x1112c1ac4 JSC::RegExpObject::matchInline(JSC::JSGlobalObject*, JSC::JSString*)
20  0x111e59295 JSC::RegExpObject::match(JSC::JSGlobalObject*, JSC::JSString*)
21  0x111288635 JSC::RegExpObject::test(JSC::JSGlobalObject*, JSC::JSString*)
22  0x111e5daf9 JSC::regExpProtoFuncTestFast(JSC::JSGlobalObject*, JSC::CallFrame*)
23  0x5db5c2208038
24  0x110763427 llint_entry
25  0x11073ef0e vmEntryToJavaScript
26  0x1116c2bd2 JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*)
27  0x1116c22b9 JSC::Interpreter::executeProgram(JSC::SourceCode const&amp;, JSC::JSGlobalObject*, JSC::JSObject*)
28  0x111aec835 JSC::evaluate(JSC::JSGlobalObject*, JSC::SourceCode const&amp;, JSC::JSValue, WTF::NakedPtr&lt;JSC::Exception&gt;&amp;)
29  0x10077d1bf runWithOptions(GlobalObject*, CommandLine&amp;, bool&amp;)
30  0x10072d872 jscmain(int, char**)::$_9::operator()(JSC::VM&amp;, GlobalObject*, bool&amp;) const
31  0x1006fb1e6 int runJSC&lt;jscmain(int, char**)::$_9&gt;(CommandLine const&amp;, bool, jscmain(int, char**)::$_9 const&amp;)

Regression:

I am seeing this on WebKit svn rev 294218
Both Debug and Release builds crash</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1869869</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2022-05-17 17:04:23 -0700</bug_when>
    <thetext>&lt;rdar://93347568&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1870055</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2022-05-18 10:18:10 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/733</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1870080</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-05-18 11:34:39 -0700</bug_when>
    <thetext>Committed r294411 (250703@main): &lt;https://commits.webkit.org/250703@main&gt;

Reviewed commits have been landed. Closing PR #733 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>