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: [email protected]
Reporter: [email protected]
CC: [email protected]
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._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs