You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This might be a compiler bug/sanitizer false positive, but I get the following UBSan error on a simple test program for v2.4.2 and seemingly everything down to v1.6.0. Compilation failed for older versions, so I'm not sure about those.
CLI11.hpp:5465:94: runtime error: reference binding to misaligned address 0x0007d571 for type '<unknown>', which requires 2 byte alignment
0x0007d571: note: pointer points here
0f 7b 6a 2d e9 f0 4f ad f5 01 7d 00 af c7 f8 34 01 c7 f8 30 11 c7 f8 2c 21 d7 f8 2c 21 d7 f8 2c
^
/opt/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-linux-gnueabihf/arm-none-linux-gnueabihf/include/c++/13.3.1/bits/std_function.h:449:36: runtime error: reference binding to misaligned address 0x0007d571 for type 'type', which requires 2 byte alignment
0x0007d571: note: pointer points here
0f 7b 6a 2d e9 f0 4f ad f5 01 7d 00 af c7 f8 34 01 c7 f8 30 11 c7 f8 2c 21 d7 f8 2c 21 d7 f8 2c
^
/opt/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-linux-gnueabihf/arm-none-linux-gnueabihf/include/c++/13.3.1/bits/move.h:71:36: runtime error: reference binding to misaligned address 0x0007d571 for type '<unknown>', which requires 2 byte alignment
0x0007d571: note: pointer points here
0f 7b 6a 2d e9 f0 4f ad f5 01 7d 00 af c7 f8 34 01 c7 f8 30 11 c7 f8 2c 21 d7 f8 2c 21 d7 f8 2c
^
/opt/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-linux-gnueabihf/arm-none-linux-gnueabihf/include/c++/13.3.1/bits/std_function.h:215:15: runtime error: reference binding to misaligned address 0x0007d571 for type 'type', which requires 2 byte alignment
0x0007d571: note: pointer points here
0f 7b 6a 2d e9 f0 4f ad f5 01 7d 00 af c7 f8 34 01 c7 f8 30 11 c7 f8 2c 21 d7 f8 2c 21 d7 f8 2c
^
/opt/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-linux-gnueabihf/arm-none-linux-gnueabihf/include/c++/13.3.1/bits/std_function.h:152:59: runtime error: reference binding to misaligned address 0x0007d571 for type 'type', which requires 2 byte alignment
0x0007d571: note: pointer points here
0f 7b 6a 2d e9 f0 4f ad f5 01 7d 00 af c7 f8 34 01 c7 f8 30 11 c7 f8 2c 21 d7 f8 2c 21 d7 f8 2c
^
To reproduce:
Download the cross compiler from here, I used arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-linux-gnueabihf. But I also tested with 14.2.rel1 and 11.3rel1, which exhibit the same behaviour.
Unpack to /opt
Run this script from a level below the CLI11 repository:
#!/bin/sh -uecd CLI11
rm -rf build
mkdir build
cd build
cmake .. -DCLI11_SINGLE_FILE=1 -DCLI11_BUILD_TESTS=0 -DCLI11_BUILD_EXAMPLES=0 \
-DCLI11_BUILD_DOCS=0 -DCLI11_BUILD_EXAMPLES_JSON=0 -DCLI11_SINGLE_FILE_TESTS=0
make -j"$(nproc)" all
cd single-include ||cd include
cat <<EOF >./test.cpp#include "CLI11.hpp"#include <string>int main(int argc, char** argv) { CLI::App app{"App description"}; std::string filename = "default"; app.add_option("-f,--file", filename, "A help string"); CLI11_PARSE(app, argc, argv); return 0;}EOF
/opt/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-g++ \
-Wall -std=c++11 -g -fno-omit-frame-pointer -fsanitize=undefined test.cpp
qemu-arm -L /opt/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-linux-gnueabihf/arm-none-linux-gnueabihf/libc ./a.out
QEMU needs to be installed. I can confirm that this happens even when running the binary natively on an arm machine.
The text was updated successfully, but these errors were encountered:
I have seen some misalignment warnings on some other platforms, usually the processors handle that just fine, but I might dig a bit deeper at some point.
This might be a compiler bug/sanitizer false positive, but I get the following UBSan error on a simple test program for v2.4.2 and seemingly everything down to v1.6.0. Compilation failed for older versions, so I'm not sure about those.
To reproduce:
/opt
QEMU needs to be installed. I can confirm that this happens even when running the binary natively on an arm machine.
The text was updated successfully, but these errors were encountered: