<?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>47136</bug_id>
          
          <creation_ts>2010-10-04 17:27:49 -0700</creation_ts>
          <short_desc>WebSocket tests are crashing</short_desc>
          <delta_ts>2010-10-04 20:23:54 -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 Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</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>1</everconfirmed>
          <reporter name="Simon Fraser (smfr)">simon.fraser</reporter>
          <assigned_to name="Simon Fraser (smfr)">simon.fraser</assigned_to>
          <cc>abarth</cc>
    
    <cc>ap</cc>
    
    <cc>darin</cc>
    
    <cc>jamesr</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>tonikitoo</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>289325</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2010-10-04 17:27:49 -0700</bug_when>
    <thetext>From Adam:


As you might have noticed, the WebSocket tests are crashing on Leopard
and Snow Leopard.  I thought for a while that this might be related to
my recent move of the WebSocket tests, but looks unrelated.  The
crashes started with a patch that flipped off the SVN executable bit
for a bunch of files, which also seems unrelated (reverting that
change locally also don&apos;t seem to make a difference).

Here&apos;s a reduced test case:

&lt;script&gt;
var ws = new WebSocket(&apos;ws://localhost:1111/&apos;);
&lt;/script&gt;

Just open a local HTML file containing that code and you&apos;ll crash
WebKit on Snow Leopard (and presumably Leopard as well).  The crash
looks like some kind of heap corruption.  At this point, I&apos;d like to
hand this off to someone who&apos;s more familiar with the WebSockets code.
Any volunteers?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>289327</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2010-10-04 17:29:57 -0700</bug_when>
    <thetext>There&apos;s a heap corruption bug somewhere. When debugging, I see variable display of &apos;this&apos; go bad in Xcode in the SocketStreamHandleBase() ctor.

Disassembling this gives:

0x0000000103c0ad64  &lt;+0000&gt;  push   %rbp
0x0000000103c0ad65  &lt;+0001&gt;  mov    %rsp,%rbp
0x0000000103c0ad68  &lt;+0004&gt;  mov    %rdi,-0x8(%rbp)
0x0000000103c0ad6c  &lt;+0008&gt;  lea    0x1437e0d(%rip),%rax        # 0x105042b80 &lt;_ZTVN7WebCore22SocketStreamHandleBaseE&gt;
0x0000000103c0ad73  &lt;+0015&gt;  lea    0x10(%rax),%rdx
0x0000000103c0ad77  &lt;+0019&gt;  mov    -0x8(%rbp),%rax
0x0000000103c0ad7b  &lt;+0023&gt;  mov    %rdx,(%rax)        &lt;--- &apos;this&apos; gets clobbered here

It&apos;s loading the vtable, but I don&apos;t know what the 
   lea    0x10(%rax),%rdx
is trying to do.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>289328</commentid>
    <comment_count>2</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-10-04 17:37:10 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; It&apos;s loading the vtable, but I don&apos;t know what the 
&gt;    lea    0x10(%rax),%rdx
&gt; is trying to do.

That looks to me like a multiple-inheritance pointer adjustment. Maybe we have a problem with unsafe casting to and from &quot;this&quot; when there is multiple inheritance involved?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>289329</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2010-10-04 17:43:36 -0700</bug_when>
    <thetext>The superclass certainly uses multiple inheritance:

    class SocketStreamHandle : public RefCounted&lt;SocketStreamHandle&gt;, public SocketStreamHandleBase, public AuthenticationClient {

but the assembly comes from the ctor of SocketStreamHandleBase, which has virtual functions, but doesn&apos;t inherit from anything.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>289332</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2010-10-04 17:53:25 -0700</bug_when>
    <thetext>If I shuffle the inheritance order of SocketStreamHandle to:
class SocketStreamHandle : public RefCounted&lt;SocketStreamHandle&gt;, public AuthenticationClient, public SocketStreamHandleBase {
then things to bad in the AuthenticationClient ctor, in a similar place.

Certainly looks like an issue with multiple-inheritance pointer adjustment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>289333</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2010-10-04 18:08:03 -0700</bug_when>
    <thetext>The build is picking up network/qt/SocketStreamHandle.h</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>289336</commentid>
    <comment_count>6</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2010-10-04 18:17:52 -0700</bug_when>
    <thetext>The project was changed inadvertently in http://trac.webkit.org/changeset/68951</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>289339</commentid>
    <comment_count>7</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2010-10-04 18:23:36 -0700</bug_when>
    <thetext>http://trac.webkit.org/changeset/69057</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>289345</commentid>
    <comment_count>8</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2010-10-04 18:42:30 -0700</bug_when>
    <thetext>FFFFFFFFUUUUUUUUUUUUUUUUUU</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>289362</commentid>
    <comment_count>9</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-10-04 20:23:54 -0700</bug_when>
    <thetext>Looks like we might need to trigger a world-rebuild to see this fix things on the bots.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>