<?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>122665</bug_id>
          
          <creation_ts>2013-10-11 11:29:57 -0700</creation_ts>
          <short_desc>Intermittent Trap 5 (int $3) in get_by_val (or GetByVal) from an Int32 array in sunspider-1.0/math-spectral-norm.js.dfg-eager</short_desc>
          <delta_ts>2013-10-11 12:30:25 -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>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>122462</dup_id>
          
          <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="Filip Pizlo">fpizlo</reporter>
          <assigned_to name="Filip Pizlo">fpizlo</assigned_to>
          <cc>ap</cc>
    
    <cc>barraclough</cc>
    
    <cc>ggaren</cc>
    
    <cc>mark.lam</cc>
    
    <cc>mhahnenberg</cc>
    
    <cc>msaboff</cc>
    
    <cc>oliver</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>938892</commentid>
    <comment_count>0</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2013-10-11 11:29:57 -0700</bug_when>
    <thetext>Here&apos;s the machine code, it looks like it&apos;s gotta be a get_by_val int32 load stub in the baseline JIT, or a GetByVal in the DFG.  Not sure which it is.

   0x3576f7a051dc:  movq   8(%rax), %rdx
   0x3576f7a051e0:  movl   -56(%r13), %ecx
   0x3576f7a051e4:  cmpl   -8(%rdx), %ecx
   0x3576f7a051e7:  jae    0x3576f7a05632
   0x3576f7a051ed:  movq   (%rdx,%rcx,8), %rbx
   0x3576f7a051f1:  testq  %rbx, %rbx
   0x3576f7a051f4:  je     0x3576f7a05653
   0x3576f7a051fa:  cmpq   %r14, %rbx
   0x3576f7a051fd:  jae    0x3576f7a05204
   0x3576f7a05203:  int3   
-&gt; 0x3576f7a05204:  cvtsi2sdl %ebx, %xmm1
   0x3576f7a05208:  mulsd  %xmm1, %xmm2

The reason why we trap is that we load this garbage from the array:

(lldb) register read
General Purpose Registers:
       rax = 0x000000010471fe80
       rbx = 0x40657d68d5cbd169
       rcx = 0x0000000000000000
       rdx = 0x00000001017b2428
       rdi = 0x0000000000000006
       rsi = 0x00003576f7a0501f
       rbp = 0x00007fff5fbfdfe0
       rsp = 0x00007fff5fbfdf40
        r8 = 0x0000000000000040
        r9 = 0x00007fff5fbfda00
       r10 = 0x00003576f7a04c22
       r11 = 0x00000000ffffffff
       r12 = 0x0000000000000200
       r13 = 0x00000001046ffe68
       r14 = 0xffff000000000000
       r15 = 0xffff000000000002
       rip = 0x00003576f7a05204
    rflags = 0x0000000000000207
        cs = 0x000000000000002b
        fs = 0x0000000000000000
        gs = 0x0000000004010000

Notice rbx has a ridiculous value.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>938896</commentid>
    <comment_count>1</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2013-10-11 11:31:22 -0700</bug_when>
    <thetext>It takes hundreds of runs, at least, to get this to reproduce.

This is starting to look like a memory corruption bug.  The DFG&apos;s assertions are exactly what they should be.  And we&apos;re loading nonsense from an array.  That&apos;s why we&apos;re crashing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>938920</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2013-10-11 12:06:52 -0700</bug_when>
    <thetext>Is this the same as bug 122462?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>938931</commentid>
    <comment_count>3</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2013-10-11 12:30:25 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Is this the same as bug 122462?

You&apos;re right, I forgot about that one.

*** This bug has been marked as a duplicate of bug 122462 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>