On 30/03/2023 09:20, A. Wilcox wrote:
Hello,

While updating coreutils to 9.2 on Adélie Linux, I’ve run into a few
interesting corner-cases in the test suite.  As a note, our distribution
is using musl as the libc.

1. `tests/misc/csplit-heap.sh` fails when /bin/sh is Bash

I actually saw this on 9.1 as well, but I only saw it on one system and
considered it a fluke since our auto builder infrastructure didn’t see
the issue.  Seeing it again in 9.2 made me look deeper, and it turns out
that when /bin/sh is a symlink to /bin/bash, the test fails with:

./tests/misc/csplit-heap.sh: xmalloc: cannot allocate 16085 bytes

When /bin/sh is a symlink to /bin/dash, the test no longer fails.
However:

The attached should fix that issue.



2. `tests/misc/tee.sh` fails when /bin/sh is Dash and `make` is run
under Zsh

When running the test suite from my default Zsh environment, and when
/bin/sh is a symlink to /bin/dash, I receive an error when running the
tee test.

If:

- /bin/sh is a symlink to /bin/bash; OR if

- /bin/sh is a symlink to /bin/dash, and
- make is launched from a Bash or Dash shell, *not* a Zsh shell,

Then the test passes.

This is failing as `yes >fifo` is getting EINTR on your shell.
I'm not too sure why that's happening, but it might be
due to interactions on the fifo from the previous part of the test.

Does the following change avoid the problem for you?

cheers,
Pádraig

diff --git a/tests/misc/tee.sh b/tests/misc/tee.sh
index 0b97a9ea3..444cb688a 100755
--- a/tests/misc/tee.sh
+++ b/tests/misc/tee.sh
@@ -99,7 +99,7 @@ dd count=20 bs=100K if=/dev/zero status=none |
   dd count=0 oflag=nonblock status=none
   tee || { cleanup_; touch tee.fail; }
 } >fifo
-test -f tee.fail && fail=1
+test -f tee.fail && fail=1 || cleanup_

 # Ensure tee honors --output-error modes
 read_fifo() { timeout 10 dd count=1 if=fifo of=/dev/null status=none & }

From aa99b99f0cc03fac8a7db00b6aec8887756a499c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <p...@draigbrady.com>
Date: Thu, 30 Mar 2023 14:28:03 +0100
Subject: [PATCH] tests: adjust csplit VM limit

* tests/misc/csplit-heap.sh: More memory is required to avoid
a false failure on some systems.  Noticed with musl libc
with bash as the shell.  This is confirmed to still easily
trigger with the original memory leak being tested.
Addresses https://bugs.gnu.org/62542
---
 tests/misc/csplit-heap.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/misc/csplit-heap.sh b/tests/misc/csplit-heap.sh
index 2ba3c4500..36b286b93 100755
--- a/tests/misc/csplit-heap.sh
+++ b/tests/misc/csplit-heap.sh
@@ -25,7 +25,7 @@ vm=$(get_min_ulimit_v_ csplit -z f %n%1) \
   || skip_ "this shell lacks ulimit support"
 
 (
- ulimit -v $(($vm + 1000)) \
+ ulimit -v $(($vm + 4000)) \
    && { yes | head -n2500000; echo n; } | csplit -z - %n%1
 ) || fail=1
 
-- 
2.26.2

Reply via email to