Subject: bug#74426: closed (Re: tests/dd/skip-seek-past-file failure on macOS)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 16 Feb 2025 06:40:02 +0000

Your bug report

#74426: tests/dd/skip-seek-past-file failure on macOS

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
74426: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74426
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: tests/dd/skip-seek-past-file failure on macOS
From: Paul Eggert <[email-masked]>
To: Grisha Levit <[email-masked]>
Cc: [email-masked]
Date: Sat, 15 Feb 2025 22:38:56 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

On 2024-11-18 20:28, Grisha Levit wrote:
> tests/dd/skip-seek-past-file.sh fails on macOS 15 when checking for a
> warning being printed when seeking past the max file size [1].

Thanks, I installed the attached patch a couple of days after your bug 
report, but unfortunately forgot to reply to your email until now. This 
patch appears in coreutils 9.6.

From cc58b657361bf6d5467753ee547d3a1266a6cc7f Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Wed, 20 Nov 2024 11:11:54 -0800
Subject: [PATCH] dd: port big-offset test to macOS 12.6

* tests/dd/skip-seek-past-file.sh: Do not assume that
seek to exactly OFF_T_MAX should fail; it works on macOS 12.6
and POSIX allows this.  Come to think of it, it should work
on Solaris too, if someone ever comes across a Solaris host
with a file system that allows such files.
---
 tests/dd/skip-seek-past-file.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/dd/skip-seek-past-file.sh b/tests/dd/skip-seek-past-file.sh
index 41b34e99a..9dffc2e68 100755
--- a/tests/dd/skip-seek-past-file.sh
+++ b/tests/dd/skip-seek-past-file.sh
@@ -74,14 +74,14 @@ grep "invalid number:" err >/dev/null || fail=1
 # skipping > max file size should fail immediately
 if ! truncate --size=$OFF_T_MAX in 2>/dev/null; then
   # truncate is to ensure file system doesn't actually support OFF_T_MAX files
-  dd bs=1 skip=$OFF_T_MAX count=0 status=noxfer < file 2> err \
+  dd bs=1 skip=$OFF_T_MAX count=0 status=none < file 2> err \
     && lseek_ok=yes \
     || lseek_ok=no
 
   if test $lseek_ok = yes; then
     # On Solaris 10 at least, lseek(>max file size) succeeds,
-    # so just check for the skip warning.
-    compare skip_err err || fail=1
+    # so just check that there are no diagnostics.
+    compare /dev/null err || fail=1
   else
     # On Linux kernels at least, lseek(>max file size) fails.
     # error message should be "... cannot skip: strerror(EINVAL)"
-- 
2.48.1

Subject: tests/dd/skip-seek-past-file failure on macOS
From: Grisha Levit <[email-masked]>
To: [email-masked]
Date: Mon, 18 Nov 2024 23:28:19 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

tests/dd/skip-seek-past-file.sh fails on macOS 15 when checking for a
warning being printed when seeking past the max file size [1].

Reproducing outside the test suite:

$ > file
$ dd bs=1 skip=9223372036854775807 count=0 status=noxfer < file
0+0 records in
0+0 records out
$ echo $?
0

Note that if the input is a non-empty file the expected warning _is_ printed:

$ echo > file
$ dd bs=1 skip=9223372036854775807 count=0 status=noxfer < file
dd: 'standard input': cannot skip to specified offset
0+0 records in
0+0 records out
$ echo $?
0

  [1]: https://git.savannah.gnu.org/cgit/coreutils.git/tree/tests/dd/skip-seek-past-file.sh?id=c41ca2814d2ffad5fff9b9526d1be9eb5366d72d#n84