On 21/09/2025 04:12, William Bader wrote:
 >$ make check TESTS=tests/fold/fold-zero-width.sh VERBOSE=yes

That still gave me
   fatal: making test-suite.log: failed to create 
tests/fold/fold-zero-width.sh.trs
   fatal: making test-suite.log: failed to create 
tests/fold/fold-zero-width.sh.log

You need to add SUBDIRS=. so that it doesn't try to do the same TESTS in 
gnulib-tests.
But in my testing on a Centos6 VM you need to run all tests to trigger this 
anyway.

and it showed
   # PASS:  1
even with
   "(ulimit -v $(($vm+0)) && fold 2>err >/dev/full)"
My CentOS 7 server has make-3.82-24.el7.x86_64

So, I just ran the full tests with
   make check VERBOSE=yes
and did a binary search.
The smallest number that passed for me was 108336
  "(ulimit -v $(($vm+108336)) && fold 2>err >/dev/full)"
Over 100MiB ?
I wonder why the other ulimits in other tests OK?
I suppose this test is applying ulimits in a loop which might be a trigger.
Perhaps there is some weird kernel bug on these older Linux kernels
where the ulimit is interpreted as bytes rather than kilobytes sometimes.

Anyway I was able to repro consistently when doing a full test run,
and was able to pass or skip always with the attached.

cheers,
Padraig
From 8a1f4344639795a783c0ccd39ba8f02282d833ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]>
Date: Sun, 21 Sep 2025 16:37:26 +0100
Subject: [PATCH] tests: avoid false failure on older Linux kernels

* tests/fold/fold-zero-width.sh: Check the shell was able to create
the redirection file, as intermittently on CentOS 5,6,7 this wasn't
the case, with the shell giving an xmalloc failure due to the ulimit.
Reported by William Bader and Bruno Haible.
---
 tests/fold/fold-zero-width.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/fold/fold-zero-width.sh b/tests/fold/fold-zero-width.sh
index 04cbe4afd..d90fd0c9c 100755
--- a/tests/fold/fold-zero-width.sh
+++ b/tests/fold/fold-zero-width.sh
@@ -56,7 +56,9 @@ vm=$(get_min_ulimit_v_ fold /dev/null) && {
   for c in '\n' '\0' '\303'; do
     tr '\0' "$c" < /dev/zero | timeout 10 $SHELL -c \
      "(ulimit -v $(($vm+12000)) && fold 2>err >/dev/full)"
-    { test $? = 124 || ! grep 'space' err >/dev/null; } &&
+    ret=$?
+    test -f err || skip_ 'shell ulimit failure'
+    { test $ret = 124 || ! grep 'space' err >/dev/null; } &&
      { fail=1; cat err; echo "fold didn't diagnose ENOSPC" >&2; }
   done
 }
-- 
2.50.1

Reply via email to