coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tests: tac: ensure tac attempts to read all bytes from stand


From: Pádraig Brady
Subject: Re: [PATCH] tests: tac: ensure tac attempts to read all bytes from standard input
Date: Tue, 11 Nov 2025 14:23:14 +0000
User-agent: Mozilla Thunderbird Beta

On 11/11/2025 02:55, Collin Funk wrote:
* tests/tac/tac-2-nonseekable.sh: Add a test case.
---
  tests/tac/tac-2-nonseekable.sh | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/tests/tac/tac-2-nonseekable.sh b/tests/tac/tac-2-nonseekable.sh
index 0b9ed3986..1cf06388e 100755
--- a/tests/tac/tac-2-nonseekable.sh
+++ b/tests/tac/tac-2-nonseekable.sh
@@ -42,4 +42,7 @@ returns_ 124 timeout 10 tac - - <&- 2>err && skip_ 'error 
closing stdin'
  # This failed due to heap corruption from v8.15-v8.25 inclusive.
  returns_ 1 timeout 10 tac - - <&- 2>err || fail=1
+# We should read standard input indefinitely in this case.
+returns_ 124 timeout 1 tac < /dev/zero || fail=1
+
  Exit $fail

I'd add a comment to say we're assuming /dev/zero is seekable.
I don't know of anywhere that doesn't hold, but also I'm
not sure how to easily verify that, so it's worth the comment.

Note the test is also assuming that the read data is not buffered.
So it would be worth affirming that through the use of
get_min_ulimit_v_ etc.

thanks,
Padraig



reply via email to

[Prev in Thread] Current Thread [Next in Thread]