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.
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 \