From: Adhemerval Zanella Date: Fri, 25 Apr 2025 12:45:11 +0000 (-0300) Subject: nptl: xfail tst-cleanup2 when building with ubsan X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fed92e28c5ae51e3f1356caec42fef35552c0867;p=thirdparty%2Fglibc.git nptl: xfail tst-cleanup2 when building with ubsan The test explicit uses UB (sprintf (NULL, ...) to triggers a SIGSEGV from libc and check with the pthread cleanup are correctly called. With ubsan enable, it triggers: UBSAN: Undefined behaviour in Xprintf_buffer_write.c:39:7 null pointer passed as argument 1, nonnull attribute declared at unknown:0:0 Which is a memcpy call with NULL argument. --- diff --git a/sysdeps/pthread/Makefile b/sysdeps/pthread/Makefile index 5acf505a90..1888f9d297 100644 --- a/sysdeps/pthread/Makefile +++ b/sysdeps/pthread/Makefile @@ -321,6 +321,10 @@ CFLAGS-tst-cleanupx2.c += -fno-builtin CFLAGS-tst-cleanup2.c += $(no-fortify-source) CFLAGS-tst-cleanupx2.c += $(no-fortify-source) +# The 'sprintf(NULL, ...' triggers UB within glibc itself. +test-xfail-tst-cleanup2 = $(enable-ubsan) +test-xfail-tst-cleanupx2 = $(enable-ubsan) + tests += \ tst-cancelx2 \ tst-cancelx3 \