Verified with:
make -j4 PREFERABLY_POSIX_SHELL=/bin/ksh SUBDIRS=. check
* tests/fold/fold-zero-width.sh: Don't timeout $SHELL -c ...
as the ulimit induces a failure in the subshell depending
on the order of the allocations it does. The main issue is
disparity between the probed ulimit and that needed by $SHELL -c.
Such subshells load the often very large locale archive, thus
if there are any allocations done after the now too low ulimit is set,
then the $SHELL command fails.
---
tests/fold/fold-zero-width.sh | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/tests/fold/fold-zero-width.sh b/tests/fold/fold-zero-width.sh
index 402b2b55e..933d09ca1 100755
--- a/tests/fold/fold-zero-width.sh
+++ b/tests/fold/fold-zero-width.sh
@@ -54,13 +54,12 @@ test $(wc -l < out) -eq $(($IO_BUFSIZE_TIMES2 / 80)) ||
fail=1
# Ensure bounded memory operation.
test -w /dev/full && test -c /dev/full &&
-vm=$(get_min_ulimit_v_ fold /dev/null) && {
+vm=$(get_min_ulimit_v_ timeout 10 fold /dev/null) && {
# \303 results in EILSEQ on input
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)"
+ tr '\0' "$c" < /dev/zero |
+ (ulimit -v $(($vm+12000)) && timeout 10 fold 2>err >/dev/full)
ret=$?
- test -f err || skip_ 'shell ulimit failure'
{ test $ret = 124 || ! grep "$ENOSPC" err >/dev/null; } &&
{ fail=1; cat err; echo "fold didn't diagnose ENOSPC" >&2; }
done
--
2.53.0