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. Note we timeout fold rather than
the whole pipeline so any 124 exit status is propagated.
# 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