<?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>40355</bug_id>
          
          <creation_ts>2010-06-09 00:16:10 -0700</creation_ts>
          <short_desc>Exception loading Google Wave in Safari 5</short_desc>
          <delta_ts>2010-06-11 09:42:56 -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>WebCore JavaScript</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>40367</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>GoogleBug, InRadar</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="noel gordon">noel.gordon</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>dan</cc>
    
    <cc>dunhamsteve</cc>
    
    <cc>eric</cc>
    
    <cc>jgw</cc>
    
    <cc>knorton</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>235682</commentid>
    <comment_count>0</comment_count>
    <who name="noel gordon">noel.gordon</who>
    <bug_when>2010-06-09 00:16:10 -0700</bug_when>
    <thetext>Load Google Wave in Safari 5 (win32, and/or mac/osx 10.5), the
javascript console reports:

   RangeError: Maximum call stack size exceeded.

and Google Wave stops working. Test results/reduction attached

  OSX Firefox 3.6    OK  
  OSX Safari 4.0.4   OK
  OSX Chrome 5.0.375 OK
  OSX Safari 5.0     FAIL</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>235699</commentid>
    <comment_count>1</comment_count>
      <attachid>58221</attachid>
    <who name="noel gordon">noel.gordon</who>
    <bug_when>2010-06-09 01:09:54 -0700</bug_when>
    <thetext>Created attachment 58221
Test Case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>235976</commentid>
    <comment_count>2</comment_count>
    <who name="Gavin Barraclough">barraclough</who>
    <bug_when>2010-06-09 13:43:38 -0700</bug_when>
    <thetext>&lt;rdar://problem/8076614&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>236013</commentid>
    <comment_count>3</comment_count>
    <who name="Steve Dunham">dunhamsteve</who>
    <bug_when>2010-06-09 14:34:37 -0700</bug_when>
    <thetext>This issue seems to only occur when Safari 5 is run in 32-bit mode.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>236069</commentid>
    <comment_count>4</comment_count>
    <who name="Steve Dunham">dunhamsteve</who>
    <bug_when>2010-06-09 16:04:55 -0700</bug_when>
    <thetext>If you replace:

    tmp = (tmp &gt;&gt; 1);

with

   var tmp2 = (tmp &gt;&gt; 1);
   tmp = tmp2;

the testcase passes.

If you instrument the original testcase with print statements, tmp.toString() is &quot;3&quot; before the shift operation and &quot;3.0000000000000004&quot; afterwards.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>236079</commentid>
    <comment_count>5</comment_count>
    <who name="Joel Webber">jgw</who>
    <bug_when>2010-06-09 16:36:25 -0700</bug_when>
    <thetext>The following is a related, but slightly narrower form of the bug:

function merge(d,e,f) {
  var h,i,j,k;
  h = e - d;
  if (h &lt; 3) {
    return
  }
  j = d + f;
  i = e + f;
  k = j + (i - j &gt;&gt; 1);
  merge(j,k,-f);
  merge(k,i,-f);
}
merge(0, 5, 0);

From the console, when you set a breakpoint in merge(2, 5, 0):
&gt; i
   5
&gt; j
   2
&gt; (i - j)
   3
&gt; ((i - j) &gt;&gt; 1)
   1
&gt; j + ((i - j) &gt;&gt; 1)
   5 &lt;= WTF?!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>236851</commentid>
    <comment_count>6</comment_count>
    <who name="Steve Dunham">dunhamsteve</who>
    <bug_when>2010-06-11 08:56:41 -0700</bug_when>
    <thetext>Further reduced test case:

function test() {
    var off = -0;
    var tmp = 5 + off;
    var tmp2 = (tmp &gt;&gt; 1);
    tmp = tmp &gt;&gt; 1;
    if (tmp != tmp2)
        document.getElementById(&quot;result&quot;).innerHTML = &quot;fail &quot;+tmp+&quot; != &quot;+tmp2;
    else
        document.getElementById(&quot;result&quot;).innerHTML = &quot;pass&quot;;
}

Gives:
  fail 5.000000000000002 != 2

It looks like adding &quot;-0&quot; to an integer results in a value that will right shift correctly in some contexts but not in others.  (Note that tmp2 holds the correct value, but tmp does not.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>236873</commentid>
    <comment_count>7</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2010-06-11 09:42:56 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 40367 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>58221</attachid>
            <date>2010-06-09 01:09:54 -0700</date>
            <delta_ts>2010-06-09 01:09:54 -0700</delta_ts>
            <desc>Test Case</desc>
            <filename>test-case.html</filename>
            <type>text/html</type>
            <size>579</size>
            <attacher name="noel gordon">noel.gordon</attacher>
            
              <data encoding="base64">PGh0bWw+IA0KPGhlYWQ+DQogPHNjcmlwdD4NCiAgZnVuY3Rpb24gdHJ1bmMoaSwgaiwgb2ZmKSB7
DQogICAgdmFyIGxvLCBoaSwgbGVuLCBtaWQ7IGxlbiA9IGogLSBpOw0KICAgIGlmIChsZW4gPCAz
KSB7IHJldHVybjsgfQ0KICAgIGxvID0gaSArIG9mZjsNCiAgICBoaSA9IGogKyBvZmY7DQogICAg
Ly8gbWlkID0gbG8gKyAoKGhpIC0gbG8pID4+IDEpOw0KICAgIHZhciB0bXAgPSBoaSAtIGxvOw0K
ICAgIHRtcCA9ICh0bXAgPj4gMSk7DQogICAgbWlkID0gdG1wICsgbG87DQogICAgdHJ1bmMoaSwg
bWlkLCAtb2ZmKTsNCiAgICB0cnVuYyhtaWQsIGosIC1vZmYpOw0KICB9DQoNCiAgZnVuY3Rpb24g
dGVzdCgpIHsNCiAgICAvLyBwcmludCAncGFzcycgaWYgdHJ1bmMoKSByZXR1cm5zDQogICAgdHJ1
bmMoMCwgNSwgMCk7DQogICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoInJlc3VsdCIpLmlubmVy
SFRNTCA9ICJwYXNzIjsNCiAgfQ0KIDwvc2NyaXB0Pg0KPC9oZWFkPg0KPGJvZHkgb25sb2FkPSJ0
ZXN0KCkiPg0KIDxwcmUgaWQ9InJlc3VsdCI+cnVubmluZyAuLi48L3ByZT4NCjwvYm9keT4NCjwv
aHRtbD4NCg0K
</data>

          </attachment>
      

    </bug>

</bugzilla>