zserio icon indicating copy to clipboard operation
zserio copied to clipboard

UndefinedBehaviorSanitizer fails for C++ 32-bit runtime library build using clang 12/14

Open mikir opened this issue 2 years ago • 4 comments

UndefinedBehaviourSanitizer fails during C++ runtime library build for 32-bit platform using clang 12:

./build.sh cpp_rt-linux32-clang

gives for example the following error

compiler/extensions/cpp/runtime/test/../src/zserio/OptionalHolder.h:727:38: runtime error: constructor call on misaligned address 0xf5607594 for type 'unsigned long long', which requires 8 byte alignment
0xf5607594: note: pointer points here
  f0 60 71 0b be be be be  be be be be 00 be be be  02 02 00 00 08 00 00 00  3b 00 80 3b 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior compiler/extensions/cpp/runtime/test/../src/zserio/OptionalHolder.h:727:38 in 

When clang 10 is used, everything passes successfully.

mikir avatar Feb 03 '23 12:02 mikir