<?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>120007</bug_id>
          
          <creation_ts>2013-08-19 05:49:30 -0700</creation_ts>
          <short_desc>[sh4] ASSERTION FAILED in JIT</short_desc>
          <delta_ts>2013-10-07 09:58:10 -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>FIXED</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>0</everconfirmed>
          <reporter>yannick.poirier</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>jbriance</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>918619</commentid>
    <comment_count>0</comment_count>
    <who name="">yannick.poirier</who>
    <bug_when>2013-08-19 05:49:30 -0700</bug_when>
    <thetext>I&apos;m facing these assertion failure when launching peacekeeper ( http://peacekeeper.futuremark.com/ )
Webkit -r154268, sh4 JIT + DFG enabled.

ASSERTION FAILED: callee != callLinkInfo-&gt;callee.get()
webkit/Source/JavaScriptCore/jit/JITStubs.cpp(1340) : void* JSC::JITStubThunked_vm_lazyLinkClosureCall(void**)

#0  WTFCrash ()	at webkit/Source/WTF/wtf/Assertions.cpp:338
#1  0x2a2deae6 in JITStubThunked_vm_lazyLinkClosureCall	(args=0x59675918)
    at webkit/Source/JavaScriptCore/jit/JITStubs.cpp:1340
#2  0x2a2de8e8 in cti_vm_lazyLinkClosureCall ()	at webkit/Source/JavaScriptCore/jit/JITStubs.cpp:1322


ASSERTION FAILED: isUndefinedOrNull()
webkit/Source/JavaScriptCore/runtime/JSCJSValue.cpp(110) : JSC::JSObject* JSC::JSValue::synthesizePrototype(JSC::ExecState*) const

#0  WTFCrash () at /home/ypo/work/git/webkit/Source/WTF/wtf/Assertions.cpp:338
#1  0x29fbe6aa in JSC::JSValue::synthesizePrototype (this=0x596766e0, exec=0x6103e6f0)
    at webkit/Source/JavaScriptCore/runtime/JSCJSValue.cpp:110
#2  0x2a2265c8 in JSC::JSValue::get (this=0x596766e0, exec=0x6103e6f0, propertyName=..., slot=...)
    at webkit/Source/JavaScriptCore/runtime/JSCJSValueInlines.h:636
#3  0x2a2264bc in JSC::JSValue::get (this=0x596766e0, exec=0x6103e6f0, propertyName=...)
    at webkit/Source/JavaScriptCore/runtime/JSCJSValueInlines.h:625
#4  0x2a2e0286 in getByVal (callFrame=0x6103e6f0, baseValue=..., subscript=..., returnAddress=...)
    at webkit/Source/JavaScriptCore/jit/JITStubs.cpp:1556
#5  0x2a2e0814 in JITStubThunked_op_get_by_val_generic (args=0x5967676c)
    at webkit/Source/JavaScriptCore/jit/JITStubs.cpp:1616
#6  0x2a2e0750 in cti_op_get_by_val_generic () at webkit/Source/JavaScriptCore/jit/JITStubs.cpp:1605


Then peacekeeper test doesn&apos;t start anymore.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>918796</commentid>
    <comment_count>1</comment_count>
    <who name="Julien Brianceau">jbriance</who>
    <bug_when>2013-08-19 14:37:41 -0700</bug_when>
    <thetext>Hi, I have two questions:
- what port of WebKit do you use ?
- is it better if you disable the DFG ? (through &quot;JSC_useDFGJIT=false&quot; environment variable for instance)

I&apos;ll try to reproduce on my sh4 board tomorrow if I have time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>918963</commentid>
    <comment_count>2</comment_count>
    <who name="">yannick.poirier</who>
    <bug_when>2013-08-20 01:10:24 -0700</bug_when>
    <thetext>
Hi, 

I&apos;m using a custom port that we are developing internally. 
It uses WebCore + cairo + JavaScriptCore 

We keep JavaScriptCore unchanged

I&apos;ve tested with JSC_useDFGJIT=false
Only the second assert is happening

ASSERTION FAILED: isUndefinedOrNull()
webkit/Source/JavaScriptCore/runtime/JSCJSValue.cpp(110) : JSC::JSObject* JSC::JSValue::synthesizePrototype(JSC::ExecState*) cons

The benchmark starts properly</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>919013</commentid>
    <comment_count>3</comment_count>
    <who name="Julien Brianceau">jbriance</who>
    <bug_when>2013-08-20 05:25:15 -0700</bug_when>
    <thetext>Ok. I&apos;m able to reproduce the ASSERT failure with legitimately-captured-argument layout test. I don&apos;t know yet if this is a false positive (like https://bugs.webkit.org/show_bug.cgi?id=119794) or not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>919427</commentid>
    <comment_count>4</comment_count>
    <who name="Julien Brianceau">jbriance</who>
    <bug_when>2013-08-21 08:47:00 -0700</bug_when>
    <thetext>With the Qt port and using QtTestBrowser on my sh4 board, peacekeeper is crashing with current versions of WebKit (changeset 154379), whereas it was ok when using sh4 DFG before FTL merge + sh4 DFG implementation.

Is it possible for you to test with your port using sh4 DFG with a webkit without FTL merge (i.e. before changeset r153116) ?

You can find one here: https://gitorious.org/~jbrianceau/qtwebkit/jbrianceau-qt5x2, using commit id a16ebc421255106e22f7638b9082f6aebc583f7e</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>919754</commentid>
    <comment_count>5</comment_count>
    <who name="">yannick.poirier</who>
    <bug_when>2013-08-22 01:11:20 -0700</bug_when>
    <thetext>revision 154379:
JSC_useDFGJIT=true I&apos;ve got 2 asserts

ASSERTION FAILED: callee != callLinkInfo-&gt;callee.get()
ASSERTION FAILED: isUndefinedOrNull()

JSC_useDFGJIT=false I&apos;ve got 1 assert
ASSERTION FAILED: isUndefinedOrNull()

revision 153781:
DFG_JIT was not enabled, Only 1 assert
ASSERTION FAILED: isUndefinedOrNull()

I cannot easily come back prior r153116, I don&apos;t have a merge around this revision. I cannot test QtTestBrowser on my sh4 platform as we don&apos;t support Qt environment. 

After the ASSERTION FAILED: isUndefinedOrNull(), it crashes.
For now to avoid the crash I added these 2 lines in ExeceptionHandler.cpp:87

JSString* errorDescriptionForValue(ExecState* exec, JSValue v)
{
    VM&amp; vm = exec-&gt;vm();
    if(v.isEmpty())
        return vm.smallStrings.emptyString();
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>919755</commentid>
    <comment_count>6</comment_count>
    <who name="Julien Brianceau">jbriance</who>
    <bug_when>2013-08-22 01:19:55 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; After the ASSERTION FAILED: isUndefinedOrNull(), it crashes.
&gt; For now to avoid the crash I added these 2 lines in ExeceptionHandler.cpp:87
&gt; 
&gt; JSString* errorDescriptionForValue(ExecState* exec, JSValue v)
&gt; {
&gt;     VM&amp; vm = exec-&gt;vm();
&gt;     if(v.isEmpty())
&gt;         return vm.smallStrings.emptyString();
&gt; }

This is a workaround but not a fix, as JSValue should not be empty here.
Please take a look at https://bugs.webkit.org/show_bug.cgi?id=119812 and https://bugs.webkit.org/show_bug.cgi?id=120080 for further information.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921894</commentid>
    <comment_count>7</comment_count>
    <who name="Julien Brianceau">jbriance</who>
    <bug_when>2013-08-28 02:40:43 -0700</bug_when>
    <thetext>Yannick, could you test the patch I&apos;ve just submitted in https://bugs.webkit.org/show_bug.cgi?id=120080 and give your feedback please?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>922354</commentid>
    <comment_count>8</comment_count>
    <who name="">yannick.poirier</who>
    <bug_when>2013-08-29 00:49:36 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; Yannick, could you test the patch I&apos;ve just submitted in 

I&apos;ve tested the patch and confirm that ASSERTION FAILED: isUndefinedOrNull() is gone on peacekeeper. Nice work :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>935402</commentid>
    <comment_count>9</comment_count>
    <who name="">yannick.poirier</who>
    <bug_when>2013-10-02 06:42:16 -0700</bug_when>
    <thetext>Any news concerning ASSERTION FAILED: callee != callLinkInfo-&gt;callee.get() when DFG is enabled ?

When DFG is enabled, webkit still unstable on sh4 platform, this assert is happening quite often.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>935405</commentid>
    <comment_count>10</comment_count>
    <who name="Julien Brianceau">jbriance</who>
    <bug_when>2013-10-02 08:18:17 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; Any news concerning ASSERTION FAILED: callee != callLinkInfo-&gt;callee.get() when DFG is enabled ?
No, I didn&apos;t have time to dig into this yet. And to be honest, I&apos;m pretty sure I won&apos;t dig into this at all: as you probably know, the Qt port is moving out, including our sh4 bot (see https://bugs.webkit.org/show_bug.cgi?id=122167 and https://bugs.webkit.org/show_bug.cgi?id=122210).

&gt; When DFG is enabled, webkit still unstable on sh4 platform, this assert is happening quite often.
If you don&apos;t have time to investigate these unstabilities, you might want to disable the DFG_JIT for your sh4 platform then. Of course it will be slower, but you&apos;d still have LLINT &amp; JIT parts for sh4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>935726</commentid>
    <comment_count>11</comment_count>
    <who name="">yannick.poirier</who>
    <bug_when>2013-10-02 23:56:46 -0700</bug_when>
    <thetext>

I saw the news concerning QT. I did do the match with sh4. That&apos;s a bad news for me. But I would like to take over and start investigation myself. 

I&apos;m quite new with JavaScriptCore and don&apos;t have much experience with it. 
Can you give me advice on how to start:
It could be place where to start, JSC debug technique (specially on cross-compilation environment), documentation or everything you my think useful based on your own experience.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>935840</commentid>
    <comment_count>12</comment_count>
    <who name="Julien Brianceau">jbriance</who>
    <bug_when>2013-10-03 10:16:14 -0700</bug_when>
    <thetext>(In reply to comment #11)
&gt; But I would like to take over and start investigation myself. 
That&apos;s good to read :)

&gt; I&apos;m quite new with JavaScriptCore and don&apos;t have much experience with it. 
&gt; Can you give me advice on how to start:
&gt; It could be place where to start, JSC debug technique (specially on cross-compilation environment), documentation or everything you my think useful based on your own experience.
When I started working on sh4 parts of WebKit, there was no LLINT and no DFG_JIT backends for this architecture, and the baseline JIT was in a &quot;fallow&quot; state.
As there is no documentation about these parts of JavaScriptCore (from what I know), I try to understand it by myself and do my best to implement missing things while taking a look at what other 32-bit architectures do (mips &amp; arm).

My debug techniques: use Tools/Scripts/run-javascriptcore-tests and Tools/Scripts/run-fast-jsc scripts (you&apos;ll need a cross-compiled perl and python available on your sh4 target), using Release and Debug builds of jsc. The most important: gdb is your friend.

I know this is not so much information, but I&apos;m afraid I won&apos;t be able to give you more inputs :/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>936206</commentid>
    <comment_count>13</comment_count>
    <who name="">yannick.poirier</who>
    <bug_when>2013-10-04 08:52:18 -0700</bug_when>
    <thetext>I&apos;ve isolated the piece of code to easily reproduce the ASSERT

function fcnt() {}

for (var i = 0; i &lt; 10; ++i) {
    var f = function(){fcnt()};
    for (var j = 0; j &lt; 10; ++j)
    	var _av = eval(&quot;f()&quot;);
}


$&gt; bin/jsc test.js
ASSERTION FAILED: callee != callLinkInfo-&gt;callee.get()
webkit/Source/JavaScriptCore/jit/JITStubs.cpp(1331) : void* JSC::JITStubThunked_vm_lazyLinkClosureCall(void**)

#0  0x0043d13c in WTFCrash () at webkit/Source/WTF/wtf/Assertions.cpp:346
#1  0x004fc41e in JITStubThunked_vm_lazyLinkClosureCall (args=0x7bd0a5d0)
    at webkit/Source/JavaScriptCore/jit/JITStubs.cpp:1331
#2  0x004fc220 in cti_vm_lazyLinkClosureCall () at webkit/Source/JavaScriptCore/jit/JITStubs.cpp:1313

It works if
$&gt; bin/jsc --useDFGJIT=false test.js

Any hint would be welcomed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>937023</commentid>
    <comment_count>14</comment_count>
      <attachid>213577</attachid>
    <who name="Julien Brianceau">jbriance</who>
    <bug_when>2013-10-07 04:59:33 -0700</bug_when>
    <thetext>Created attachment 213577
Jump over maxJumpReplacementSize in revertJumpToMove implementation for sh4.

Thanks for the portion of code that isolates the issue. I&apos;ve been able to reproduce with my board.

This patch solves the ASSERT issue for me, could you please try it and give me your feedback ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>937056</commentid>
    <comment_count>15</comment_count>
    <who name="">yannick.poirier</who>
    <bug_when>2013-10-07 08:26:56 -0700</bug_when>
    <thetext>I&apos;ve tested the patch, 
I confirm that it solves the ASSERT.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>937082</commentid>
    <comment_count>16</comment_count>
    <who name="Julien Brianceau">jbriance</who>
    <bug_when>2013-10-07 09:08:14 -0700</bug_when>
    <thetext>(In reply to comment #15)
&gt; I&apos;ve tested the patch, 
&gt; I confirm that it solves the ASSERT.
Thanks for your feedback, I&apos;ll submit the patch for review.

I think it would be easier to talk about details of sh4 port on IRC. I&apos;m available in #webkit and #qtwebkit channels during office hours (Paris time).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>937107</commentid>
    <comment_count>17</comment_count>
      <attachid>213577</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-10-07 09:58:07 -0700</bug_when>
    <thetext>Comment on attachment 213577
Jump over maxJumpReplacementSize in revertJumpToMove implementation for sh4.

Clearing flags on attachment: 213577

Committed r157046: &lt;http://trac.webkit.org/changeset/157046&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>937108</commentid>
    <comment_count>18</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-10-07 09:58:10 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>213577</attachid>
            <date>2013-10-07 04:59:33 -0700</date>
            <delta_ts>2013-10-07 09:58:07 -0700</delta_ts>
            <desc>Jump over maxJumpReplacementSize in revertJumpToMove implementation for sh4.</desc>
            <filename>bug-120007.patch</filename>
            <type>text/plain</type>
            <size>1870</size>
            <attacher name="Julien Brianceau">jbriance</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTU3MDMyKQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE2IEBA
CisyMDEzLTEwLTA3ICBKdWxpZW4gQnJpYW5jZWF1ICA8amJyaWFuY2VAY2lzY28uY29tPgorCisg
ICAgICAgIFtzaDRdIEp1bXAgb3ZlciBtYXhKdW1wUmVwbGFjZW1lbnRTaXplIGluIHJldmVydEp1
bXBUb01vdmUuCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9p
ZD0xMjAwMDcKKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAg
ICBKdW1wIG92ZXIgbWF4SnVtcFJlcGxhY2VtZW50U2l6ZSBpbiByZXZlcnRKdW1wVG9Nb3ZlLCBl
dmVuIGlmIHRoZXJlIGlzIG5vIGNvbnN0YW50CisgICAgICAgIHZhbHVlIHdpdGhpbiB0aGUgYXJl
YS4gVGhpcyBwYXRjaCBmaXhlcyBkZWJ1ZyBBU1NFUlRzIGZhaWx1cmVzIGZvciBzaDQgYXJjaGl0
ZWN0dXJlLgorCisgICAgICAgICogYXNzZW1ibGVyL1NINEFzc2VtYmxlci5oOgorICAgICAgICAo
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gICAgICBpbnNuWzFdID0gZ2V0T3Bjb2Rl
R3JvdXA2KEJSQV9PUENPREUsIDMpOwotICAgICAgICBlbHNlCi0gICAgICAgICAgICBpbnNuWzFd
ID0gTk9QX09QQ09ERTsKLQotICAgICAgICBpbnNuWzJdID0gTk9QX09QQ09ERTsKLSAgICAgICAg
Y2FjaGVGbHVzaCgmaW5zblsxXSwgMiAqIHNpemVvZihTSDRXb3JkKSk7CisgICAgICAgICAgICBp
bnNuWzJdID0gTk9QX09QQ09ERTsKKyAgICAgICAgICAgIGNhY2hlRmx1c2goJmluc25bMV0sIDIg
KiBzaXplb2YoU0g0V29yZCkpOworICAgICAgICB9CiAKICAgICAgICAgY2hhbmdlUENyZWxhdGl2
ZUFkZHJlc3MoaW5zblswXSAmIDB4MDBmZiwgaW5zbiwgaW1tKTsKICAgICB9Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>