From unknown Fri Jun 20 07:11:57 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#24903 <24903@debbugs.gnu.org> To: bug#24903 <24903@debbugs.gnu.org> Subject: Status: "tail -f - foo" does not terminate when stdin is closed and foo is ignored Reply-To: bug#24903 <24903@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:11:57 +0000 retitle 24903 "tail -f - foo" does not terminate when stdin is closed and f= oo is ignored reassign 24903 coreutils submitter 24903 Julian B=C3=BCning severity 24903 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 08 11:39:39 2016 Received: (at submit) by debbugs.gnu.org; 8 Nov 2016 16:39:39 +0000 Received: from localhost ([127.0.0.1]:49855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c49Qx-0004Ca-Bj for submit@debbugs.gnu.org; Tue, 08 Nov 2016 11:39:39 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51417) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c49Qw-0004CL-0b for submit@debbugs.gnu.org; Tue, 08 Nov 2016 11:39:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c49Qq-0008Ah-0d for submit@debbugs.gnu.org; Tue, 08 Nov 2016 11:39:32 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:38203) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c49Qp-0008AZ-TI for submit@debbugs.gnu.org; Tue, 08 Nov 2016 11:39:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c49Qo-0004FT-Oa for bug-coreutils@gnu.org; Tue, 08 Nov 2016 11:39:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c49Ql-000885-LS for bug-coreutils@gnu.org; Tue, 08 Nov 2016 11:39:30 -0500 Received: from mx-out-1.rwth-aachen.de ([134.130.5.186]:55401) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c49Ql-000864-A5 for bug-coreutils@gnu.org; Tue, 08 Nov 2016 11:39:27 -0500 X-IronPort-AV: E=Sophos;i="5.31,462,1473112800"; d="scan'208";a="558155192" Received: from rwthex-s1-a.rwth-ad.de ([134.130.26.152]) by mx-1.rz.rwth-aachen.de with ESMTP; 08 Nov 2016 17:39:23 +0100 Received: from [192.168.178.23] (87.78.166.37) by rwthex-s1-a.rwth-ad.de (2002:8682:1a98::8682:1a98) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Tue, 8 Nov 2016 17:39:19 +0100 From: =?UTF-8?Q?Julian_B=c3=bcning?= Subject: "tail -f - foo" does not terminate when stdin is closed and foo is ignored To: Date: Tue, 8 Nov 2016 17:39:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [87.78.166.37] X-ClientProxiedBy: rwthex-w1-a.rwth-ad.de (2002:8682:1a9c::8682:1a9c) To rwthex-s1-a.rwth-ad.de (2002:8682:1a98::8682:1a98) Message-ID: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: Oscar Soria Dustmann , Daniel Schemmel X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) We observed another behavior possibly related to bug #24495: $ 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 & $ 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. expected behavior: $ 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 tail: no files remaining [1]+ Done echo "bar" | tail -f - foo & This would match the behavior of tail when called without a directory as parameter: $ echo "bar" | tail -f - & [1] 8411 bar [1]+ Done echo "bar" | tail -f - We could reproduce this behavior with version 8.25 (package) and 8.25.91-23066 (compiled from source) on Fedora. We need the directory (or some other untailable file) as second argument to reproduce this behavior as the -f option is ignored for any FIFO or pipe using ignore_fifo_and_pipe(), which prevents tail_forever() from being called in case only FIFOs or pipes are available. The aforementioned function sets .ignore to true for any FIFO or pipe. In our test case, tail_forever() skips both the directory and stdin as their .ignore entries are set to true. Before sleeping and starting the next iteration of the loop (without making any attempt to read from stdin), any_live_files() is called, which returns true for stdin: > if (0 <= f[i].fd) > return true; This behavior was found using Symbolic Execution techniques developed in the course of the SYMBIOSYS research project at COMSYS, RWTH Aachen University. Regards, Julian Büning From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 08 12:47:19 2016 Received: (at 24903-done) by debbugs.gnu.org; 8 Nov 2016 17:47:19 +0000 Received: from localhost ([127.0.0.1]:49899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4AUR-0005vb-Hc for submit@debbugs.gnu.org; Tue, 08 Nov 2016 12:47:19 -0500 Received: from mail.magicbluesmoke.com ([82.195.144.49]:42440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4AUP-0005vR-IJ for 24903-done@debbugs.gnu.org; Tue, 08 Nov 2016 12:47:18 -0500 Received: from [192.168.1.80] (unknown [109.77.156.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 1D96A985D; Tue, 8 Nov 2016 17:47:16 +0000 (GMT) Subject: Re: bug#24903: "tail -f - foo" does not terminate when stdin is closed and foo is ignored To: =?UTF-8?Q?Julian_B=c3=bcning?= , 24903-done@debbugs.gnu.org References: From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <1c061772-ef61-0844-a979-d9e4a773d2df@draigBrady.com> Date: Tue, 8 Nov 2016 17:47:15 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------38E677E2D860C95F34BA45ED" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 24903-done Cc: Oscar Soria Dustmann , Daniel Schemmel X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) This is a multi-part message in MIME format. --------------38E677E2D860C95F34BA45ED Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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. --------------38E677E2D860C95F34BA45ED Content-Type: text/x-patch; name="tail-f-ignore.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="tail-f-ignore.patch" =46rom a6207bdacee615ad6e19e24911aad7ae8364f6f9 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?P=3DC3=3DA1draig=3D20Brady?=3D Date: Tue, 8 Nov 2016 17:34:44 +0000 Subject: [PATCH] tail: terminate when following pipes and untailable non = pipes * src/tail.c (ignore_pipe_or_fifo): Mark the descriptor as -1 for pipes so that any_live_files() detects correctly that the entry is no longer live. * tests/tail-2/pipe-f.sh: Add a test case. Fixes http://bugs.gnu.org/24903 which was detected using Symbolic Execution techniques developed in the course of the SYMBIOSYS research project at COMSYS, RWTH Aachen University. --- src/tail.c | 5 ++++- tests/tail-2/pipe-f.sh | 11 ++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/tail.c b/src/tail.c index 718fc8a..96982ed 100644 --- a/src/tail.c +++ b/src/tail.c @@ -2212,7 +2212,10 @@ ignore_fifo_and_pipe (struct File_spec *f, size_t = n_files) && (S_ISFIFO (f[i].mode) || (HAVE_FIFO_PIPES !=3D 1 && isapipe (f[i].fd)))); if (is_a_fifo_or_pipe) - f[i].ignore =3D true; + { + f[i].fd =3D -1; + f[i].ignore =3D true; + } else ++n_viable; } diff --git a/tests/tail-2/pipe-f.sh b/tests/tail-2/pipe-f.sh index 7abb7d6..82364da 100755 --- a/tests/tail-2/pipe-f.sh +++ b/tests/tail-2/pipe-f.sh @@ -19,9 +19,18 @@ . "${srcdir=3D.}/tests/init.sh"; path_prepend_ ./src print_ver_ tail =20 +echo oo > exp || framework_failure_ echo foo | timeout 10 tail -f -c3 > out || fail=3D1 -echo oo > exp || fail=3D1 +compare exp out || fail=3D1 + +cat <<\EOF > exp +=3D=3D> standard input <=3D=3D +ar =20 +=3D=3D> missing <=3D=3D +EOF +mkdir missing || framework_failure_ +echo bar | returns_ 1 timeout 10 tail -f -c3 - missing > out || fail=3D1= compare exp out || fail=3D1 =20 Exit $fail --=20 2.5.5 --------------38E677E2D860C95F34BA45ED-- From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 08 16:29:04 2016 Received: (at 24903) by debbugs.gnu.org; 8 Nov 2016 21:29:04 +0000 Received: from localhost ([127.0.0.1]:50071 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4Dx1-0004YM-Sz for submit@debbugs.gnu.org; Tue, 08 Nov 2016 16:29:04 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:61703) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4Dwz-0004Xp-Ik for 24903@debbugs.gnu.org; Tue, 08 Nov 2016 16:29:01 -0500 Received: from [192.168.101.10] ([217.87.217.218]) by mrelayeu.kundenserver.de (mreue003) with ESMTPSA (Nemesis) id 0MGV7M-1bzsN60z9E-00DIDy; Tue, 08 Nov 2016 22:28:40 +0100 Subject: Re: bug#24903: "tail -f - foo" does not terminate when stdin is closed and foo is ignored To: 24903@debbugs.gnu.org, P@draigBrady.com, julian.buening@rwth-aachen.de References: <1c061772-ef61-0844-a979-d9e4a773d2df@draigBrady.com> From: Bernhard Voelker Message-ID: <317cc62f-d796-4e2a-a0f6-b3a588cb651a@bernhard-voelker.de> Date: Tue, 8 Nov 2016 22:28:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1c061772-ef61-0844-a979-d9e4a773d2df@draigBrady.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:eMGcWBe+pj0c4z10fZmOC+WU1omwyDbT6Qmx1Zt35WKRZYNbcyU VJX0u7gQNltdc9EUGmbKUQGiG2hzKC77kTWw3IojQFBkEcQROYWrUuqQw3kk5kZ4C0lJ4Jr yFeMxquO4NKH3fEos/yryvIN0HpuM1qbu3PF5kjj8oWU0yc7mhkn99tOVI+eE48zDO4Tw6h SSD3WJmae6dyquHzglyZw== X-UI-Out-Filterresults: notjunk:1;V01:K0:s7/dtcaZADY=:ivPlOirC1akG6izegmKLgE 6RKXjc3xVEKM4xtX+27bOATwlRpL60fx2V2lf67VGrtT0pOcBSeXFu58KnPP9UgsVGkYcScnb Mtp7PyxCLehl0HpHlhUoxO7ai2FbNmlUVNgugRwWikLGI4H5K+0eN/OpdYQzs/VKDSY61RP9s Labefn3Nc321vfcIdOfirtd74fLiXXl2uXjMyWVWDco88JhUiNmhI+jJMwH8b9/cwZDrmKV6w 1TYaVbFiCtjMImJe0T+H2v4xK84gujKkajPvE7R/bXTUv50gtgNIvm7iSTuoePrF2uBef967h g2JswMbxbXu+hDIcl5MCYi8YLVUuchJvyuu+2lzFz5Po/bTmh4sf+/phWZG4Aq4H687tFWKqw Bx/HHIh/ov13CoIbGcGAlB8VWUb1Gl9wA2MO1eSbUeLW9Tebk+8deSJQvIYNin83C6YJwvhvH oc7sT3/aNY3uTfKcSqbSU48Hv6Xf1P5zgkrgkDFlcCvS+P9+zql5nvrlikeITRQ9BKuC10xvD G1NUDNsdMLnM2w03y0AhOR8+CMpa2p6YpDxnCj/+HTu7VBD5JWlM05G5Egty0PiCfgpesiFcY CyoCAF7KId9FuknkETDCQ9dbcn8yTNnDVFWxQfjQUdZ+zwAPWo8gUpwpdwGP8KFnj4kB+M9Dp QqMChrIoFG5AghXqm1NkyTn63e7AdmjomXaarMetWZdX8mz3q6Q3Ipy/RNYuV+wLKGo5VEsT6 bSSF+q0NEEvCRHDK X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 24903 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) On 11/08/2016 06:47 PM, Pádraig Brady wrote: > Subject: [PATCH] tail: terminate when following pipes and untailable non pipes > > * src/tail.c (ignore_pipe_or_fifo): Mark the descriptor as -1 > for pipes so that any_live_files() detects correctly that > the entry is no longer live. > * tests/tail-2/pipe-f.sh: Add a test case. > Fixes http://bugs.gnu.org/24903 which was detected > using Symbolic Execution techniques developed in > the course of the SYMBIOSYS research project at > COMSYS, RWTH Aachen University. The patch looks good, yet I think it warrants a NEWS entry. Thanks & have a nice day, Berny From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 08 18:19:08 2016 Received: (at 24903) by debbugs.gnu.org; 8 Nov 2016 23:19:08 +0000 Received: from localhost ([127.0.0.1]:50133 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4FfY-0007Gb-Bh for submit@debbugs.gnu.org; Tue, 08 Nov 2016 18:19:08 -0500 Received: from mail.magicbluesmoke.com ([82.195.144.49]:43200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4FfX-0007GQ-Cm for 24903@debbugs.gnu.org; Tue, 08 Nov 2016 18:19:07 -0500 Received: from [192.168.1.80] (unknown [109.77.156.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 68A74985D; Tue, 8 Nov 2016 23:19:03 +0000 (GMT) Subject: Re: bug#24903: "tail -f - foo" does not terminate when stdin is closed and foo is ignored To: Bernhard Voelker , 24903@debbugs.gnu.org, julian.buening@rwth-aachen.de References: <1c061772-ef61-0844-a979-d9e4a773d2df@draigBrady.com> <317cc62f-d796-4e2a-a0f6-b3a588cb651a@bernhard-voelker.de> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: Date: Tue, 8 Nov 2016 23:19:02 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <317cc62f-d796-4e2a-a0f6-b3a588cb651a@bernhard-voelker.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 24903 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 08/11/16 21:28, Bernhard Voelker wrote: > On 11/08/2016 06:47 PM, Pádraig Brady wrote: >> Subject: [PATCH] tail: terminate when following pipes and untailable non pipes >> >> * src/tail.c (ignore_pipe_or_fifo): Mark the descriptor as -1 >> for pipes so that any_live_files() detects correctly that >> the entry is no longer live. >> * tests/tail-2/pipe-f.sh: Add a test case. >> Fixes http://bugs.gnu.org/24903 which was detected >> using Symbolic Execution techniques developed in >> the course of the SYMBIOSYS research project at >> COMSYS, RWTH Aachen University. > > The patch looks good, yet I think it warrants a NEWS entry. Oops. I've added: + tail -f - 'untailable file' will now terminate when there is no more data + to read from stdin. Previously it behaved as if --retry was specified. + [This bug was present in "the beginning".] BTW I see a related issue with `tail -f missing_file existing_file`. Currently it will keep trying to open("missing_file") even though --retry is not specified. That seems inconsistent to me. Shouldn't we ignore items that fail the initial open()? I'll do another fix for that unless there are objections. cheers, Pádraig. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 08 18:44:39 2016 Received: (at 24903) by debbugs.gnu.org; 8 Nov 2016 23:44:39 +0000 Received: from localhost ([127.0.0.1]:50149 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4G4F-0007tW-LZ for submit@debbugs.gnu.org; Tue, 08 Nov 2016 18:44:39 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:51855) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4G4E-0007tI-Ex for 24903@debbugs.gnu.org; Tue, 08 Nov 2016 18:44:38 -0500 Received: from [192.168.101.10] ([217.87.217.218]) by mrelayeu.kundenserver.de (mreue102) with ESMTPSA (Nemesis) id 0MgfYN-1cR1yL16wx-00O2lb; Wed, 09 Nov 2016 00:44:30 +0100 Subject: Re: bug#24903: "tail -f - foo" does not terminate when stdin is closed and foo is ignored To: =?UTF-8?Q?P=c3=a1draig_Brady?= , 24903@debbugs.gnu.org, julian.buening@rwth-aachen.de References: <1c061772-ef61-0844-a979-d9e4a773d2df@draigBrady.com> <317cc62f-d796-4e2a-a0f6-b3a588cb651a@bernhard-voelker.de> From: Bernhard Voelker Message-ID: Date: Wed, 9 Nov 2016 00:44:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:/0Q3aOR9XOxyyLVN7SDV69UyZksF2S5BajJ3uaUQtQ9z3HXG6Hx j+bIlqCOS/nsTeE2BPi3QmxoL7WiFZnr8vGtxxdssusNDL1HiLbIGe1EIOdOZtxqEOS//DO 7hmnF9CNCgtQ/FwS8URmxcd6fY+QrhQ2+h80jElupbV3yi/jaCzhW2lI82n6oBWbugp89dl R5rJr4OHDzjGShQrV/gYQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:Vyf9c86WM1U=:jBMkghNyw7T/X3UZFj5ebv QJHZKl66qZixvExPbvGhLVuk1d0Lcck8xamn0wJyFgJpv2Qecv2hIdU4UXMCitVVZcX57OEty cBhe6L6aqiFgv0mBiV3TEM3hnKG89IszffFFhC5AEKNgttFO9LP+BMzNktoSWxHNHxlkFMPkY ZV7T8wWP92St/Kwn4FuLn4sE82+wT8FZddNUKJqKjaumcB01LH9Q0xfvoM9zzVQEurkl8b3Fc 1rGBZITga2Hbrp5p+nFLvRiHKTdncIi/qDSW0TiaWy+OzzJ9wip6WcZA7Hi0dex1j8dqBoME/ BeswYtykj6zy0QnTWaKqQk260a86fhOWkqxjtnyJnqcl5GzKRWEC+yEW5MJmoL91RB75eqLMa 6p//rUbJEvSD1FW+3F2x6NvxT07rS823VPQ+PyKJ1XhhTTNADo3E51hPdykLMjvm8RB/qbVWV 0k+co2aUoizt/Xkl8pefsQXiPbVyfTi/+BqXmjTReRxvnYJY9jUU4RE9QOBP3XphDBeLVMc3S AWso6gz53DbTvB95OcJgIuB8vP3rrEJ9DU/4f0k19simxHYXMhQ34t6dbyprg6rumEhEX4K3i 5667Hckty32UojeXNxHWYjfG7IOnsq3HeWWH0o3BVROWQwWbuDQzpuDGnpdph5g7B1RyBdy5Z B7HUnDQhmvtN0ZbbAcNg33Q+R6E05/yR9+qOIARFVMsUUjMy6iLhg/nCoYOKvKwGzn4Tm1lls PzthSowDmg64FltQ X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 24903 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) On 11/09/2016 12:19 AM, Pádraig Brady wrote: > + tail -f - 'untailable file' will now terminate when there is no more data > + to read from stdin. Previously it behaved as if --retry was specified. > + [This bug was present in "the beginning".] LGTM, thanks. > BTW I see a related issue with `tail -f missing_file existing_file`. > Currently it will keep trying to open("missing_file") even though > --retry is not specified. That seems inconsistent to me. > Shouldn't we ignore items that fail the initial open()? > I'll do another fix for that unless there are objections. Good catch - and even more strange: when 'missing_file' then appears later, tail doesn't terminate when both files are removed: $ set -x; rm missing_file; \ > touch existing_file; \ > src/tail -f missing_file existing_file & \ > sleep 5; \ > echo abc > missing_file; \ > sleep 3; \ > rm missing_file existing_file; \ > sleep 3; \ > ps ) + rm missing_file rm: cannot remove ‘missing_file’: No such file or directory + touch existing_file + sleep 5 + src/tail -f missing_file existing_file src/tail: cannot open 'missing_file' for reading: No such file or directory ==> existing_file <== + echo abc src/tail: 'missing_file' has appeared; following new file + sleep 3 ==> missing_file <== abc + rm missing_file existing_file + sleep 3 + ps PID TTY TIME CMD 3036 pts/12 00:00:00 bash 3039 pts/12 00:00:00 tail 3053 pts/12 00:00:00 ps Have a nice day, Berny From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 08 18:50:42 2016 Received: (at 24903) by debbugs.gnu.org; 8 Nov 2016 23:50:42 +0000 Received: from localhost ([127.0.0.1]:50155 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4GA6-000836-As for submit@debbugs.gnu.org; Tue, 08 Nov 2016 18:50:42 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:64538) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4GA4-00082t-Uu for 24903@debbugs.gnu.org; Tue, 08 Nov 2016 18:50:41 -0500 Received: from [192.168.101.10] ([217.87.217.218]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0LyDzx-1cs4y82gM9-015Zdx; Wed, 09 Nov 2016 00:50:29 +0100 Subject: Re: bug#24903: "tail -f - foo" does not terminate when stdin is closed and foo is ignored To: =?UTF-8?Q?P=c3=a1draig_Brady?= , 24903@debbugs.gnu.org, julian.buening@rwth-aachen.de References: <1c061772-ef61-0844-a979-d9e4a773d2df@draigBrady.com> <317cc62f-d796-4e2a-a0f6-b3a588cb651a@bernhard-voelker.de> From: Bernhard Voelker Message-ID: Date: Wed, 9 Nov 2016 00:50:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:TdoGsxcbIOtryUkKQVelmmedsQkefjbplHL4pP3JAPTfxoCZ5uk yBdEUH5CK3W/8ZEr0beM/dJXufvZ8aItcoT4yi1GGXHnTr0dBezbPQCPca+2XKZCNec6vhK 4f0fHc+XOCWqEI/dD9PwtnX/SZA2DCnkt/11KRJPThCEtvqUS/hN5GbQueJLRc/RxPp2Mln lsty3g+tl1sozWdSiDrqw== X-UI-Out-Filterresults: notjunk:1;V01:K0:fFkX9g/CzaQ=:OzIfTWPVaSekFmmMcB1qkg 7jVDC/qVLx3vsWko3xH0ENwbiSpI1Jg8cvUUeKoyM0gn+LtfYRaG1iPw/2FI40Eu+9yoEKCTp K9qC4jcnzP8o4kwhFerqflsPzGq+suQ62HPec/uDNMXVjsg2/3HR+H0BhUG71YBB2+ODzyoTd tCyhm+ZFxfRN5Yi7kvB95Cu5mHJV4y93y1tAfpvai8TxVzJ/3AjE3hlfWIlorMN8nmiQjuzw+ 7C7u42gop0LxdrF9albHRtfZtw0XMzyjTWgPq19mvsUrujMnckJVIWrq9uH/Ngaf/dHk7TOyw tfiWy5s0ARsQ0LNZx+mJ/hl3LxL3/ss2chZd3k7HkLhv8fULkN5Hu90f806e2XVrEWRyIJTYe Szd/ZEIiTIRROC2FAs4WXR5kPIS3IpgoYap2D07QCt3BfsK5rdrvxG7LCzM7h43NBA9OsWrPh zHu6AtsVPNIn2vEHtpplZMHHtFuxeX/z42y5y9S1sKpvnC1du3+iLexURkT3FBpTwkqxS+tvd vA9SVUOp0MwYtKeTKQzm9m2j+r5slE0wY0fSFtOnvl4CfhA30getKVSK7thfHTPRgOplkDYm8 Bh6PW9ElzLgBqlzMF2kr3k8ezBVSfSVmEbJYidCII6OuLmkoIGUzdSYDiyV6UfBKKMGYpPUWR CC/wsRZkWP41NRRn3S26ocVWdltGwd9//cPE5502S9EVBk1b2lUjeY5ntAsCJVwF2x01iZse9 TDPCECPgeKEPch7m X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 24903 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) On 11/09/2016 12:44 AM, Bernhard Voelker wrote: > and even more strange: when 'missing_file' then appears > later, tail doesn't terminate when both files are removed: oops, forget about this: we're following by descriptor, and tail can not know if the file is still opened by other processes. Sorry, ... time to go to bed. So your conclusion seems correct: tail shouldn't re-try to open("missing_file") in the -f case. Have a nice day, Berny From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 18 09:51:13 2016 Received: (at 24903) by debbugs.gnu.org; 18 Nov 2016 14:51:13 +0000 Received: from localhost ([127.0.0.1]:33268 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7kVU-0005AE-Rc for submit@debbugs.gnu.org; Fri, 18 Nov 2016 09:51:13 -0500 Received: from mx-out-1.rwth-aachen.de ([134.130.5.186]:47754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7kVS-0005A3-Iw for 24903@debbugs.gnu.org; Fri, 18 Nov 2016 09:51:11 -0500 X-IronPort-AV: E=Sophos;i="5.31,510,1473112800"; d="scan'208";a="559952132" Received: from rwthex-s1-a.rwth-ad.de ([134.130.26.152]) by mx-1.rz.rwth-aachen.de with ESMTP; 18 Nov 2016 15:51:09 +0100 Received: from [192.168.178.23] (87.78.110.22) by rwthex-s1-a.rwth-ad.de (2002:8682:1a98::8682:1a98) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Fri, 18 Nov 2016 15:51:08 +0100 Subject: Re: bug#24903: "tail -f - foo" does not terminate when stdin is closed and foo is ignored To: =?UTF-8?Q?P=c3=a1draig_Brady?= , <24903@debbugs.gnu.org> References: <1c061772-ef61-0844-a979-d9e4a773d2df@draigBrady.com> From: =?UTF-8?Q?Julian_B=c3=bcning?= Date: Fri, 18 Nov 2016 15:51:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <1c061772-ef61-0844-a979-d9e4a773d2df@draigBrady.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [87.78.110.22] X-ClientProxiedBy: rwthex-s2-b.rwth-ad.de (2002:8682:1a9b::8682:1a9b) To rwthex-s1-a.rwth-ad.de (2002:8682:1a98::8682:1a98) Message-ID: X-Spam-Score: -5.2 (-----) X-Debbugs-Envelope-To: 24903 Cc: Oscar Soria Dustmann , Daniel Schemmel X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.2 (-----) On 11/08/2016 06:47 PM, Pádraig Brady wrote: > p.s. These Symbolic Execution techniques are intriguing. > Have you any more details. Thanks for your interest in our techniques. Symbolic Execution is a dynamic analysis method to automatically find bugs by executing a program with symbolic inputs, therefore reasoning about all possible execution paths. We based our work on KLEE [1], a symbolic execution engine, which has previously been used to find memory access violations in the GNU Coreutils suite [2]. We extended KLEE by adding the ability to automatically find unintended non-termination, such as the two bugs we reported on this mailing list. Unfortunately, I cannot share any details right now, as we are currently preparing a publication of our work. I will be happy to follow up once our paper has been published. [1] http://klee.github.io [2] http://llvm.org/pubs/2008-12-OSDI-KLEE.html Regards, Julian From unknown Fri Jun 20 07:11:57 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 17 Dec 2016 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator