rbt_serialize_test.c: runtime error: member access within misaligned address
On Fedora 33 with gcc version 10.2.1 20201125 (Red Hat 10.2.1-9) with ASAN, but not Debian 10 with gcc 8.3.0 we have in the CI, I get following runtime errors in serialize_test
unit test:
[==========] Running 3 test(s).
[ RUN ] serialize_test
[ OK ] serialize_test
[ RUN ] deserialize_corrupt_test
rbt_serialize_test.c:185:27: runtime error: member access within misaligned address 0x7fa040bc62a3 for type 'struct data_holder_t', which requires 8 byte alignment
0x7fa040bc62a3: note: pointer points here
00 0a 00 00 00 00 00 00 00 b0 12 00 00 00 00 00 00 74 65 73 74 2e 6e 65 74 2e 00 00 00 00 00 00
^
rbt_serialize_test.c:185:45: runtime error: member access within misaligned address 0x7fa040bc62a3 for type 'struct data_holder_t', which requires 8 byte alignment
0x7fa040bc62a3: note: pointer points here
00 0a 00 00 00 00 00 00 00 b0 12 00 00 00 00 00 00 74 65 73 74 2e 6e 65 74 2e 00 00 00 00 00 00
^
[ OK ] deserialize_corrupt_test
[ RUN ] serialize_align_test
[ OK ] serialize_align_test
[==========] 3 test(s) run.
[ PASSED ] 3 test(s).
PASS rbt_serialize_test (exit status: 0)
Edited by Michal Nowak