<?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>103146</bug_id>
          
          <creation_ts>2012-11-23 08:16:33 -0800</creation_ts>
          <short_desc>ARMv7 replaceWithJump ASSERT failure after r135330.</short_desc>
          <delta_ts>2013-03-21 11:17:32 -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>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>
          
          <blocked>108645</blocked>
    
    <blocked>102662</blocked>
    
    <blocked>103747</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Balazs Kilvady">kilvadyb</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>allan.jensen</cc>
    
    <cc>barraclough</cc>
    
    <cc>cgarcia</cc>
    
    <cc>ctruta</cc>
    
    <cc>fpizlo</cc>
    
    <cc>fu</cc>
    
    <cc>galpeter</cc>
    
    <cc>gergely</cc>
    
    <cc>noam</cc>
    
    <cc>oliver</cc>
    
    <cc>ossy</cc>
    
    <cc>palfia</cc>
    
    <cc>rgabor</cc>
    
    <cc>webkit.review.bot</cc>
    
    <cc>xan.lopez</cc>
    
    <cc>zherczeg</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>774573</commentid>
    <comment_count>0</comment_count>
    <who name="Balazs Kilvady">kilvadyb</who>
    <bug_when>2012-11-23 08:16:33 -0800</bug_when>
    <thetext>Running v8 test v7 with jsc in debug mode on our ARMv7 board I received this ASSERT failure:

Starting program: /data/kilvadyb/webkit-arm/webkit/WebKitBuild/Debug/bin/jsc run.js
[Thread debugging using libthread_db enabled]
[New Thread 0x42dc4400 (LWP 1111)]
Richards: 161
DeltaBlue: 21.8
Crypto: 110
RayTrace: 101
ASSERTION FAILED: canBeJumpT4(instruction, target)
/data/kilvadyb/webkit-arm/webkit/Source/JavaScriptCore/assembler/ARMv7Assembler.h(2475) : static void JSC::ARMv7Assembler::linkJumpT4(uint16_t*, void*)

Program received signal SIGSEGV, Segmentation fault.
0x4040b38c in JSC::ARMv7Assembler::linkJumpT4 (instruction=0x455695f6, target=0x43599dc0)
    at /data/kilvadyb/webkit-arm/webkit/Source/JavaScriptCore/assembler/ARMv7Assembler.h:2475
2475	        ASSERT(canBeJumpT4(instruction, target));
(gdb)

I had similar problem on MIPS where a replaceWithJump would be easier to implement with direct jump instead of jump via register.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>774718</commentid>
    <comment_count>1</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2012-11-23 15:23:20 -0800</bug_when>
    <thetext>(In reply to comment #0)
&gt; Running v8 test v7 with jsc in debug mode on our ARMv7 board I received this ASSERT failure:
&gt; 
&gt; Starting program: /data/kilvadyb/webkit-arm/webkit/WebKitBuild/Debug/bin/jsc run.js
&gt; [Thread debugging using libthread_db enabled]
&gt; [New Thread 0x42dc4400 (LWP 1111)]
&gt; Richards: 161
&gt; DeltaBlue: 21.8
&gt; Crypto: 110
&gt; RayTrace: 101
&gt; ASSERTION FAILED: canBeJumpT4(instruction, target)
&gt; /data/kilvadyb/webkit-arm/webkit/Source/JavaScriptCore/assembler/ARMv7Assembler.h(2475) : static void JSC::ARMv7Assembler::linkJumpT4(uint16_t*, void*)
&gt; 
&gt; Program received signal SIGSEGV, Segmentation fault.
&gt; 0x4040b38c in JSC::ARMv7Assembler::linkJumpT4 (instruction=0x455695f6, target=0x43599dc0)
&gt;     at /data/kilvadyb/webkit-arm/webkit/Source/JavaScriptCore/assembler/ARMv7Assembler.h:2475
&gt; 2475            ASSERT(canBeJumpT4(instruction, target));
&gt; (gdb)
&gt; 
&gt; I had similar problem on MIPS where a replaceWithJump would be easier to implement with direct jump instead of jump via register.

Actually, it looks like that assert is just wrong. I&apos;ll look more in a bit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>774822</commentid>
    <comment_count>2</comment_count>
    <who name="Balazs Kilvady">kilvadyb</who>
    <bug_when>2012-11-24 07:06:30 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; (In reply to comment #0)
&gt; &gt; Running v8 test v7 with jsc in debug mode on our ARMv7 board I received this ASSERT failure:
&gt; &gt; 
&gt; &gt; Starting program: /data/kilvadyb/webkit-arm/webkit/WebKitBuild/Debug/bin/jsc run.js
&gt; &gt; [Thread debugging using libthread_db enabled]
&gt; &gt; [New Thread 0x42dc4400 (LWP 1111)]
&gt; &gt; Richards: 161
&gt; &gt; DeltaBlue: 21.8
&gt; &gt; Crypto: 110
&gt; &gt; RayTrace: 101
&gt; &gt; ASSERTION FAILED: canBeJumpT4(instruction, target)
&gt; &gt; /data/kilvadyb/webkit-arm/webkit/Source/JavaScriptCore/assembler/ARMv7Assembler.h(2475) : static void JSC::ARMv7Assembler::linkJumpT4(uint16_t*, void*)
&gt; &gt; 
&gt; &gt; Program received signal SIGSEGV, Segmentation fault.
&gt; &gt; 0x4040b38c in JSC::ARMv7Assembler::linkJumpT4 (instruction=0x455695f6, target=0x43599dc0)
&gt; &gt;     at /data/kilvadyb/webkit-arm/webkit/Source/JavaScriptCore/assembler/ARMv7Assembler.h:2475
&gt; &gt; 2475            ASSERT(canBeJumpT4(instruction, target));
&gt; &gt; (gdb)
&gt; &gt; 
&gt; &gt; I had similar problem on MIPS where a replaceWithJump would be easier to implement with direct jump instead of jump via register.
&gt; 
&gt; Actually, it looks like that assert is just wrong. I&apos;ll look more in a bit.

Thank you for checking it. On MIPS I have this problem (at exactly the same test step) when the &quot;jump to a direct address&quot; one word (4 bytes) instruction has boundaries and the target address of the jump is out of these boundaries. I guess the same happens on ARM when the target range of T4 type jump is not enough. On MIPS I could use
target -&gt; register
jump via register
but it would take 4 word (4 bytes == word) instructions so replaceWithJump might overwrite some useful already generated instructions and it would cause problems when replace-jump code should be reverted. I could solve it only with using nop instruction words to make place the 4 words replace-jump to make it possible to revert.

On MIPS the usually replaced/overwritten code:
lui t0, 0xXXXX
ori t0, t0, 0xYYYY
bne t0, t4, address
nop

(The same usually replaced code on ARM:
movw r12, YYYY
movt r12, XXXX
cmp r12, rN
bne address
)

and the jump via register:

lui t0, 0xXXXX
ori t0, t0, 0xXXXX
jr t0
nop ; necessary in &quot;jump/branch slot&quot;.

So this kind of jump replacement overwrites the &quot;bne reg1, reg0, address&quot; instruction and address value would be lost.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>843975</commentid>
    <comment_count>3</comment_count>
    <who name="Xan Lopez">xan.lopez</who>
    <bug_when>2013-02-28 04:21:53 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; (In reply to comment #0)
&gt; &gt; Running v8 test v7 with jsc in debug mode on our ARMv7 board I received this ASSERT failure:
&gt; &gt; 
&gt; &gt; Starting program: /data/kilvadyb/webkit-arm/webkit/WebKitBuild/Debug/bin/jsc run.js
&gt; 
&gt; Actually, it looks like that assert is just wrong. I&apos;ll look more in a bit.

I get exactly the same behavior by reverting the entire patch or commenting that single ASSERT, so indeed it seems we are ASSERTing the wrong thing in there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>853198</commentid>
    <comment_count>4</comment_count>
    <who name="Gabor Rapcsanyi">rgabor</who>
    <bug_when>2013-03-12 01:53:03 -0700</bug_when>
    <thetext>Is there any progress on this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>854291</commentid>
    <comment_count>5</comment_count>
    <who name="Zoltan Herczeg">zherczeg</who>
    <bug_when>2013-03-13 07:48:16 -0700</bug_when>
    <thetext>Hey Filip,

it seems many systems are plagued by this issue, and we need some help to fix it. The issue is that replaceWithJump() always use linkJumpT4(), which is limited to 4 byte long instruction space. Instead we need something like in linkJumpAbsolute() 10 byte long space area for doing a jump. I don&apos;t really understand why linkJump* functions uses instruction indexes below zero. Is it safe to use 5 instructions in replaceWithJump?

This is the backtrace. It is clear that target-instruction is bigger than the allowed 24 bit difference:

#0 0x000675f4 in JSC::ARMv7Assembler::linkJumpT4 (instruction=0xb4902a76, target=0xb6fd3f80)
at /home/rgabor/commit/DFG/Source/JavaScriptCore/assembler/ARMv7Assembler.h:2521
#1 0x00199174 in JSC::ARMv7Assembler::replaceWithJump (instructionStart=0xb4902a72, to=0xb6fd3f80)
at /home/rgabor/commit/DFG/Source/JavaScriptCore/assembler/ARMv7Assembler.h:2165
#2 0x001995b2 in JSC::MacroAssemblerARMv7::replaceWithJump (instructionStart=..., destination=...)
at /home/rgabor/commit/DFG/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h:1230
#3 0x0019b098 in JSC::RepatchBuffer::replaceWithJump (this=0xbeffea48, instructionStart=..., destination=...)
at /home/rgabor/commit/DFG/Source/JavaScriptCore/assembler/RepatchBuffer.h:156
#4 0x0020d074 in JSC::JIT::privateCompileClosureCall (this=0xbeffeb40, callLinkInfo=0x7be514, calleeCodeBlock=0x7b9940, expectedStructure=0xb493f878,
expectedExecutable=0xb42b8d78, codePtr=...) at /home/rgabor/commit/DFG/Source/JavaScriptCore/jit/JITCall32_64.cpp:348</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>857108</commentid>
    <comment_count>6</comment_count>
      <attachid>193562</attachid>
    <who name="Zoltan Herczeg">zherczeg</who>
    <bug_when>2013-03-18 07:45:46 -0700</bug_when>
    <thetext>Created attachment 193562
patch for ARMv7</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>857273</commentid>
    <comment_count>7</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2013-03-18 10:30:08 -0700</bug_when>
    <thetext>*** Bug 111704 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>857281</commentid>
    <comment_count>8</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2013-03-18 10:33:50 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; Created an attachment (id=193562) [details]
&gt; patch for ARMv7

It fixes the inspector crashes mentioned in https://bugs.webkit.org/show_bug.cgi?id=111704: 

http://build.webkit.sed.hu/builders/ARMv7%20Linux%20Qt5%20Release%20%28Test%29/builds/8083</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>859468</commentid>
    <comment_count>9</comment_count>
    <who name="Balazs Kilvady">kilvadyb</who>
    <bug_when>2013-03-20 09:02:16 -0700</bug_when>
    <thetext>*** Bug 112816 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>859757</commentid>
    <comment_count>10</comment_count>
    <who name="Zoltan Herczeg">zherczeg</who>
    <bug_when>2013-03-20 14:48:00 -0700</bug_when>
    <thetext>I would be grateful if somebody would review this patch. Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>859762</commentid>
    <comment_count>11</comment_count>
    <who name="Xan Lopez">xan.lopez</who>
    <bug_when>2013-03-20 14:56:40 -0700</bug_when>
    <thetext>(In reply to comment #10)
&gt; I would be grateful if somebody would review this patch. Thanks.

FWIW I was seeing this crash in QNX, not Linux, so I suspect the fix should be more generic.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>859775</commentid>
    <comment_count>12</comment_count>
      <attachid>193562</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2013-03-20 15:09:46 -0700</bug_when>
    <thetext>Comment on attachment 193562
patch for ARMv7

Clearing flags on attachment: 193562

Committed r146396: &lt;http://trac.webkit.org/changeset/146396&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>859776</commentid>
    <comment_count>13</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2013-03-20 15:09:53 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>859992</commentid>
    <comment_count>14</comment_count>
    <who name="Zoltan Herczeg">zherczeg</who>
    <bug_when>2013-03-20 20:58:54 -0700</bug_when>
    <thetext>&gt; FWIW I was seeing this crash in QNX, not Linux, so I suspect the fix should be more generic.

Did you try the patch? Does it fix your platform? If so, we can make it more generic by adding your OS to the list.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>860028</commentid>
    <comment_count>15</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2013-03-20 22:15:19 -0700</bug_when>
    <thetext>(In reply to comment #14)
&gt; &gt; FWIW I was seeing this crash in QNX, not Linux, so I suspect the fix should be more generic.
&gt; 
&gt; Did you try the patch? Does it fix your platform? If so, we can make it more generic by adding your OS to the list.

I think that the reason why you guys are seeing this badness is that you&apos;re using the ExecutableAllocator and not ExecutableAllocatorFixedVMPool, or whatever it is called.

We used the FixedVMPool on both X86_64 and ARMv7.  We do it for two simple reasons:

- About ~16MB is more than enough, since JSC only JITs things when it absolutely needs to.

- Having all JIT memory within a confined pool means that we can consistently use compact jumps.

Maybe the right thing for y&apos;all is to switch to using the fixed VM pool?

Maybe the right thing for the project is to switch *everything* over to the fixed pool, including x86-32, so we can simplify the code and all share the invariant that for a given JSGlobalData, any two slabs of JIT code will always be within a small enough distance from each other that a relatively compact jump can be emitted?  (Note that for example the choice of 16MB on ARMv7, and 1GB on X86_64, is a direct consequent of the largest jumpable distance using a single jump instruction, on those platforms.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>860200</commentid>
    <comment_count>16</comment_count>
    <who name="Zoltan Herczeg">zherczeg</who>
    <bug_when>2013-03-21 04:15:21 -0700</bug_when>
    <thetext>&gt; Maybe the right thing for y&apos;all is to switch to using the fixed VM pool?

I have no objections. We will try this pool in due course, and let you know whether it works.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>860228</commentid>
    <comment_count>17</comment_count>
    <who name="Xan Lopez">xan.lopez</who>
    <bug_when>2013-03-21 05:02:48 -0700</bug_when>
    <thetext>(In reply to comment #14)
&gt; &gt; FWIW I was seeing this crash in QNX, not Linux, so I suspect the fix should be more generic.
&gt; 
&gt; Did you try the patch? Does it fix your platform? If so, we can make it more generic by adding your OS to the list.

Nope, I haven&apos;t, but if I read it right most of the changes are guarded by OS(LINUX) stuff. I guess maybe the nowp() thing should work, since is the only generic change? Anyway I&apos;ll try to test it ASAP.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>860482</commentid>
    <comment_count>18</comment_count>
    <who name="Cosmin Truta">ctruta</who>
    <bug_when>2013-03-21 11:17:32 -0700</bug_when>
    <thetext>(In reply to comment #17)
&gt; &gt; Did you try the patch? Does it fix your platform? If so, we can make it more generic by adding your OS to the list.
&gt; 
&gt; Nope, I haven&apos;t, but if I read it right most of the changes are guarded by OS(LINUX) stuff. I guess maybe the nowp() thing should work, since is the only generic change? Anyway I&apos;ll try to test it ASAP.

Indeed, I added OS(QNX) besides OS(LINUX), and that solved the problem. See bug 112863.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>193562</attachid>
            <date>2013-03-18 07:45:46 -0700</date>
            <delta_ts>2013-03-20 15:09:45 -0700</delta_ts>
            <desc>patch for ARMv7</desc>
            <filename>arm.patch</filename>
            <type>text/plain</type>
            <size>5693</size>
            <attacher name="Zoltan Herczeg">zherczeg</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cgYi9Tb3VyY2UvSmF2
YVNjcmlwdENvcmUvQ2hhbmdlTG9nCmluZGV4IGFmMzY0OTAuLjkwMWMyYjUgMTAwNjQ0Ci0t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TFkoc3RhdGljX2Nhc3Q8aW50PihyZXN1bHQubV9vZmZzZXQpICsg
NCA8PSBtX2luZGV4T2ZUYWlsT2ZMYXN0V2F0Y2hwb2ludCkpCisgICAgICAgICAgICAgICAgbm9w
dygpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIG5vcCgpOwogICAgICAgICAg
ICAgcmVzdWx0ID0gbV9mb3JtYXR0ZXIubGFiZWwoKTsKICAgICAgICAgfQogICAgICAgICByZXR1
cm4gcmVzdWx0OwpAQCAtMjE2MCwxNSArMjE4MywzMSBAQCBwdWJsaWM6CiAgICAgewogICAgICAg
ICBBU1NFUlQoIShiaXR3aXNlX2Nhc3Q8dWludHB0cl90PihpbnN0cnVjdGlvblN0YXJ0KSAmIDEp
KTsKICAgICAgICAgQVNTRVJUKCEoYml0d2lzZV9jYXN0PHVpbnRwdHJfdD4odG8pICYgMSkpOwor
CisjaWYgT1MoTElOVVgpCisgICAgICAgIGlmIChjYW5CZUp1bXBUNChyZWludGVycHJldF9jYXN0
PHVpbnQxNl90Kj4oaW5zdHJ1Y3Rpb25TdGFydCksIHRvKSkgeworICAgICAgICAgICAgdWludDE2
X3QqIHB0ciA9IHJlaW50ZXJwcmV0X2Nhc3Q8dWludDE2X3QqPihpbnN0cnVjdGlvblN0YXJ0KSAr
IDI7CisgICAgICAgICAgICBsaW5rSnVtcFQ0KHB0ciwgdG8pOworICAgICAgICAgICAgY2FjaGVG
bHVzaChwdHIgLSAyLCBzaXplb2YodWludDE2X3QpICogMik7CisgICAgICAgIH0gZWxzZSB7Cisg
ICAgICAgICAgICB1aW50MTZfdCogcHRyID0gcmVpbnRlcnByZXRfY2FzdDx1aW50MTZfdCo+KGlu
c3RydWN0aW9uU3RhcnQpICsgNTsKKyAgICAgICAgICAgIGxpbmtCWChwdHIsIHRvKTsKKyAgICAg
ICAgICAgIGNhY2hlRmx1c2gocHRyIC0gNSwgc2l6ZW9mKHVpbnQxNl90KSAqIDUpOworICAgICAg
ICB9C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