PJK / libcbor

CBOR protocol implementation for C
MIT License
340 stars 95 forks source link

libcbor FTBFS on many architectures due to different NaN encoding #329

Open yuzibo opened 1 month ago

yuzibo commented 1 month ago

Describe the bug libcbor has FTBFS(fail to build from source) on many architectures due to different NaN encoding, The log on mips64el is like:

0: [   LINE   ] --- ./test/float_ctrl_encoders_test.c:150: error: Failure!
20: [  FAILED  ] test_float
20: [ RUN      ] test_double
20: [  ERROR   ] --- difference at offset 2 0xfffffff7 0xfffffff8
20: difference at offset 3 0xffffffff 0x00
20: difference at offset 4 0xffffffff 0x00
20: difference at offset 5 0xffffffff 0x00
20: difference at offset 6 0xffffffff 0x00
20: difference at offset 7 0xffffffff 0x00
20: difference at offset 8 0xffffffff 0x00
20: 7 bytes of 0xaaad3f0390 and 0xfffbbd7178 differ
20: [   LINE   ] --- ./test/float_ctrl_encoders_test.c:177: error: Failure!
20: [  FAILED  ] test_double
20: [ RUN      ] test_half_special

The more details is here

To Reproduce

#on Debian/sid, get 0.10.2-1.2
apt source libcbor
# sbuid to build it

Environment Debian/sid

I'm not sure if this is a known issue for us, so I open the issue to report this. On Debian side, we may disable some tests related with NaN on some architecture to unblock some migrations.

PJK commented 2 weeks ago

Thank you for the report, FME is there some way for me to test this (emulation/CI environment)?