[llvm-bugs] [Bug 51879] New: UBSan false positive vptr with -O1

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 16 07:22:11 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51879

            Bug ID: 51879
           Summary: UBSan false positive vptr with -O1
           Product: compiler-rt
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ubsan
          Assignee: unassignedbugs at nondot.org
          Reporter: maic23 at live.de
                CC: llvm-bugs at lists.llvm.org

Created attachment 25265
  --> https://bugs.llvm.org/attachment.cgi?id=25265&action=edit
1.cpp

Steps to reproduce with -O1. (Other optimization levels pass fine.)

$ clang++-13 -std=c++17 -O1 -fsanitize=undefined ./1.cpp  && ./a.out

1.cpp:12:25: runtime error: member call on address 0x000000d50238 which does
not point to an object of type 'A'
0x000000d50238: note: object has invalid vptr
 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00
00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior 1.cpp:12:25 in 
UndefinedBehaviorSanitizer:DEADLYSIGNAL
==462339==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address
0x000000000000 (pc 0x0000004274e7 bp 0x000000000000 sp 0x7ffecb558b00 T462339)
==462339==The signal is caused by a READ memory access.
==462339==Hint: address points to the zero page.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210916/2e12aa53/attachment.html>


More information about the llvm-bugs mailing list