<?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>146629</bug_id>
          
          <creation_ts>2015-07-06 02:26:35 -0700</creation_ts>
          <short_desc>[MIPS] webkitgtk crashed if JIT is enabled</short_desc>
          <delta_ts>2016-09-08 01:31: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>Other</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 name="Jeffrey">Jeffrey.li</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>annulen</cc>
    
    <cc>cgarcia</cc>
    
    <cc>fpizlo</cc>
    
    <cc>guijemont</cc>
    
    <cc>jbriance</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>ossy</cc>
    
    <cc>zan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1107060</commentid>
    <comment_count>0</comment_count>
    <who name="Jeffrey">Jeffrey.li</who>
    <bug_when>2015-07-06 02:26:35 -0700</bug_when>
    <thetext>Webkitgtk crashed when I run the javascript test. The backtrace and some gdb information list below.

warning: Could not load shared library symbols for 82 libraries, e.g. /usr/lib/libwebkitgtk-1.0.so.0.
Use the &quot;info sharedlibrary&quot; command to see the complete listing.
Do you need &quot;set solib-search-path&quot; or &quot;set sysroot&quot;?
Core was generated by `/usr/local/bin/otvwebkit http://10.12.2.99/testcase/regression/testcase.html&apos;.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x759f4e08 in ?? ()
(gdb) bt
#0  0x759f4e08 in llint_op_push_name_scope () from /home/otv5/otv5/jeli_pc2/DEVELOP/OTV_WebKit/otvwebkit2.0/otvtarg/tc7356_uclibc_bc/sdk_all/target/usr/lib/libjavascriptcoregtk-1.0.so.0
#1  0x759f4e00 in llint_op_pop_scope () from /home/otv5/otv5/jeli_pc2/DEVELOP/OTV_WebKit/otvwebkit2.0/otvtarg/tc7356_uclibc_bc/sdk_all/target/usr/lib/libjavascriptcoregtk-1.0.so.0
Backtrace stopped: frame did not save the PC
(gdb) i reg
          zero       at       v0       v1       a0       a1       a2       a3
 R0   00000000 00000001 6bfbfd40 fffffffb 6c3e2fa8 7262de0c 759f2bac 72642978
            t0       t1       t2       t3       t4       t5       t6       t7
 R8   fffffffa fffffffb fffffffe fffffffb 726112f4 00000004 ecb5a59f 6c3e2f98
            s0       s1       s2       s3       s4       s5       s6       s7
 R16  7f8e1258 7260b000 7262de0c 7260b000 6c1b91a8 6bf5fa68 72642960 7260b000
            t8       t9       k0       k1       gp       sp       s8       ra
 R24  6c3e2f98 759f2bac 00000000 00000000 6c1b91a8 7f8e0d00 6c3e2fa8 759f4e00
            sr       lo       hi      bad    cause       pc
      00008713 00000004 00000000 6c1b18c0 00800008 759f4e08
           fsr      fir
      88800004 00000000
(gdb) x/16i llint_op_push_name_scope
   0x759f4e00 &lt;llint_op_push_name_scope&gt;:       move    a0,s8
   0x759f4e04 &lt;llint_op_push_name_scope+4&gt;:     move    a1,s2
=&gt; 0x759f4e08 &lt;llint_op_push_name_scope+8&gt;:     lw      t9,-30952(gp)
   0x759f4e0c &lt;llint_op_push_name_scope+12&gt;:    bal     0x759eac98 &lt;llint_slow_path_push_name_scope&gt;
   0x759f4e10 &lt;llint_op_push_name_scope+16&gt;:    nop
   0x759f4e14 &lt;llint_op_push_name_scope+20&gt;:    move    gp,s4
   0x759f4e18 &lt;llint_op_push_name_scope+24&gt;:    move    s2,v0
   0x759f4e1c &lt;llint_op_push_name_scope+28&gt;:    move    s8,v1
   0x759f4e20 &lt;llint_op_push_name_scope+32&gt;:    addiu   s2,s2,16
   0x759f4e24 &lt;llint_op_push_name_scope+36&gt;:    lw      ra,0(s2)
   0x759f4e28 &lt;llint_op_push_name_scope+40&gt;:    jr      ra
   0x759f4e2c &lt;llint_op_push_name_scope+44&gt;:    nop
   0x759f4e30 &lt;llint_op_throw&gt;: move    a0,s8
   0x759f4e34 &lt;llint_op_throw+4&gt;:       move    a1,s2
   0x759f4e38 &lt;llint_op_throw+8&gt;:       lw      t9,-30948(gp)
   0x759f4e3c &lt;llint_op_throw+12&gt;:      bal     0x759e9864 &lt;llint_slow_path_throw&gt;
   0x759f4e40 &lt;llint_op_throw+16&gt;:      nop
(gdb)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1107061</commentid>
    <comment_count>1</comment_count>
      <attachid>256203</attachid>
    <who name="Jeffrey">Jeffrey.li</who>
    <bug_when>2015-07-06 02:29:24 -0700</bug_when>
    <thetext>Created attachment 256203
test case for this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1107318</commentid>
    <comment_count>2</comment_count>
      <attachid>256268</attachid>
    <who name="Jeffrey">Jeffrey.li</who>
    <bug_when>2015-07-06 18:04:57 -0700</bug_when>
    <thetext>Created attachment 256268
proposed patch

On MIPS platform, function llint_op_catch() use RA register to compute gp pointor. JSC::CCallHelpers::jumpToExceptionHandler() use T9 register. It will cause a invalid gp pointer when jump to llint_op_catch().
My patch load the function address to RA first. Then copy it to T9 and jump.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1151639</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2015-12-30 15:26:10 -0800</bug_when>
    <thetext>Guillaume, this look OK? You didn&apos;t run into this issue...?

(In reply to comment #1)
&gt; Created attachment 256203 [details]
&gt; test case for this issue.

Great. This should probably be added as a testcase under LayoutTests/js.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1156499</commentid>
    <comment_count>4</comment_count>
    <who name="Guillaume Emont">guijemont</who>
    <bug_when>2016-01-18 18:21:32 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; Guillaume, this look OK? You didn&apos;t run into this issue...?

I did not run into this issue (yet?), maybe because I&apos;ve mainly worked with jsc only (only compiling WTF/ and JavaScriptCore/).
I am a little confused by the patch though. I understand that $gp is computed by the code of .cpload (emitted by offlineasm for each label), which uses $t9. I don&apos;t understand how this is different for llint_op_catch(), though I didn&apos;t study the exception code/protocol, and I have a feeling that this is not your regular function, and there might be something done with $ra that I did not understand.

&gt; (In reply to comment #1)
&gt; &gt; Created attachment 256203 [details]
&gt; &gt; test case for this issue.
&gt; 
&gt; Great. This should probably be added as a testcase under LayoutTests/js.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1210955</commentid>
    <comment_count>5</comment_count>
      <attachid>256268</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-07-14 05:35:09 -0700</bug_when>
    <thetext>Comment on attachment 256268
proposed patch

Jeffrey, could you respond to Guillaume&apos;s questions here? Resetting the request flags in the meantime.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1227567</commentid>
    <comment_count>6</comment_count>
    <who name="Jeffrey">Jeffrey.li</who>
    <bug_when>2016-09-08 01:31:10 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; Guillaume, this look OK? You didn&apos;t run into this issue...?
&gt; 
&gt; I did not run into this issue (yet?), maybe because I&apos;ve mainly worked with
&gt; jsc only (only compiling WTF/ and JavaScriptCore/).
&gt; I am a little confused by the patch though. I understand that $gp is
&gt; computed by the code of .cpload (emitted by offlineasm for each label),
&gt; which uses $t9. I don&apos;t understand how this is different for
&gt; llint_op_catch(), though I didn&apos;t study the exception code/protocol, and I
&gt; have a feeling that this is not your regular function, and there might be
&gt; something done with $ra that I did not understand.
&gt; 
&gt; &gt; (In reply to comment #1)
&gt; &gt; &gt; Created attachment 256203 [details]
&gt; &gt; &gt; test case for this issue.
&gt; &gt; 
&gt; &gt; Great. This should probably be added as a testcase under LayoutTests/js.

The .cpload uses $ra register to compute the $gp value. The jumpToExceptionHandler() uses $t9 as jump register now. Then in llint_op_catch() function, $ra will get a incorrect value. This will cause the $gp value is incorrect too.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>256203</attachid>
            <date>2015-07-06 02:29:24 -0700</date>
            <delta_ts>2015-07-06 02:29:24 -0700</delta_ts>
            <desc>test case for this issue.</desc>
            <filename>testcase_for_146629.html</filename>
            <type>text/html</type>
            <size>588</size>
            <attacher name="Jeffrey">Jeffrey.li</attacher>
            
              <data encoding="base64">PGh0bWw+Cjxib2R5ID4KPGNlbnRlcj4KPGgxPnRlc3QgcmVzdWx0PC9oMT4KPHNjcmlwdCB0eXBl
PSJ0ZXh0L2phdmFzY3JpcHQiPgoKInVzZSBzdHJpY3QiOwp2YXIgcG9pc29uID0gT2JqZWN0Lmdl
dE93blByb3BlcnR5RGVzY3JpcHRvcihmdW5jdGlvbigpIHt9LCAnY2FsbGVyJykuZ2V0OwppZiAo
dHlwZW9mIHBvaXNvbiAhPT0gJ2Z1bmN0aW9uJykgewogIGRvY3VtZW50LndyaXRlKCJGQUlMRUQ6
QSBzdHJpY3QgZnVuY3Rpb24ncyAuY2FsbGVyIHNob3VsZCBiZSBwb2lzb25lZCB3aXRoIGEgZnVu
Y3Rpb24iICsiPGJyIC8+Iik7Cn0KdmFyIHRocmV3ID0gbnVsbDsKdHJ5IHsKICBwb2lzb24oKTsK
fSBjYXRjaCAoZXJyKSB7CiAgdGhyZXcgPSBlcnI7Cn0KCmlmICghdGhyZXcgfHwgISh0aHJldyBp
bnN0YW5jZW9mIFR5cGVFcnJvcikpIHsKICBkb2N1bWVudC53cml0ZSgiRkFJTEVEOlBvaXNvbmVk
IHByb3BlcnR5IHNob3VsZCB0aHJvdyBUeXBlRXJyb3IiICsiPGJyIC8+Iik7Cn0gZWxzZSB7CiAg
ZG9jdW1lbnQud3JpdGUoIlBBU1MiICsiPGJyIC8+Iik7Cn0KCgo8L3NjcmlwdD4KPC9jZW50ZXI+
CjwvYm9keT4KPC9odG1sPgoK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>256268</attachid>
            <date>2015-07-06 18:04:57 -0700</date>
            <delta_ts>2016-07-14 05:35:09 -0700</delta_ts>
            <desc>proposed patch</desc>
            <filename>BugID_146629.patch</filename>
            <type>text/plain</type>
            <size>1425</size>
            <attacher name="Jeffrey">Jeffrey.li</attacher>
            
              <data encoding="base64">SW5kZXg6IENoYW5nZUxvZw0KPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KLS0tIENoYW5nZUxvZwkocmV2aXNpb24gMTg2
MzA3KQ0KKysrIENoYW5nZUxvZwkod29ya2luZyBjb3B5KQ0KQEAgLTEsMyArMSwxNSBAQA0KKzIw
MTUtMDctMDYgIEplZmZyZXkgTGkgPGplZmZyZXkubGlAbmFncmEuY29tPgorCisgICAgICAgIFtN
SVBTXSB3ZWJraXRndGsgY3Jhc2hlZCBpZiBKSVQgaXMgZW5hYmxlZAorICAgICAgICBodHRwczov
L2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTQ2NjI5CisKKyAgICAgICAgUmV2aWV3
ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgVXNlIFJBIHJlZ2lzdGVyIHdoZW4ganVt
cCB0byBleGNlcHRpb24gaGFuZGxlciBvbiBNSVBTIHBsYXRmb3JtLgorCisgICAgICAgICogaml0
L0NDYWxsSGVscGVycy5oOgorICAgIC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lCiAgICAgICAgIGxvYWRQdHIo
JnZtKCktPnRhcmdldE1hY2hpbmVQQ0ZvclRocm93LCBHUFJJbmZvOjpyZWdUMSk7CiAgICAgICAg
IGp1bXAoR1BSSW5mbzo6cmVnVDEpOworI2VuZGlmIC8vIENQVShNSVBTKQogICAgIH0KIH07CiAK
</data>

          </attachment>
      

    </bug>

</bugzilla>