Bruno Haible <br...@clisp.org> writes: > 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.
That's a shame. I was planning on doing an UBSAN run again over GNU packages and it'll be a pain to have to keep adjusting for this. > > Bruno