https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67258

            Bug ID: 67258
           Summary: "invalid vptr" false positive from ubsan for virtual
                    inheritance
           Product: gcc
           Version: 5.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: arvo at me dot com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
  Target Milestone: ---

Created attachment 36200
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36200&action=edit
Minimal test program that triggers "invalid vptr" message from ubsan

Building the attached minimal test program, which should be free of undefined
behavior, with --sanitize=undefined and executing it yields:

ubsan-virtual.cxx:7:8: runtime error: member call on address 0x7fff43c04a20
which does not point to an object of type 'A'
0x7fff43c04a20: note: object has invalid vptr
 00 00 00 00  40 18 40 00 00 00 00 00  18 18 40 00 00 00 00 00  20 4b c0 43 ff
7f 00 00  00 3c c4 4f
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr

Reply via email to