<div dir="ltr">Richard or David, do you want to look into this, or you'd prefer to leave this for me?</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 2, 2015 at 3:32 AM, Stephan Bergmann <span dir="ltr"><<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ping^3<div class="HOEnZb"><div class="h5"><br>
<br>
On 12/16/2014 10:52 AM, Stephan Bergmann wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
ping<br>
On 12/05/2014 09:33 AM, Stephan Bergmann wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
ping<br>
On 08/12/2014 09:10 PM, Alexey Samsonov wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+Richard<br>
<br>
<br>
On Tue, Aug 12, 2014 at 3:51 AM, Stephan Bergmann <<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a><br>
<mailto:<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>>> wrote:<br>
<br>
    On 08/11/2014 10:19 PM, Alexey Samsonov wrote:<br>
<br>
        +Richard<br>
<br>
        Note, that you'd also have to update comment for<br>
        VtablePrefix::Offset field.<br>
<br>
<br>
    ah, right; updated patch<br>
<br>
    Stephan<br>
<br>
        On Mon, Aug 11, 2014 at 6:30 AM, Stephan Bergmann<br>
        <<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a> <mailto:<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>><br>
        <mailto:<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a> <mailto:<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>>>><br>
wrote:<br>
<br>
             At least with recent Clang trunk on Linux x86_64:<br>
<br>
                 $ cat test.cc<br>
                 #include <iostream><br>
                 struct A { virtual ~A() {} };<br>
                 struct B: virtual A {};<br>
                 struct C: virtual A { ~C() { std::cout << '\n'; } };<br>
                 struct D: virtual B, virtual C {};<br>
                 int main() { delete new D; }<br>
<br>
                 $ clang++ -fsanitize=undefined test.cc<br>
<br>
                 $ ./a.out<br>
                 <unknown>: runtime error: member call on address<br>
        0x000002a35010<br>
                 which does not point to an object of type 'A'<br>
                 0x000002a35010: note: object has invalid vptr<br>
                   00 00 00 00  58 0e 43 00 00 00 00 00  30 0e 43 00 00<br>
        00 00 00<br>
                   00 00 00 00 00 00 00 00  e1 0f 02 00<br>
                                ^~~~~~~~~~~~~~~~~~~~~~~<br>
                                invalid vptr<br>
<br>
<br>
             The problem is that getVtablePrefix<br>
        (lib/ubsan/ubsan_type_hash.cc)<br>
             rejects any VtablePrefix with Offset > 0 as "This can't<br>
        possibly be<br>
             a valid vtable" but, according to the Itanium ABI, "in some<br>
             construction virtual tables will some virtual base virtual<br>
        tables<br>
             have positive offsets."<br>
<br>
             The apparent fix is to remove the check, see the attached<br>
             getVtablePrefix.patch.<br>
</blockquote></blockquote></blockquote>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div></div>
</div>