<?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>139000</bug_id>
          
          <creation_ts>2014-11-21 22:46:51 -0800</creation_ts>
          <short_desc>r176455: ASSERT(!m_vector.isEmpty()) in IntendedStructureChain.cpp(143)</short_desc>
          <delta_ts>2014-12-02 13:43:37 -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>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</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>
          
          <blocked>139194</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Saboff">msaboff</reporter>
          <assigned_to name="Michael Saboff">msaboff</assigned_to>
          <cc>ggaren</cc>
    
    <cc>jimoase</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1050698</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2014-11-21 22:46:51 -0800</bug_when>
    <thetext>From &lt;rdar://problem/19046388&gt;

1. Get a spade build of Safari with open source release r176455 or later.
2. Open Safari and navigate to http://www.bobistheoilguy.com/castrol-edge-qa/
3. You may need to scroll.

RESULTS

Crash.  With a Debug build:

ASSERTION FAILED: !m_vector.isEmpty()
/Volumes/Data/src/webkit/Source/JavaScriptCore/runtime/IntendedStructureChain.cpp(143) : JSC::JSObject *JSC::IntendedStructureChain::terminalPrototype() const
1   0x10dea92b0 WTFCrash
2   0x10dadfe96 JSC::IntendedStructureChain::terminalPrototype() const
3   0x10de62c96 JSC::ComplexGetStatus::computeFor(JSC::CodeBlock*, JSC::Structure*, JSC::StructureChain*, unsigned int, WTF::StringImpl*)
4   0x10da286f9 JSC::GetByIdStatus::computeForStubInfo(JSC::ConcurrentJITLocker const&amp;, JSC::CodeBlock*, JSC::StructureStubInfo*, WTF::StringImpl*, JSC::CallLinkStatus::ExitSiteData)
5   0x10da2799b JSC::GetByIdStatus::computeFor(JSC::CodeBlock*, WTF::HashMap&lt;JSC::CodeOrigin, JSC::StructureStubInfo*, JSC::CodeOriginApproximateHash, WTF::HashTraits&lt;JSC::CodeOrigin&gt;, WTF::HashTraits&lt;JSC::StructureStubInfo*&gt; &gt;&amp;, unsigned int, WTF::StringImpl*)
6   0x10da29fbb JSC::GetByIdStatus::computeFor(JSC::CodeBlock*, JSC::CodeBlock*, WTF::HashMap&lt;JSC::CodeOrigin, JSC::StructureStubInfo*, JSC::CodeOriginApproximateHash, WTF::HashTraits&lt;JSC::CodeOrigin&gt;, WTF::HashTraits&lt;JSC::StructureStubInfo*&gt; &gt;&amp;, WTF::HashMap&lt;JSC::CodeOrigin, JSC::StructureStubInfo*, JSC::CodeOriginApproximateHash, WTF::HashTraits&lt;JSC::CodeOrigin&gt;, WTF::HashTraits&lt;JSC::StructureStubInfo*&gt; &gt;&amp;, JSC::CodeOrigin, WTF::StringImpl*)
7   0x10d6e8ed7 JSC::DFG::ByteCodeParser::parseBlock(unsigned int)
8   0x10d6e1629 JSC::DFG::ByteCodeParser::parseCodeBlock()
9   0x10d6ef97a JSC::DFG::ByteCodeParser::parse()
10  0x10d6efcae JSC::DFG::parse(JSC::DFG::Graph&amp;)
11  0x10d887951 JSC::DFG::Plan::compileInThreadImpl(JSC::DFG::LongLivedState&amp;)
12  0x10d887566 JSC::DFG::Plan::compileInThread(JSC::DFG::LongLivedState&amp;, JSC::DFG::ThreadData*)
13  0x10d94a640 JSC::DFG::Worklist::runThread(JSC::DFG::ThreadData*)
14  0x10d948c34 JSC::DFG::Worklist::threadFunction(void*)
15  0x10defce69 WTF::createThread(void (*)(void*), void*, char const*)::$_0::operator()() const
16  0x10defce3c std::__1::__function::__func&lt;WTF::createThread(void (*)(void*), void*, char const*)::$_0, std::__1::allocator&lt;WTF::createThread(void (*)(void*), void*, char const*)::$_0&gt;, void ()&gt;::operator()()
17  0x10ded207a std::__1::function&lt;void ()&gt;::operator()() const
18  0x10defbdbe WTF::threadEntryPoint(void*)
19  0x10defd7c8 WTF::wtfThreadEntryPoint(void*)
20  0x7fff8cede2fc _pthread_body
21  0x7fff8cede279 _pthread_body
22  0x7fff8cedc4b1 thread_start
LEAK: 2 WebPageProxy
LEAK: 2 WebContext</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1050700</commentid>
    <comment_count>1</comment_count>
      <attachid>242113</attachid>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2014-11-21 23:26:00 -0800</bug_when>
    <thetext>Created attachment 242113
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1050727</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2014-11-22 11:07:11 -0800</bug_when>
    <thetext>Committed r176506: &lt;http://trac.webkit.org/changeset/176506&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1050767</commentid>
    <comment_count>3</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2014-11-23 08:20:27 -0800</bug_when>
    <thetext>*** Bug 138772 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1051936</commentid>
    <comment_count>4</comment_count>
      <attachid>242113</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2014-12-02 12:41:53 -0800</bug_when>
    <thetext>Comment on attachment 242113
Patch

Can you write a test for this? I think the test case here is more valuable than the patch, since this is code that changes a lot, and this mistake can easily be reintroduced.

It looks like the key to this bug is invoking tryBuildGetByIDList(), with an object whose prototype is explicitly null.

So, you can probably get this to happen by writing a test case where we repeatedly do an access, for three or four different structures, and each structure has a null prototype.

One way to get a null prototype is to explicitly set object.__proto__ = null.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1051938</commentid>
    <comment_count>5</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2014-12-02 12:43:54 -0800</bug_when>
    <thetext>var o1 = { __proto__: null, a: 0, b: 0 };
var o2 =  { __proto__: null, a: 0, c: 0 };
var o3 =  { __proto__: null, a: 0, d: 0 };

function access(o)
{
    return o.a;
}

do a lot:
access(o1)
access(o2)
access(o3)</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>242113</attachid>
            <date>2014-11-21 23:26:00 -0800</date>
            <delta_ts>2014-11-22 10:29:19 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>139000.patch</filename>
            <type>text/plain</type>
            <size>1310</size>
            <attacher name="Michael Saboff">msaboff</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTc2NTAwKQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE1IEBA
CisyMDE0LTExLTIxICBNaWNoYWVsIFNhYm9mZiAgPG1zYWJvZmZAYXBwbGUuY29tPgorCisgICAg
ICAgIHIxNzY0NTU6IEFTU0VSVCghbV92ZWN0b3IuaXNFbXB0eSgpKSBpbiBJbnRlbmRlZFN0cnVj
dHVyZUNoYWluLmNwcCgxNDMpCisgICAgICAgIGh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haW4g
PSBhZG9wdFJlZihuZXcgSW50ZW5kZWRTdHJ1Y3R1cmVDaGFpbigKICAgICAgICAgICAgIHByb2Zp
bGVkQmxvY2ssIGhlYWRTdHJ1Y3R1cmUsIGNoYWluLCBjaGFpbkNvdW50KSk7CiAgICAgICAgIAo=
</data>
<flag name="review"
          id="266988"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>