GNU bug report logs - #70477
tail command does not hang on /dev/random

Previous Next

Package: coreutils;

Reported by: Ionut Nicula <nicula.iccc <at> gmail.com>

Date: Fri, 19 Apr 2024 23:06:24 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

To reply to this bug, email your comments to 70477 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#70477; Package coreutils. (Fri, 19 Apr 2024 23:06:27 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ionut Nicula <nicula.iccc <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Fri, 19 Apr 2024 23:06:27 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ionut Nicula <nicula.iccc <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: tail command does not hang on /dev/random
Date: Fri, 19 Apr 2024 21:40:35 +0300
The following command hangs indefinitely, as expected:

        tail -c 4096 /dev/random

The following command immediately returns 4097 bytes, unexpectedly:

        tail -c 4097 /dev/random

Details:
- Source code obtained from: git://git.sv.gnu.org/coreutils
- Commit id: 9ab1f9db94479eca4dd2c29b4e21550ff2bcd5bb
- System:

        $ uname -a
        Linux zinc 6.1.0-20-amd64 #1 SMP PREEMPT_DYNAMIC Debian
6.1.85-1 (2024-04-11) x86_64 GNU/Linux




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Sat, 20 Apr 2024 04:53:02 GMT) Full text and rfc822 format available.

Notification sent to Ionut Nicula <nicula.iccc <at> gmail.com>:
bug acknowledged by developer. (Sat, 20 Apr 2024 04:53:02 GMT) Full text and rfc822 format available.

Message #10 received at 70477-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Ionut Nicula <nicula.iccc <at> gmail.com>
Cc: 70477-done <at> debbugs.gnu.org
Subject: Re: bug#70477: tail command does not hang on /dev/random
Date: Fri, 19 Apr 2024 21:52:20 -0700
[Message part 1 (text/plain, inline)]
On 2024-04-19 11:40, Ionut Nicula wrote:
> The following command hangs indefinitely, as expected:
> 
>          tail -c 4096 /dev/random
> 
> The following command immediately returns 4097 bytes, unexpectedly:
> 
>          tail -c 4097 /dev/random

Thanks for the bug report. Although the two commands should behave 
similarly, neither should loop: they should both output the requested 
number of random bytes. Similarly for /dev/zero. I installed the 
attached patch to do that.
[0001-tail-avoid-infloop-with-c-on-dev-zero.patch (text/x-patch, attachment)]

This bug report was last modified 14 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.