<?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>47055</bug_id>
          
          <creation_ts>2010-10-03 01:03:50 -0700</creation_ts>
          <short_desc>All the WebSocket tests crash</short_desc>
          <delta_ts>2010-10-03 11:47:42 -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>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Other</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="Adam Barth">abarth</reporter>
          <assigned_to name="Adam Barth">abarth</assigned_to>
          <cc>abarth</cc>
    
    <cc>andersca</cc>
    
    <cc>ap</cc>
    
    <cc>darin</cc>
    
    <cc>ukai</cc>
    
    <cc>zecke</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>288746</commentid>
    <comment_count>0</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-10-03 01:03:50 -0700</bug_when>
    <thetext>All the WebSocket tests crash</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>288747</commentid>
    <comment_count>1</comment_count>
      <attachid>69583</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-10-03 01:05:48 -0700</bug_when>
    <thetext>Created attachment 69583
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>288748</commentid>
    <comment_count>2</comment_count>
      <attachid>69583</attachid>
    <who name="Holger Freyther">zecke</who>
    <bug_when>2010-10-03 01:13:32 -0700</bug_when>
    <thetext>Comment on attachment 69583
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=69583&amp;action=review

You could keep the &apos;const&apos;. The patch looks sane.

&gt; WebCore/ChangeLog:9
&gt; +        That doesn&apos;t work in C++.  Instead, we need to actually store the

You could remove the extra space.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>288749</commentid>
    <comment_count>3</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-10-03 01:19:50 -0700</bug_when>
    <thetext>Committed r68984: &lt;http://trac.webkit.org/changeset/68984&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>288770</commentid>
    <comment_count>4</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-10-03 10:37:36 -0700</bug_when>
    <thetext>The C++ standard, section 12.5, paragraph 5, says:

&quot;The temporary to which the reference is bound [...] persists for the lifetime of the reference except as specified below.”

And the text below does not list any exception which applies here.

So the temporary objects here will last the lifetime of the reference. So this code change should not have had any effect at all.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>288774</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-10-03 11:41:43 -0700</bug_when>
    <thetext>This is a fairly common idiom in WebCore code. People have submitted patches to &quot;fix&quot; such code several times in the past, but reviewers stopped that before, and the problem always turned out to be something different.

When did this start? Did this happen on buildbots?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>288777</commentid>
    <comment_count>6</comment_count>
    <who name="Holger Freyther">zecke</who>
    <bug_when>2010-10-03 11:47:42 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; This is a fairly common idiom in WebCore code. People have submitted patches to &quot;fix&quot; such code several times in the past, but reviewers stopped that before, and the problem always turned out to be something different.

I was not aware that it is valid until the end of the block. I was doing this example http://paste.lisp.org/display/115156 for adam to show that it is at least valid for function calls.

The other thing is, I think it is to be preferred to not use const reference as it can have suprising effects and as long as the function being called is inline, gcc will be able to eliminate the copy (since early gcc 3.x), as can be seen when compiling/executing the example.

Anyway, I will be more careful.


&gt; 
&gt; When did this start? Did this happen on buildbots?

Leaving that to Adam.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>69583</attachid>
            <date>2010-10-03 01:05:48 -0700</date>
            <delta_ts>2010-10-03 01:13:32 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-47055-20101003010546.patch</filename>
            <type>text/plain</type>
            <size>1681</size>
            <attacher name="Adam Barth">abarth</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA2ODk4MykKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTcgQEAKKzIwMTAtMTAtMDMgIEFkYW0gQmFydGggIDxhYmFydGhAd2Via2l0Lm9y
Zz4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBBbGwg
dGhlIFdlYlNvY2tldCB0ZXN0cyBjcmFzaAorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9y
Zy9zaG93X2J1Zy5jZ2k/aWQ9NDcwNTUKKworICAgICAgICBUaGlzIGNvZGUgYXR0ZW1wdHMgdG8g
aG9sZCBvbnRvIHRlbXBvcmFyeSBvYmplY3RzIHVzaW5nIHJlZmVyZW5jZXMuCisgICAgICAgIFRo
YXQgZG9lc24ndCB3b3JrIGluIEMrKy4gIEluc3RlYWQsIHdlIG5lZWQgdG8gYWN0dWFsbHkgc3Rv
cmUgdGhlCisgICAgICAgIG9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gICAgaWYgKGV4ZWMtPmhhZEV4Y2Vw
dGlvbigpKQogICAgICAgICByZXR1cm4gdGhyb3dWTUVycm9yKGV4ZWMsIGNyZWF0ZVN5bnRheEVy
cm9yKGV4ZWMsICJ3cm9uZyBVUkwiKSk7Ci0gICAgY29uc3QgS1VSTCYgdXJsID0gY29udGV4dC0+
Y29tcGxldGVVUkwodXJsU3RyaW5nKTsKKyAgICBLVVJMIHVybCA9IGNvbnRleHQtPmNvbXBsZXRl
VVJMKHVybFN0cmluZyk7CiAgICAgUmVmUHRyPFdlYlNvY2tldD4gd2ViU29ja2V0ID0gV2ViU29j
a2V0OjpjcmVhdGUoY29udGV4dCk7CiAgICAgRXhjZXB0aW9uQ29kZSBlYyA9IDA7CiAgICAgaWYg
KGV4ZWMtPmFyZ3VtZW50Q291bnQoKSA8IDIpCg==
</data>
<flag name="review"
          id="59294"
          type_id="1"
          status="+"
          setter="zecke"
    />
          </attachment>
      

    </bug>

</bugzilla>