<?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>47594</bug_id>
          
          <creation_ts>2010-10-13 08:44:31 -0700</creation_ts>
          <short_desc>Misaligned memory access in CloneDeserializer on ARM (&lt;v6)</short_desc>
          <delta_ts>2010-11-22 08:47:27 -0800</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>Other</rep_platform>
          <op_sys>Other</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="Yong Li">yong.li.webkit</reporter>
          <assigned_to name="Yong Li">yong.li.webkit</assigned_to>
          <cc>abarth</cc>
    
    <cc>barraclough</cc>
    
    <cc>commit-queue</cc>
    
    <cc>dave+webkit</cc>
    
    <cc>deepak.m</cc>
    
    <cc>eric</cc>
    
    <cc>kimmo.t.kinnunen</cc>
    
    <cc>loki</cc>
    
    <cc>oliver</cc>
    
    <cc>ossy</cc>
    
    <cc>staikos</cc>
    
    <cc>thomas</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>293442</commentid>
    <comment_count>0</comment_count>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2010-10-13 08:44:31 -0700</bug_when>
    <thetext>Bug 45301 fixes the warning, but the problem still exists. On ARM (&lt;v6), CloneDeserializer::readLittleEndian and readString can result misaligned memory access.

#if ASSUME_LITTLE_ENDIAN
template &lt;typename T&gt; static bool readLittleEndian(const uint8_t*&amp; ptr, const uint8_t* end, T&amp; value)
{
        if (ptr &gt; end – sizeof(value))
            return false;

        if (sizeof(T) == 1)
            value = *ptr++;
        else {
            value = *reinterpret_cast_ptr&lt;const T*&gt;(ptr); // here I think we should do memcpy(&amp;value, ptr, sizeof(value))
            ptr += sizeof(T);
        }
        return true;
    }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>293443</commentid>
    <comment_count>1</comment_count>
      <attachid>70612</attachid>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2010-10-13 08:49:30 -0700</bug_when>
    <thetext>Created attachment 70612
the patch

trying to get a test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>293465</commentid>
    <comment_count>2</comment_count>
      <attachid>70617</attachid>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2010-10-13 09:43:59 -0700</bug_when>
    <thetext>Created attachment 70617
The patch (no test added because...)

no new test is added because the crash can be reproduced by loading some existing tests like: LayoutTests/fast/events/message-channel-gc-4.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>293482</commentid>
    <comment_count>3</comment_count>
      <attachid>70617</attachid>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2010-10-13 10:08:45 -0700</bug_when>
    <thetext>Comment on attachment 70617
The patch (no test added because...)

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

r- due to the issues I noted.  The duplicate string copy is the biggest concern.

&gt; WebCore/bindings/js/SerializedScriptValue.cpp:824
&gt; +            if (reinterpret_cast&lt;unsigned&gt;(ptr) &amp; (sizeof(T) - 1))

when casting a pointer to an integer type you should always use uintptr_t or intptr_t (in this case you want uintptr_t)

&gt; WebCore/bindings/js/SerializedScriptValue.cpp:828
&gt; +#else

Honestly I think that given the likelihood of an unaligned read we should probably just drop the alignment check on armv5 or lower and always do a memcpy

&gt; WebCore/bindings/js/SerializedScriptValue.cpp:924
&gt; +            // Use 32-character-long inline buffer as a fast path for small strings.
&gt; +            Vector&lt;UChar, 32&gt; alignedBuffer(length);
&gt; +            memcpy(alignedBuffer.data(), ptr, length * sizeof(UChar));
&gt; +            str = UString(alignedBuffer.data(), length);

This results in multiple copies, rather than str = UString(....) you should do
str = UString::adopt(alignedBuffer);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>293483</commentid>
    <comment_count>4</comment_count>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2010-10-13 10:11:16 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; (From update of attachment 70617 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=70617&amp;action=review
&gt; 
&gt; r- due to the issues I noted.  The duplicate string copy is the biggest concern.
&gt; 
&gt; &gt; WebCore/bindings/js/SerializedScriptValue.cpp:824
&gt; &gt; +            if (reinterpret_cast&lt;unsigned&gt;(ptr) &amp; (sizeof(T) - 1))
&gt; 
&gt; when casting a pointer to an integer type you should always use uintptr_t or intptr_t (in this case you want uintptr_t)
&gt; 
&gt; &gt; WebCore/bindings/js/SerializedScriptValue.cpp:828
&gt; &gt; +#else
&gt; 
&gt; Honestly I think that given the likelihood of an unaligned read we should probably just drop the alignment check on armv5 or lower and always do a memcpy
&gt; 
&gt; &gt; WebCore/bindings/js/SerializedScriptValue.cpp:924
&gt; &gt; +            // Use 32-character-long inline buffer as a fast path for small strings.
&gt; &gt; +            Vector&lt;UChar, 32&gt; alignedBuffer(length);
&gt; &gt; +            memcpy(alignedBuffer.data(), ptr, length * sizeof(UChar));
&gt; &gt; +            str = UString(alignedBuffer.data(), length);
&gt; 
&gt; This results in multiple copies, rather than str = UString(....) you should do
&gt; str = UString::adopt(alignedBuffer);

Thanks a lot. I&apos;ll update the patch soon</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>293490</commentid>
    <comment_count>5</comment_count>
      <attachid>70621</attachid>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2010-10-13 10:23:06 -0700</bug_when>
    <thetext>Created attachment 70621
updated

1. use uintptr_t to cast pointer to integer
2. use UString::adopt to avoid duplicate copy
3. remove the aligned code paths</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>293506</commentid>
    <comment_count>6</comment_count>
      <attachid>70621</attachid>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2010-10-13 10:39:33 -0700</bug_when>
    <thetext>Comment on attachment 70621
updated

Nice</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>293592</commentid>
    <comment_count>7</comment_count>
      <attachid>70621</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-10-13 12:22:05 -0700</bug_when>
    <thetext>Comment on attachment 70621
updated

Clearing flags on attachment: 70621

Committed r69682: &lt;http://trac.webkit.org/changeset/69682&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>293593</commentid>
    <comment_count>8</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-10-13 12:22:12 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>293662</commentid>
    <comment_count>9</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2010-10-13 13:15:04 -0700</bug_when>
    <thetext>http://trac.webkit.org/changeset/69682 might have broken GTK Linux 64-bit Debug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>294005</commentid>
    <comment_count>10</comment_count>
    <who name="Gabor Loki">loki</who>
    <bug_when>2010-10-14 00:48:12 -0700</bug_when>
    <thetext>Hmm, it looks like I missed that alignment difference when I fixed that warnings. I assumed the buffer of CloneDeserializer is allocated in a natural way, but the m_data of SerializedScriptValue is allocated as a char vector.

Although the fix is good, you should consider the MIPS uses natural alignment as well. Well, MIPS has unaligned load/store instruction, but the GCC also warns on unaligned data access (see deepak&apos;s comments at bug 43963).

My suggestion is to create a WTF_CPU_NATURAL_ALIGNMENT_IS_NEEDED macro in Platform.h, and set it for WTF_CPU_ARMV5_OR_LOWER and WTF_CPU_MIPS as well. So, we can use CPU(NATURAL_ALIGNMENT_IS_NEEDED) instead of current CPU(ARMV5_OR_LOWER) check.
At first of all it would be nice someone who has MIPS to confirm this warning.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>294111</commentid>
    <comment_count>11</comment_count>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2010-10-14 07:55:49 -0700</bug_when>
    <thetext>(In reply to comment #10)
&gt; Hmm, it looks like I missed that alignment difference when I fixed that warnings. I assumed the buffer of CloneDeserializer is allocated in a natural way, but the m_data of SerializedScriptValue is allocated as a char vector.
&gt; Although the fix is good, you should consider the MIPS uses natural alignment as well. Well, MIPS has unaligned load/store instruction, but the GCC also warns on unaligned data access (see deepak&apos;s comments at bug 43963).
&gt; My suggestion is to create a WTF_CPU_NATURAL_ALIGNMENT_IS_NEEDED macro in Platform.h, and set it for WTF_CPU_ARMV5_OR_LOWER and WTF_CPU_MIPS as well. So, we can use CPU(NATURAL_ALIGNMENT_IS_NEEDED) instead of current CPU(ARMV5_OR_LOWER) check.
&gt; At first of all it would be nice someone who has MIPS to confirm this warning.

CPU(NATURAL_ALIGNMENT_IS_NEEDED) is good idea. I used CPU(ARMV5_OR_LOWER) because I see it is also being used somewhere else for alignment isue. 

About the warning, probably we should find a better way to suppress it. 

reinterpret_cast_ptr is different from reinterpret_cast only for #if CPU(ARM) &amp;&amp; COMPILER(GCC), and it asserts that the pointer is already aligned.

ASSERT(isPointerTypeAlignmentOkay(reinterpret_cast&lt;TypePtr&gt;(ptr)));

So even on ARMv6, the debug build will throw an assertion, which is also annoying.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>302573</commentid>
    <comment_count>12</comment_count>
    <who name="Kimmo Kinnunen">kimmo.t.kinnunen</who>
    <bug_when>2010-10-31 23:36:32 -0700</bug_when>
    <thetext>&gt; CPU(NATURAL_ALIGNMENT_IS_NEEDED) is good idea. I used CPU(ARMV5_OR_LOWER) 
because I see it is also being used somewhere else for alignment isue. 

It may be that CPU(NATURAL_ALIGNMENT_IS_NEEDED) is not fine-grained enough. Long longs seem to cause crashes on ARMv7 too (at least on some platform+toolchain combination). Related bug:

http://bugs.webkit.org/show_bug.cgi?id=48742</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>70612</attachid>
            <date>2010-10-13 08:49:30 -0700</date>
            <delta_ts>2010-10-13 09:44:07 -0700</delta_ts>
            <desc>the patch</desc>
            <filename>47594.patch</filename>
            <type>text/plain</type>
            <size>2351</size>
            <attacher name="Yong Li">yong.li.webkit</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvQ2hhbmdlTG9nIGIvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
YjI3ZWNmNS4uY2MxZTFhYSAxMDA2NDQKLS0tIGEvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvV2Vi
Q29yZS9DaGFuZ2VMb2cKQEAgLTEsMyArMSwxNSBAQAorMjAxMC0xMC0xMyAgWW9uZyBMaSAgPHlv
bGlAcmltLmNvbT4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAg
ICAgICBGaXggcG90ZW50aWFsIG1pc2FsaWduZWQgbWVtb3J5IGFjY2VzcyBpbiBDbG9uZURlc2Vy
aWFsaXplcjo6cmVhZExpdHRsZUVuZGlhbiBhbmQgcmVhZFN0cmluZworICAgICAgICB0aGF0IGNh
biByZXN1bHQgY3Jhc2ggb24gQVJNICg8djYpLgorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0
Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9NDc1OTQgCisKKyAgICAgICAgKiBiaW5kaW5ncy9qcy9TZXJp
YWxpemVkU2NyaXB0VmFsdWUuY3BwOgorICAgICAgICAoV2ViQ29yZTo6Q2xvbmVEZXNlcmlh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ICAgICAgIHN0ciA9IFVTdHJpbmcocmVpbnRlcnByZXRfY2FzdF9wdHI8Y29uc3Qg
VUNoYXIqPihwdHIpLCBsZW5ndGgpOworI2Vsc2UKKyAgICAgICAgc3RyID0gVVN0cmluZyhyZWlu
dGVycHJldF9jYXN0PGNvbnN0IFVDaGFyKj4ocHRyKSwgbGVuZ3RoKTsKKyNlbmRpZgogICAgICAg
ICBwdHIgKz0gbGVuZ3RoICogc2l6ZW9mKFVDaGFyKTsKICNlbHNlCiAgICAgICAgIFZlY3RvcjxV
Q2hhcj4gYnVmZmVyOwo=
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>70617</attachid>
            <date>2010-10-13 09:43:59 -0700</date>
            <delta_ts>2010-10-13 10:23:06 -0700</delta_ts>
            <desc>The patch (no test added because...)</desc>
            <filename>47594.patch</filename>
            <type>text/plain</type>
            <size>2466</size>
            <attacher name="Yong Li">yong.li.webkit</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvQ2hhbmdlTG9nIGIvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
NWY0YzY4Ni4uNTFiYjIxNSAxMDA2NDQKLS0tIGEvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvV2Vi
Q29yZS9DaGFuZ2VMb2cKQEAgLTEsMyArMSwxOCBAQAorMjAxMC0xMC0xMyAgWW9uZyBMaSAgPHlv
bGlAcmltLmNvbT4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAg
ICAgICBGaXggcG90ZW50aWFsIG1pc2FsaWduZWQgbWVtb3J5IGFjY2VzcyBpbiBDbG9uZURlc2Vy
aWFsaXplcjo6cmVhZExpdHRsZUVuZGlhbiBhbmQgcmVhZFN0cmluZworICAgICAgICB0aGF0IGNh
biByZXN1bHQgY3Jhc2ggb24gQVJNICg8djYpLgorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l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XRoIGZvciBzbWFsbCBzdHJpbmdzLgorICAgICAgICAgICAgVmVjdG9yPFVDaGFy
LCAzMj4gYWxpZ25lZEJ1ZmZlcihsZW5ndGgpOworICAgICAgICAgICAgbWVtY3B5KGFsaWduZWRC
dWZmZXIuZGF0YSgpLCBwdHIsIGxlbmd0aCAqIHNpemVvZihVQ2hhcikpOworICAgICAgICAgICAg
c3RyID0gVVN0cmluZyhhbGlnbmVkQnVmZmVyLmRhdGEoKSwgbGVuZ3RoKTsKKyAgICAgICAgfSBl
bHNlCisgICAgICAgICAgICBzdHIgPSBVU3RyaW5nKHJlaW50ZXJwcmV0X2Nhc3RfcHRyPGNvbnN0
IFVDaGFyKj4ocHRyKSwgbGVuZ3RoKTsKKyNlbHNlCisgICAgICAgIHN0ciA9IFVTdHJpbmcocmVp
bnRlcnByZXRfY2FzdDxjb25zdCBVQ2hhcio+KHB0ciksIGxlbmd0aCk7CisjZW5kaWYKICAgICAg
ICAgcHRyICs9IGxlbmd0aCAqIHNpemVvZihVQ2hhcik7CiAjZWxzZQogICAgICAgICBWZWN0b3I8
VUNoYXI+IGJ1ZmZlcjsK
</data>
<flag name="review"
          id="60478"
          type_id="1"
          status="-"
          setter="oliver"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>70621</attachid>
            <date>2010-10-13 10:23:06 -0700</date>
            <delta_ts>2010-10-13 12:22:05 -0700</delta_ts>
            <desc>updated</desc>
            <filename>47594.patch</filename>
            <type>text/plain</type>
            <size>2040</size>
            <attacher name="Yong Li">yong.li.webkit</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvQ2hhbmdlTG9nIGIvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
NWY0YzY4Ni4uNTFiYjIxNSAxMDA2NDQKLS0tIGEvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvV2Vi
Q29yZS9DaGFuZ2VMb2cKQEAgLTEsMyArMSw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Z3RoKTsKKyAg
ICAgICAgbWVtY3B5KGFsaWduZWRCdWZmZXIuZGF0YSgpLCBwdHIsIGxlbmd0aCAqIHNpemVvZihV
Q2hhcikpOworICAgICAgICBzdHIgPSBVU3RyaW5nOjphZG9wdChhbGlnbmVkQnVmZmVyKTsKKyNl
bHNlCisgICAgICAgIHN0ciA9IFVTdHJpbmcocmVpbnRlcnByZXRfY2FzdDxjb25zdCBVQ2hhcio+
KHB0ciksIGxlbmd0aCk7CisjZW5kaWYKICAgICAgICAgcHRyICs9IGxlbmd0aCAqIHNpemVvZihV
Q2hhcik7CiAjZWxzZQogICAgICAgICBWZWN0b3I8VUNoYXI+IGJ1ZmZlcjsK
</data>

          </attachment>
      

    </bug>

</bugzilla>