<?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>195875</bug_id>
          
          <creation_ts>2019-03-17 22:27:29 -0700</creation_ts>
          <short_desc>errorDescriptionForValue would trigger another out-of-memory error for rope string</short_desc>
          <delta_ts>2019-03-27 19:49:14 -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 12</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>196032</dup_id>
          
          <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>dwfault</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>fpizlo</cc>
    
    <cc>keith_miller</cc>
    
    <cc>mark.lam</cc>
    
    <cc>msaboff</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1517619</commentid>
    <comment_count>0</comment_count>
    <who name="">dwfault</who>
    <bug_when>2019-03-17 22:27:29 -0700</bug_when>
    <thetext>PoC:

let o0 = &apos;\ud801&apos;;
let o1 = o0.padEnd(0x7fffffff, &apos;x&apos;);

function f() {
}

print(describe(o0));
//String (rope) (unresolved): (null StringImpl*), StructureID: 29020


print(describe(o1));
//nothing?

//debug(o1);
//print();
//Out of memory.

print(describe(f));
//Object: 0x1212cbc60 with butterfly 0x0 (Structure 0x1212fd9d0:[Function, {}, NonArray, Proto:0x1212d4000, Leaf]), StructureID: 39799

try {
    o1(f);   //---&gt; here.
} catch (e) {
    print(e);
}












crash:

2019-03-18 13:23:54.286323+0800 jsc[70531:7728936] ASSERTION FAILED: Unexpected exception observed on thread Thread:0x11e5fa000 at:
    1   0x1019398e6 JSC::ExceptionScope::unexpectedExceptionMessage()
    2   0x100f7b34b JSC::ExceptionScope::assertNoException()
    3   0x101938750 JSC::createError(JSC::ExecState*, JSC::JSValue, WTF::String const&amp;, WTF::String (*)(WTF::String const&amp;, WTF::String const&amp;, JSC::RuntimeType, JSC::ErrorInstance::SourceTextWhereErrorOccurred))
    4   0x101938f52 JSC::createNotAFunctionError(JSC::ExecState*, JSC::JSValue)
    5   0x1016fb71e JSC::LLInt::handleHostCall(JSC::ExecState*, JSC::JSValue, JSC::CodeSpecializationKind)
    6   0x1016fac62 JSC::LLInt::setUpCall(JSC::ExecState*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*)
    7   0x1016f38a8 JSC::SlowPathReturnType JSC::LLInt::genericCall&lt;JSC::OpCall&gt;(JSC::ExecState*, JSC::OpCall&amp;&amp;, JSC::CodeSpecializationKind)
    8   0x1016f37b2 llint_slow_path_call
    9   0x10097c663 llint_entry
    10  0x1009692e2 vmEntryToJavaScript
    11  0x1015de45e JSC::JITC
ASSERTION FAILED: Unexpected exception observed on thread Thread:0x11e5fa000 at:
    1   0x1019398e6 JSC::ExceptionScope::unexpectedExceptionMessage()
    2   0x100f7b34b JSC::ExceptionScope::assertNoException()
    3   0x101938750 JSC::createError(JSC::ExecState*, JSC::JSValue, WTF::String const&amp;, WTF::String (*)(WTF::String const&amp;, WTF::String const&amp;, JSC::RuntimeType, JSC::ErrorInstance::SourceTextWhereErrorOccurred))
    4   0x101938f52 JSC::createNotAFunctionError(JSC::ExecState*, JSC::JSValue)
    5   0x1016fb71e JSC::LLInt::handleHostCall(JSC::ExecState*, JSC::JSValue, JSC::CodeSpecializationKind)
    6   0x1016fac62 JSC::LLInt::setUpCall(JSC::ExecState*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*)
    7   0x1016f38a8 JSC::SlowPathReturnType JSC::LLInt::genericCall&lt;JSC::OpCall&gt;(JSC::ExecState*, JSC::OpCall&amp;&amp;, JSC::CodeSpecializationKind)
    8   0x1016f37b2 llint_slow_path_call
    9   0x10097c663 llint_entry
    10  0x1009692e2 vmEntryToJavaScript
    11  0x1015de45e JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*)
    12  0x1015dd9e0 JSC::Interpreter::executeProgram(JSC::SourceCode const&amp;, JSC::ExecState*, JSC::JSObject*)
    13  0x10190b1e5 JSC::evaluate(JSC::ExecState*, JSC::SourceCode const&amp;, JSC::JSValue, WTF::NakedPtr&lt;JSC::Exception&gt;&amp;)
    14  0x10004f56b runWithOptions(GlobalObject*, CommandLine&amp;, bool&amp;)
    15  0x1000251ba jscmain(int, char**)::$_6::operator()(JSC::VM&amp;, GlobalObject*, bool&amp;) const
    16  0x100006ab4 int runJSC&lt;jscmain(int, char**)::$_6&gt;(CommandLine const&amp;, bool, jscmain(int, char**)::$_6 const&amp;)
    17  0x100005197 jscmain(int, char**)
    18  0x100004ffe main
    19  0x7fff63403ed9 start
The exception was thrown from thread Thread:0x11e5fa000 at:
    1   0x101bd009f JSC::VM::throwException(JSC::ExecState*, JSC::Exception*)
    2   0x101bd0420 JSC::VM::throwException(JSC::ExecState*, JSC::JSValue)
    3   0x101bd04e8 JSC::VM::throwException(JSC::ExecState*, JSC::JSObject*)
    4   0x101baa6d5 JSC::ThrowScope::throwException(JSC::ExecState*, JSC::JSObject*)
    5   0x10099b405 JSC::throwException(JSC::ExecState*, JSC::ThrowScope&amp;, JSC::JSObject*)
    6   0x1019395bc JSC::throwOutOfMemoryError(JSC::ExecState*, JSC::ThrowScope&amp;)
    7   0x101a7e26b JSC::JSRopeString::outOfMemory(JSC::ExecState*) const
    8   0x101a7df37 WTF::String const&amp; JSC::JSRopeString::resolveRopeWithFunction&lt;JSC::JSRopeString::resolveRope(JSC::ExecState*) const::$_3&gt;(JSC::ExecState*, JSC::JSRopeString::resolveRope(JSC::ExecState*) const::$_3&amp;&amp;) const
    9   0x101a7db91 JSC::JSRopeString::resolveRope(JSC::ExecState*) const
    10  0x100985859 JSC::JSString::value(JSC::ExecState*) const
    11  0x1019381b4 JSC::errorDescriptionForValue(JSC::ExecState*, JSC::JSValue)
    12  0x1019386ad JSC::createError(JSC::ExecState*, JSC::JSValue, WTF::String const&amp;, WTF::String (*)(WTF::String const&amp;, WTF::String const&amp;, JSC::RuntimeType, JSC::ErrorInstance::SourceTextWhereErrorOccurred))
    13  0x101938f52 JSC::createNotAFunctionError(JSC::ExecState*, JSC::JSValue)
    14  0x1016fb71e JSC::LLInt::handleHostCall(JSC::ExecState*, JSC::JSValue, JSC::CodeSpecializationKind)
    15  0x1016fac62 JSC::LLInt::setUpCall(JSC::ExecState*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*)
    16  0x1016f38a8 JSC::SlowPathReturnType JSC::LLInt::genericCall&lt;JSC::OpCall&gt;(JSC::ExecState*, JSC::OpCall&amp;&amp;, JSC::CodeSpecializationKind)
    17  0x1016f37b2 llint_slow_path_call
    18  0x10097c663 llint_entry
    19  0x1009692e2 vmEntryToJavaScript
    20  0x1015de45e JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*)
    21  0x1015dd9e0 JSC::Interpreter::executeProgram(JSC::SourceCode const&amp;, JSC::ExecState*, JSC::JSObject*)
    22  0x10190b1e5 JSC::evaluate(JSC::ExecState*, JSC::SourceCode const&amp;, JSC::JSValue, WTF::NakedPtr&lt;JSC::Exception&gt;&amp;)
    23  0x10004f56b runWithOptions(GlobalObject*, CommandLine&amp;, bool&amp;)
    24  0x1000251ba jscmain(int, char**)::$_6::operator()(JSC::VM&amp;, GlobalObject*, bool&amp;) const
    25  0x100006ab4 int runJSC&lt;jscmain(int, char**)::$_6&gt;(CommandLine const&amp;, bool, jscmain(int, char**)::$_6 const&amp;)
    26  0x100005197 jscmain(int, char**)
    27  0x100004ffe main
    28  0x7fff63403ed9 start
    29  0x5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1517620</commentid>
    <comment_count>1</comment_count>
    <who name="">dwfault</who>
    <bug_when>2019-03-17 22:29:20 -0700</bug_when>
    <thetext>Reproducable on WebKit on macOS and Linux. Commit id 7423a6649 March 16 2019.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1518070</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-03-18 18:55:44 -0700</bug_when>
    <thetext>&lt;rdar://problem/49003758&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1521982</commentid>
    <comment_count>3</comment_count>
    <who name="">dwfault</who>
    <bug_when>2019-03-27 19:49:14 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 196032 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>