<?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>171311</bug_id>
          
          <creation_ts>2017-04-25 19:57:00 -0700</creation_ts>
          <short_desc>WebKitGtk+ 2.16.0 SEGV on Source/JavaScriptCore/runtime/VMEntryScope.cpp:70 JSC::VMEntryScope::~VMEntryScope()</short_desc>
          <delta_ts>2017-04-25 19:57: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>JavaScriptCore</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>hust.qy</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>hust.qy</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1301427</commentid>
    <comment_count>0</comment_count>
    <who name="">hust.qy</who>
    <bug_when>2017-04-25 19:57:00 -0700</bug_when>
    <thetext>Build with:  Tools/Scripts/build-jsc --gtk --debug 
export CFLAGS=&quot;fsanitize=address -fsanitize=address &quot;

The following test case triggers segmentation fault.

Test case:
---
function recompile() {
    var arr = [0, 1, 2, 3, 4];
    arr.__defineSetter__(&quot;4&quot;, function(x) {
        this._4 = true | x;
    });
    for (var i = 0; i &lt; 5; i++) arr[i] = &quot;grue&quot;;
    var tmp = arr._4;
    for (var p in arr) arr[p] = &quot;bleen&quot;;
    return tmp + &quot; &quot; + arr._4;
}

function bar() {
    for (var i = 0; i &lt; 50; i++) {
        var foo = new Function(&quot;recompile(arguments[0] + &quot; + i + &quot;); return arguments[0]&quot;);
        bar(foo.apply(null, [i]), i);
    }
}
bar();
----

Stacktrace with sanitizer

==757==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fd59945c47a bp 0x7ffff95abf30 sp 0x7ffff95abeb0 T0)
    #0 0x7fd59945c479 in JSC::VMEntryScope::~VMEntryScope() /home/webkitgtk-2.16.0/Source/JavaScriptCore/runtime/VMEntryScope.cpp:70
    #1 0x7fd599092a19 in JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&amp;, JSC::JSValue, JSC::ArgList const&amp;) /home/webkitgtk-2.16.0/Source/JavaScriptCore/interpreter/Interpreter.cpp:905
    #2 0x7fd59926b603 in JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&amp;, JSC::JSValue, JSC::ArgList const&amp;) /home/webkitgtk-2.16.0/Source/JavaScriptCore/runtime/CallData.cpp:39
    #3 0x7fd5992c8330 in JSC::callSetter(JSC::ExecState*, JSC::JSValue, JSC::JSValue, JSC::JSValue, JSC::ECMAMode) /home/webkitgtk-2.16.0/Source/JavaScriptCore/runtime/GetterSetter.cpp:108
    #4 0x7fd59940f528 in JSC::SparseArrayEntry::put(JSC::ExecState*, JSC::JSValue, JSC::SparseArrayValueMap*, JSC::JSValue, bool) /home/webkitgtk-2.16.0/Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp:188
    #5 0x7fd59940fa8c in JSC::SparseArrayValueMap::putEntry(JSC::ExecState*, JSC::JSObject*, unsigned int, JSC::JSValue, bool) /home/webkitgtk-2.16.0/Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp:126
    #6 0x7fd5993448d8 in JSC::JSObject::putByIndexBeyondVectorLengthWithArrayStorage(JSC::ExecState*, unsigned int, JSC::JSValue, bool, JSC::ArrayStorage*) /home/webkitgtk-2.16.0/Source/JavaScriptCore/runtime/JSObject.cpp:2635
    #7 0x7fd599348e02 in JSC::JSObject::putByIndexBeyondVectorLength(JSC::ExecState*, unsigned int, JSC::JSValue, bool) /home/webkitgtk-2.16.0/Source/JavaScriptCore/runtime/JSObject.cpp:2672
    #8 0x7fd599348a13 in JSC::JSObject::putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned int, JSC::JSValue, bool) /home/webkitgtk-2.16.0/Source/JavaScriptCore/runtime/JSObject.cpp:930
    #9 0x7fd59934dc2c in JSC::JSObject::putInline(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&amp;) /home/webkitgtk-2.16.0/Source/JavaScriptCore/runtime/JSObjectInlines.h:211
    #10 0x7fd59934dc2c in JSC::JSObject::put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&amp;) /home/webkitgtk-2.16.0/Source/JavaScriptCore/runtime/JSObject.cpp:751
    #11 0x7fd5992f40b1 in JSC::JSArray::put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&amp;) /home/webkitgtk-2.16.0/Source/JavaScriptCore/runtime/JSArray.cpp:272
    #12 0x7fd598ea13fd in JSC::JSValue::put(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&amp;) /home/webkitgtk-2.16.0/Source/JavaScriptCore/runtime/JSCJSValueInlines.h:872
    #13 0x7fd598ea13fd in operationPutByValInternal&lt;false, false&gt; /home/webkitgtk-2.16.0/Source/JavaScriptCore/dfg/DFGOperations.cpp:145
    #14 0x7fd598ea13fd in operationPutByValNonStrict /home/webkitgtk-2.16.0/Source/JavaScriptCore/dfg/DFGOperations.cpp:624
    #15 0x7fd55180350c  (&lt;unknown module&gt;)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>