[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
coreutils-9.4.170-7b206 undefined behaviour in tests
From: |
Bruno Haible |
Subject: |
coreutils-9.4.170-7b206 undefined behaviour in tests |
Date: |
Sun, 24 Mar 2024 15:20:36 +0100 |
Hi,
Building coreutils-9.4.170-7b206 on a glibc system, with clang and ASAN and
UBSAN options, produces 4 test failures.
I'm using clang 17.0.4 with the options
CC="$CC
-fsanitize=address,undefined,signed-integer-overflow,shift,integer-divide-by-zero"
CFLAGS="-O0 -fno-omit-frame-pointer -ggdb"
ASAN_OPTIONS="detect_leaks=0 abort_on_error=1 allocator_may_return_null=1"
The failing tests are:
FAIL: tests/misc/comm.pl
FAIL: tests/join/join.pl
FAIL: tests/uniq/uniq.pl
FAIL: tests/ls/removed-directory.sh
In the test-suite.log file there are hundreds of occurrences of
+ ../lib/linebuffer.c:65:22: runtime error: applying zero offset to null pointer
+ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
../lib/linebuffer.c:65:22 in
and 1 occurrence of
+../lib/mpsort.c:155:34: runtime error: applying zero offset to null pointer
+SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../lib/mpsort.c:155:34
in
I have proposed a fix for this in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-12/msg00055.html>,
but Paul Eggert opposes it.
Bruno