Hi Sam,

Testing the current coreutils with the current gnulib, there is an
undefined behaviour in crc-x86_64-pclmul.c.

Found by building on Ubuntu 24.04, with clang 19,

CC="clang 
-fsanitize=address,undefined,signed-integer-overflow,shift,integer-divide-by-zero
 -fno-sanitize-recover=undefined"

and running the test suite. The log shows this:


FAIL: test-crc
==============

../lib/crc-x86_64-pclmul.c:120:26: runtime error: load of misaligned address 
0x5572a8d5f161 for type 'const __m128i *', which requires 16 byte alignment
0x5572a8d5f161: note: pointer points here
 2a 27 00  fc 75 47 2e 58 58 bf 5a  d1 0f bb b4 48 98 72 83  ab e2 e8 b8 72 44 
6d 71  24 02 1a 7a d2
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior 
../lib/crc-x86_64-pclmul.c:120:26 
FAIL test-crc (exit status: 134)


How to reproduce without coreutils:

$ ./gnulib-tool --test --single-configure crc crc-x86_64
...
../../build-aux/test-driver: line 119: 804663 Aborted                 "$@" >> 
"$log_file" 2>&1
FAIL: test-crc


Bruno




Reply via email to