<?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>119395</bug_id>
          
          <creation_ts>2013-08-01 06:05:25 -0700</creation_ts>
          <short_desc>Crash in JSCell::methodTable under errorDescriptionForValue()</short_desc>
          <delta_ts>2013-09-05 06:35:26 -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>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>120080</dup_id>
          
          <bug_file_loc>http://www.sfgate.com</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter>peavo</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>chris_curtis</cc>
    
    <cc>ggaren</cc>
    
    <cc>jbriance</cc>
    
    <cc>mhahnenberg</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>913725</commentid>
    <comment_count>0</comment_count>
    <who name="">peavo</who>
    <bug_when>2013-08-01 06:05:25 -0700</bug_when>
    <thetext>I&apos;m getting a crash (NULL pointer access violation) in JavaScriptCore.

This is the stacktrace:

 	JavaScriptCore.dll!JSC::JSCell::methodTable()  Line 157	C++
	JavaScriptCore.dll!JSC::errorDescriptionForValue(JSC::ExecState * exec, JSC::JSValue v)  Line 112 + 0xe bytes	C++
 	JavaScriptCore.dll!JSC::createError(JSC::ExecState * exec, JSC::JSObject * (JSC::ExecState *, const WTF::String &amp;)* errorFactory, JSC::JSValue value, const WTF::String &amp; message)  Line 117 + 0x24 bytes	C++
 	JavaScriptCore.dll!JSC::createNotAnObjectError(JSC::ExecState * exec, JSC::JSValue value)  Line 141 + 0x28 bytes	C++
 	JavaScriptCore.dll!JSC::JSValue::synthesizePrototype(JSC::ExecState * exec)  Line 111 + 0xe bytes	C++
 	JavaScriptCore.dll!JSC::JSValue::get(JSC::ExecState * exec, unsigned int propertyName, JSC::PropertySlot &amp; slot)  Line 660	C++
 	JavaScriptCore.dll!JSC::getByVal(JSC::ExecState * callFrame, JSC::JSValue baseValue, JSC::JSValue subscript, JSC::ReturnAddressPtr returnAddress)  Line 1542	C++
 	JavaScriptCore.dll!cti_op_get_by_val_generic(void * * args)  Line 1603	C++
 	0c192fce()	
 	JavaScriptCore.dll!JSC::JITCode::execute(JSC::JSStack * stack, JSC::ExecState * callFrame, JSC::VM * vm)  Line 46 + 0x20 bytes	C++
 	JavaScriptCore.dll!JSC::Interpreter::execute(JSC::ProgramExecutable * program, JSC::ExecState * callFrame, JSC::JSObject * thisObj)  Line 856 + 0x2d bytes	C++
 	JavaScriptCore.dll!JSC::evaluate(JSC::ExecState * exec, const JSC::SourceCode &amp; source, JSC::JSValue thisValue, JSC::JSValue * returnedException)  Line 85	C++
 	WebKit.dll!WebCore::JSMainThreadExecState::evaluate(JSC::ExecState * exec, const JSC::SourceCode &amp; source, JSC::JSValue thisValue, JSC::JSValue * exception)  Line 74 + 0x1b bytes	C++
 	WebKit.dll!WebCore::ScriptController::evaluateInWorld(const WebCore::ScriptSourceCode &amp; sourceCode, WebCore::DOMWrapperWorld * world)  Line 142 + 0x34 bytes	C++
 	WebKit.dll!WebCore::ScriptController::evaluate(const WebCore::ScriptSourceCode &amp; sourceCode)  Line 158 + 0x40 bytes	C++
 	WebKit.dll!WebCore::ScriptElement::executeScript(const WebCore::ScriptSourceCode &amp; sourceCode)  Line 316 + 0x16 bytes	C++
 	WebKit.dll!WebCore::ScriptRunner::timerFired(WebCore::Timer&lt;WebCore::ScriptRunner&gt; * timer)  Line 121 + 0x2a5 bytes	C++
 	WebKit.dll!WebCore::Timer&lt;WebCore::ProgressTracker&gt;::fired()  Line 114 + 0xb bytes	C++
 	WebKit.dll!WebCore::ThreadTimers::sharedTimerFiredInternal()  Line 132	C++
 	WebKit.dll!WebCore::TimerWindowWndProc(HWND__ * hWnd, unsigned int message, unsigned int wParam, long lParam)  Line 111	C++</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>913726</commentid>
    <comment_count>1</comment_count>
      <attachid>207921</attachid>
    <who name="">peavo</who>
    <bug_when>2013-08-01 06:10:55 -0700</bug_when>
    <thetext>Created attachment 207921
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>913751</commentid>
    <comment_count>2</comment_count>
      <attachid>207921</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2013-08-01 08:45:37 -0700</bug_when>
    <thetext>Comment on attachment 207921
Patch

Can you provide a test case for this?

I don&apos;t think checking isEmpty() here is right. Generally, JSValue() is not a valid value to use in the JIT or to pass to a runtime function. It&apos;s like a null pointer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>913875</commentid>
    <comment_count>3</comment_count>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2013-08-01 14:41:47 -0700</bug_when>
    <thetext>Can you give us steps to reproduce the issue? Then we can help you investigate!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>914098</commentid>
    <comment_count>4</comment_count>
    <who name="">peavo</who>
    <bug_when>2013-08-02 05:33:39 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; Can you give us steps to reproduce the issue? Then we can help you investigate!

I don&apos;t have a reduced testcase, but I&apos;m consistently getting the crash on many sites, e.g. www.sfgate.com. I&apos;m running on Windows (WinCairo) though, so I&apos;m not sure you will see the same crash if you&apos;re on OSX.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>917952</commentid>
    <comment_count>5</comment_count>
      <attachid>208924</attachid>
    <who name="">peavo</who>
    <bug_when>2013-08-16 07:30:53 -0700</bug_when>
    <thetext>Created attachment 208924
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>917953</commentid>
    <comment_count>6</comment_count>
    <who name="">peavo</who>
    <bug_when>2013-08-16 07:33:33 -0700</bug_when>
    <thetext>I&apos;m frequently getting this crash. Trying another patch, but I assume it&apos;s not sufficient, as it doesn&apos;t address the root cause of the crash, but only avoids it :) I have not yet been able to figure out the origin of the empty JSValue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>917956</commentid>
    <comment_count>7</comment_count>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2013-08-16 08:06:55 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; I&apos;m frequently getting this crash. Trying another patch, but I assume it&apos;s not sufficient, as it doesn&apos;t address the root cause of the crash, but only avoids it :) I have not yet been able to figure out the origin of the empty JSValue.

The original backtrace seems to indicate that you got the empty JSValue from inside the baseline JIT (cti_op_blah_blah_blah is a baseline JIT stub). Have you tried disabling the JITs to see if the issue goes away? You can do this by setting &quot;useJIT() = false;&quot; in Options::initialize in Options.cpp and recompiling. If that makes the problem go away then try just disabling the top tier JIT by setting &quot;useDFGJIT() = false;&quot; in the same manner (and removing &quot;useJIT() = false;&quot; where you added it previously). These experiments will tell us which execution engine (the LLInt, the baseline JIT, or the DFG JIT) is responsible for the empty JSValue you&apos;re seeing.

This all should take &lt; 5 minutes to build both versions. How long does it usually take to see this crash when browsing around the web?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>918051</commentid>
    <comment_count>8</comment_count>
    <who name="">peavo</who>
    <bug_when>2013-08-16 11:51:29 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; (In reply to comment #6)
&gt; &gt; I&apos;m frequently getting this crash. Trying another patch, but I assume it&apos;s not sufficient, as it doesn&apos;t address the root cause of the crash, but only avoids it :) I have not yet been able to figure out the origin of the empty JSValue.
&gt; 
&gt; The original backtrace seems to indicate that you got the empty JSValue from inside the baseline JIT (cti_op_blah_blah_blah is a baseline JIT stub). Have you tried disabling the JITs to see if the issue goes away? You can do this by setting &quot;useJIT() = false;&quot; in Options::initialize in Options.cpp and recompiling. If that makes the problem go away then try just disabling the top tier JIT by setting &quot;useDFGJIT() = false;&quot; in the same manner (and removing &quot;useJIT() = false;&quot; where you added it previously). These experiments will tell us which execution engine (the LLInt, the baseline JIT, or the DFG JIT) is responsible for the empty JSValue you&apos;re seeing.
&gt; 
&gt; This all should take &lt; 5 minutes to build both versions. How long does it usually take to see this crash when browsing around the web?

Thanks for the response!

I tried setting &quot;useJIT() = false;&quot;, but I get the same crash. I believe both LLInt and the DFG JIT is disabled on Windows, so I guess there&apos;s no fallback, so baseline JIT is used regardless? I get the same stacktrace with cti_op_get_by_val_generic, which indicates this. Should I try to enable the DFG JIT? I usually see the crash quickly (within minutes or less) when browsing around. It happens every time when I visit www.sfgate.com.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>918060</commentid>
    <comment_count>9</comment_count>
      <attachid>208924</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2013-08-16 12:07:07 -0700</bug_when>
    <thetext>Comment on attachment 208924
Patch

This seems wrong. It’s not correct to call this with an empty JSValue. Where is that happening?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>918065</commentid>
    <comment_count>10</comment_count>
    <who name="">peavo</who>
    <bug_when>2013-08-16 12:15:20 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; (From update of attachment 208924 [details])
&gt; This seems wrong. It’s not correct to call this with an empty JSValue. Where is that happening?

I get it every time on www.sfgate.com (Windows).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921695</commentid>
    <comment_count>11</comment_count>
    <who name="Julien Brianceau">jbriance</who>
    <bug_when>2013-08-27 15:18:59 -0700</bug_when>
    <thetext>Seems to be a duplicate of https://bugs.webkit.org/show_bug.cgi?id=120080</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921737</commentid>
    <comment_count>12</comment_count>
      <attachid>208924</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2013-08-27 16:47:54 -0700</bug_when>
    <thetext>Comment on attachment 208924
Patch

We really need to figure out why these values are NULL. They shouldn&apos;t be.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921889</commentid>
    <comment_count>13</comment_count>
    <who name="Julien Brianceau">jbriance</who>
    <bug_when>2013-08-28 02:30:06 -0700</bug_when>
    <thetext>(In reply to comment #10)
&gt; I get it every time on www.sfgate.com (Windows).

Could you test the patch I&apos;ve just submitted in https://bugs.webkit.org/show_bug.cgi?id=120080 and give your feedback with your Windows build please?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>924993</commentid>
    <comment_count>14</comment_count>
    <who name="">peavo</who>
    <bug_when>2013-09-05 06:35:26 -0700</bug_when>
    <thetext>Thanks alot, that patch did the trick :)

*** This bug has been marked as a duplicate of bug 120080 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>207921</attachid>
            <date>2013-08-01 06:10:55 -0700</date>
            <delta_ts>2013-08-16 07:30:46 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-119395-20130801151042.patch</filename>
            <type>text/plain</type>
            <size>1216</size>
            <attacher>peavo</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTUzNTgyKQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDEzIEBA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IGlmICh2LmlzRW1wdHkoKSkKKyAgICAgICAgcmV0
dXJuIHZtLnNtYWxsU3RyaW5ncy5udWxsU3RyaW5nKCk7CiAgICAgaWYgKHYuaXNVbmRlZmluZWQo
KSkKICAgICAgICAgcmV0dXJuIHZtLnNtYWxsU3RyaW5ncy51bmRlZmluZWRTdHJpbmcoKTsKICAg
ICBpZiAodi5pc0ludDMyKCkpCg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>208924</attachid>
            <date>2013-08-16 07:30:53 -0700</date>
            <delta_ts>2013-08-27 16:47:54 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-119395-20130816163016.patch</filename>
            <type>text/plain</type>
            <size>1627</size>
            <attacher>peavo</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTU0MTc4KQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDEyIEBA
CisyMDEzLTA4LTE2ICBwZWF2b0BvdXRsb29rLmNvbSAgPHBlYXZvQG91dGxvb2suY29tPgorCisg
ICAgICAgIDxodHRwczovL3dlYmtpdC5vcmcvYi8xMTkzOTU+IENyYXNoIGluIEpTQ2VsbDo6bWV0
aG9kVGFibGUgdW5kZXIgZXJyb3JEZXNjcmlwdGlvbkZvclZhbHVlKCkKKworICAgICAgICBSZXZp
ZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICAqIHJ1bnRpbWUvRXhjZXB0aW9uSGVs
cGVycy5jcHA6CisgICAgICAgIChKU0M6OmNyZWF0ZUVycm9yKTogQXZvaWQg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gIFN0cmluZyBlcnJv
ck1lc3NhZ2U7CisgICAgaWYgKCF2YWx1ZS5pc0VtcHR5KCkpCisgICAgICAgIGVycm9yTWVzc2Fn
ZSA9IG1ha2VTdHJpbmcoZXJyb3JEZXNjcmlwdGlvbkZvclZhbHVlKGV4ZWMsIHZhbHVlKS0+dmFs
dWUoZXhlYyksICIgIiwgbWVzc2FnZSk7CiAgICAgSlNPYmplY3QqIGV4Y2VwdGlvbiA9IGVycm9y
RmFjdG9yeShleGVjLCBlcnJvck1lc3NhZ2UpOwogICAgIEFTU0VSVChleGNlcHRpb24tPmlzRXJy
b3JJbnN0YW5jZSgpKTsKICAgICBzdGF0aWNfY2FzdDxFcnJvckluc3RhbmNlKj4oZXhjZXB0aW9u
KS0+c2V0QXBwZW5kU291cmNlVG9NZXNzYWdlKCk7Cg==
</data>
<flag name="review"
          id="230895"
          type_id="1"
          status="-"
          setter="ggaren"
    />
          </attachment>
      

    </bug>

</bugzilla>