On 13/10/2026 18:01, Pádraig Brady wrote:
On 13/10/2026 17:40, Bruno Haible via GNU coreutils General Discussion wrote:
Hi,

The misc/exec-bad-unicode test that was added on 2026-10-04 fails in an
environment with clang + UBSAN + ASAN.


FAIL: tests/misc/exec-bad-unicode
=================================

+ read executor
+ LC_ALL=C
+ stdbuf -oL $'./\377|\355\272\255|\\u0089|\355\246\277\355\277\277' 
$'\377|\355\272\255|\\u0089|\355\246\277\355\277\277'
+ test 127 = 0
+ case "$executor" in
+ false
+ cat err
/bin/bash: symbol lookup error: 
/home/runner/work/ci-check/ci-check/coreutils-2026-10-13/build/src/libstdbuf.so:
 undefined symbol: __asan_option_detect_stack_use_after_return
+ fail=1


This is obviously related to the 'stdbuf' program. But there are surely other
stdbuf tests, that don't fail?? What do they do differently?

tests/misc/stdbuf.sh works because it's running ASAN instrumented binaries in 
the coreutils build,
but when libstdbuf.so is built against ASAN but then tries to run non ASAN 
instrumented binaries
you get a link error.

The fix would be to do something like:

     stdbuf -oL $SHELL -c : || skip_ ...

Alternatively we might exclude libstdbuf.so from sanitizers.
I'm going with the attached change which simplifies things somewhat.

cheers,
Padraig
From 5ed97472b8b7027e57eac477b30e3deac8e70cd5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]>
Date: Tue, 13 Oct 2026 18:49:43 +0100
Subject: [PATCH] tests: avoid a false failure with sanitizers

* tests/misc/exec-bad-unicode.sh: Avoid stdbuf running non instrumented
binaries, because the LD_PRELOADED libstdbuf.so may then get link errors
due to it not linking with the sanitizer runtime, and neither does
a non instrumented binary.  So instead of running $SHELL, avoid the
issue by running our echo binary directly, which should provide
the sanitizer lib.  Using our built binary in the shebang also
implicitly checks for problematic whitespace in the path.
---
 tests/misc/exec-bad-unicode.sh | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/tests/misc/exec-bad-unicode.sh b/tests/misc/exec-bad-unicode.sh
index 097305951..38d4e2a66 100755
--- a/tests/misc/exec-bad-unicode.sh
+++ b/tests/misc/exec-bad-unicode.sh
@@ -19,26 +19,16 @@
 
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 
-# stdbuf fails when the absolute top build dir name contains e.g.,
-# space, TAB, NL
-lf='
-'
-case $abs_top_builddir in
-  *[\\\"\#\$\&\'\`$lf\ \	]*)
-    skip_ "unsafe absolute build directory name: $abs_top_builddir";;
-esac
-
 script="$(bad_unicode)"
 
 # Create a program with invalid Unicode in its name.
-cat <<EOF >"$script"
-#!$SHELL
-echo "\$@"
-EOF
-test $? = 0 || skip_ 'bad unicode not supported in shell or file system'
+printf '#!%s\n' "$(cmd_exe echo)" >"$script" ||
+  skip_ 'bad unicode not supported in shell or file system'
 chmod u+x "$script" || framework_failure_
 
-# Check that it can be executed.
+# Check that it can be executed, which is not the case if there are
+# spaces in $abs_top_builddir.  Such spaces also preclude stdbuf's
+# LD_PRELOAD from operating correctly.
 ./"$script" "$script" >exp \
   || skip_ 'cannot execute a file name with invalid unicode'
 
-- 
2.55.0

Reply via email to