GNU bug report logs - #24903
"tail -f - foo" does not terminate when stdin is closed and foo is ignored

Previous Next

Package: coreutils;

Reported by: Julian Büning <julian.buening <at> rwth-aachen.de>

Date: Tue, 8 Nov 2016 16:40:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


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

From: Pádraig Brady <P <at> draigBrady.com>
To: Julian Büning <julian.buening <at> rwth-aachen.de>,
 24903-done <at> debbugs.gnu.org
Cc: Oscar Soria Dustmann <oscar.soriadustmann <at> comsys.rwth-aachen.de>,
 Daniel Schemmel <daniel.schemmel <at> comsys.rwth-aachen.de>
Subject: Re: bug#24903: "tail -f - foo" does not terminate when stdin is
 closed and foo is ignored
Date: Tue, 8 Nov 2016 17:47:15 +0000
[Message part 1 (text/plain, inline)]
On 08/11/16 16:39, Julian Büning wrote:
> We observed another behavior possibly related to bug #24495:

Similar yes.

> $ mkdir foo
> $ echo "bar" | tail -f - foo &
> [1] 16386
> ==> standard input <==
> bar
> 
> ==> foo <==
> tail: error reading 'foo': Is a directory
> tail: foo: cannot follow end of this type of file; giving up on this name
> $ jobs
> [1]+  Running                 echo "bar" | tail -f - foo &

Yes we should exit here.

> $ readlink /proc/16386/fd/0
> pipe:[162156]
> $ lsof | grep 162156
> tail      16386          user    0r     FIFO       0,10       0t0
> 162156 pipe
> 
> Only the reading end of the pipe is still open, thus tail should not be
> able to read any more bytes from it.

Right we're not blocked on read()

The attached should fix it up.

thanks,
Pádraig.

p.s. These Symbolic Execution techniques are intriguing.
Have you any more details.
[tail-f-ignore.patch (text/x-patch, attachment)]

This bug report was last modified 8 years and 185 days ago.

Previous Next


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