<?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>144321</bug_id>
          
          <creation_ts>2015-04-28 03:55:35 -0700</creation_ts>
          <short_desc>SharedBuffer::copy is not computing the buffer size correctly when having m_dataArray</short_desc>
          <delta_ts>2015-04-30 08:38:48 -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>Platform</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</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="youenn fablet">youennf</reporter>
          <assigned_to name="youenn fablet">youennf</assigned_to>
          <cc>ap</cc>
    
    <cc>commit-queue</cc>
    
    <cc>darin</cc>
    
    <cc>psolanki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1089459</commentid>
    <comment_count>0</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2015-04-28 03:55:35 -0700</bug_when>
    <thetext>SharedBuffer::copy is not computing the buffer size correctly when having m_dataArray.
The size of the copy is not always the same as the side of the source, which should be the case.
This is exemplified by https://bugs.webkit.org/show_bug.cgi?id=144272</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1089460</commentid>
    <comment_count>1</comment_count>
      <attachid>251835</attachid>
    <who name="youenn fablet">youennf</who>
    <bug_when>2015-04-28 03:59:14 -0700</bug_when>
    <thetext>Created attachment 251835
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1089518</commentid>
    <comment_count>2</comment_count>
      <attachid>251835</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2015-04-28 08:18:32 -0700</bug_when>
    <thetext>Comment on attachment 251835
Patch

Is there a way to test this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1089519</commentid>
    <comment_count>3</comment_count>
      <attachid>251835</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2015-04-28 08:18:51 -0700</bug_when>
    <thetext>Comment on attachment 251835
Patch

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

&gt; Source/WebCore/ChangeLog:8
&gt; +        Patch correctness covered by existing tests.

How can this be? Which test was failing?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1089571</commentid>
    <comment_count>4</comment_count>
      <attachid>251835</attachid>
    <who name="youenn fablet">youennf</who>
    <bug_when>2015-04-28 09:56:55 -0700</bug_when>
    <thetext>Comment on attachment 251835
Patch

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

&gt;&gt; Source/WebCore/ChangeLog:8
&gt;&gt; +        Patch correctness covered by existing tests.
&gt; 
&gt; How can this be? Which test was failing?

I wrote &quot;Patch correctness covered&quot; not &quot;Patch covered&quot;...
I agree it is a little bit of a lexical abuse.
With the added ASSERT, the tests would now crash in debug mode and not only in guard malloc mode, which will make things easier to spot when landing the patch if there are still some issues within copy.
And, of course, it will be covered by appcache test once bug 143711 will be landed.

The only current copy() user I know is SubresourceLoader when loading multipart content.
I guess there are tests in http/tests/multipart for this code path.
Do some of them have issues with guard malloc? Is it possible to monitor this somewhere?

SharedBuffer as well as some other platform/WTF classes would best be covered by direct unit testing, which does not seem to be WebKit tradition, at least for Source/WebCore stuff.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1089580</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2015-04-28 10:03:49 -0700</bug_when>
    <thetext>There are no known issues with GuardMalloc at the time, although it&apos;s possible that affected tests are simply disabled.

You can run GuardMalloc tests yourself with -g option to run-webkit-tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1089596</commentid>
    <comment_count>6</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2015-04-28 10:35:21 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; SharedBuffer as well as some other platform/WTF classes would best be
&gt; covered by direct unit testing, which does not seem to be WebKit tradition,
&gt; at least for Source/WebCore stuff.

We should start adding more direct unit testing. Not doing these sorts of tests is obsolete project thinking; we now like to add such tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1089608</commentid>
    <comment_count>7</comment_count>
      <attachid>251835</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2015-04-28 10:46:55 -0700</bug_when>
    <thetext>Comment on attachment 251835
Patch

Clearing flags on attachment: 251835

Committed r183489: &lt;http://trac.webkit.org/changeset/183489&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1089609</commentid>
    <comment_count>8</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2015-04-28 10:46:59 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1090096</commentid>
    <comment_count>9</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2015-04-29 11:58:12 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; (In reply to comment #4)
&gt; &gt; SharedBuffer as well as some other platform/WTF classes would best be
&gt; &gt; covered by direct unit testing, which does not seem to be WebKit tradition,
&gt; &gt; at least for Source/WebCore stuff.
&gt; 
&gt; We should start adding more direct unit testing. Not doing these sorts of
&gt; tests is obsolete project thinking; we now like to add such tests.

This sounds great.
Is somebody working on bringing C++ Unit tests to WebKit tools infastructure?
Is it discussed somewhere?
I guess I would use it for bug 144192.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1090105</commentid>
    <comment_count>10</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2015-04-29 12:13:46 -0700</bug_when>
    <thetext>I&apos;m not sure what you mean by test infrastructure. Something like bug 106596, which is about making EWS run API tests?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1090442</commentid>
    <comment_count>11</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2015-04-30 08:38:48 -0700</bug_when>
    <thetext>(In reply to comment #10)
&gt; I&apos;m not sure what you mean by test infrastructure. Something like bug
&gt; 106596, which is about making EWS run API tests?

That would be useful yes. I hope this is done by the commit queue though.

But also adding tests require modifying the build system files which is tedious.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>251835</attachid>
            <date>2015-04-28 03:59:14 -0700</date>
            <delta_ts>2015-04-28 10:46:55 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-144321-20150428125805.patch</filename>
            <type>text/plain</type>
            <size>1490</size>
            <attacher name="youenn fablet">youennf</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTgzMzg4CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggMGQ1MTY5ZTEyNDFkZDJk
ZDA4ZTM4ZjEwM2NmMThlMzgzMDIxZDE5My4uNmQxODZmZDA3ZmEwMjZkN2FjMTJkMDk2NTEzOGRi
ZWE0MWFjYzU0ZCAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE1IEBACisyMDE1LTA0LTI4ICBZb3Vl
bm4gRmFibGV0ICA8eW91ZW5uLmZhYmxldEBjcmYuY2Fub24uZn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