On 08/02/2026 11:11, Pádraig Brady wrote:
Sam, the quickest fix for you is to use bash or skip,
which is done in the attached.
I've applied that to the repo actually,
as it will be the easiest patch for packagers to use if needed.
The best long term fix for us is to use getsys
to get the appropriate error text, as I detailed at:
https://lists.gnu.org/archive/html/coreutils/2026-01/msg00187.html
We've lots of hacks in the test suite re error messages,
which this is just another. I'll work on this now.
The attached 2 patches implement and use this
to address the issue at hand.
I'll probably have further patches to rename to getsys,
and to adjust more places in the test suite to use the error strings.
Marking this as done.
cheers,
Padraig
From 70818b2d49f7de0ed2aa88b6d069d0d01842a354 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]>
Date: Sun, 8 Feb 2026 19:34:13 +0000
Subject: [PATCH 1/2] tests: getlimits: output error strings
* src/getlimits.c (main): Iterate over the first 256 errnos,
and output shell compatible error strings.
* tests/Coreutils.pm: Adjust so shell quotes are stripped.
---
src/getlimits.c | 9 +++++++++
tests/Coreutils.pm | 8 +++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/getlimits.c b/src/getlimits.c
index 6113988a2..6e5e5fcb2 100644
--- a/src/getlimits.c
+++ b/src/getlimits.c
@@ -192,5 +192,14 @@ main (int argc, char **argv)
printf ("SIGRTMAX=%jd\n", (intmax_t) SIGRTMAX);
printf ("IO_BUFSIZE=%ju\n", (uintmax_t) IO_BUFSIZE);
+ /* Errnos */
+ for (int e = 1; e < 256; e++)
+ {
+ char const *err_name = strerrorname_np (e);
+ if (err_name)
+ printf ("%s=%s\n", err_name,
+ quotearg_style (shell_escape_quoting_style, strerror (e)));
+ }
+
return EXIT_SUCCESS;
}
diff --git a/tests/Coreutils.pm b/tests/Coreutils.pm
index 393a8c8df..376609d73 100644
--- a/tests/Coreutils.pm
+++ b/tests/Coreutils.pm
@@ -21,6 +21,7 @@ use vars qw($VERSION @ISA @EXPORT);
use FileHandle;
use File::Compare qw(compare);
+use Text::ParseWords qw(shellwords);
@ISA = qw(Exporter);
($VERSION = '$Revision: 1.5 $ ') =~ tr/[0-9].//cd;
@@ -213,7 +214,12 @@ sub getlimits()
{
my $NV;
open $NV, "getlimits |" or die "Error running getlimits\n";
- my %limits = map {split /=|\n/} <$NV>;
+ my %limits = map {
+ chomp;
+ my ($k, $v) = split /=/, $_, 2;
+ $v = (shellwords($v))[0] if defined $v;
+ ($k, $v)
+ } <$NV>;
return \%limits;
}
--
2.52.0
From f17d9ed9792a84b4d2aea4b0d4d70e32d2286dc0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]>
Date: Sun, 8 Feb 2026 19:41:41 +0000
Subject: [PATCH 2/2] tests: determine errno strings more efficiently
* tests/misc/read-errors.sh: Use getlimits_ determined EIO error string,
rather than inferring the string from bash's output.
See https://bugs.gnu.org/80353
---
tests/misc/read-errors.sh | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/tests/misc/read-errors.sh b/tests/misc/read-errors.sh
index c05516505..f967a9044 100755
--- a/tests/misc/read-errors.sh
+++ b/tests/misc/read-errors.sh
@@ -18,6 +18,7 @@
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
uses_strace_
+getlimits_
! cat . >/dev/null 2>&1 || skip_ "Need unreadable directories"
@@ -105,12 +106,6 @@ expected_failure_status_sort=2
# Ensure read is called, otherwise it's a layering violation.
# Also ensure a read error is diagnosed appropriately.
if strace -o /dev/null -P _ -e '/read,splice' -e fault=all:error=EIO true; then
- # Get EIO error message independently from utils
- strace -o /dev/null -P /dev/null -e '/read,splice' -e fault=all:error=EIO \
- $SHELL -c 'read < /dev/null' 2>&1 |
- sed -e 's/\[/: /' -e 's/\]//' -e 's/.*: //' > io.err
- strerror_eio="$(cat io.err)" && test -n "$strerror_eio" || framework_failure_
-
while read reader; do
cmd=$(printf '%s\n' "$reader" | cut -d ' ' -f1) || framework_failure_
eval "expected=\$expected_failure_status_$cmd"
@@ -118,7 +113,7 @@ if strace -o /dev/null -P _ -e '/read,splice' -e fault=all:error=EIO true; then
returns_ $expected \
strace -f -o /dev/null -P . -e '/read,splice' -e fault=all:error=EIO \
$SHELL -c "$reader" 2>err || fail=1
- grep -F "$strerror_eio" err >/dev/null || { cat err; fail=1; }
+ grep -F "$EIO" err >/dev/null || { cat err; fail=1; }
done < built_readers
fi
--
2.52.0