From owner-freebsd-bugs@FreeBSD.ORG Fri Jun 13 12:10:16 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C1EAD37B401 for ; Fri, 13 Jun 2003 12:10:16 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id C9DCE43FBD for ; Fri, 13 Jun 2003 12:10:15 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h5DJAFUp094397 for ; Fri, 13 Jun 2003 12:10:15 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h5DJAFWO094396; Fri, 13 Jun 2003 12:10:15 -0700 (PDT) Resent-Date: Fri, 13 Jun 2003 12:10:15 -0700 (PDT) Resent-Message-Id: <200306131910.h5DJAFWO094396@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Hal Burch Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0966437B401 for ; Fri, 13 Jun 2003 12:09:14 -0700 (PDT) Received: from exgw2.lumeta.com (exgw2.lumeta.com [65.198.68.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1083943FCB for ; Fri, 13 Jun 2003 12:09:13 -0700 (PDT) (envelope-from hburch@lumeta.com) Received: from lucy.corp.lumeta.com (h65-246-245-10.lumeta.com [65.246.245.10]) by exgw2.lumeta.com (Postfix) with ESMTP id 8ACC837383D for ; Fri, 13 Jun 2003 15:09:12 -0400 (EDT) Received: from localhost (localhost.corp.lumeta.com [127.0.0.1]) by lucy.corp.lumeta.com (Postfix) with ESMTP id 5BBA4A896A for ; Fri, 13 Jun 2003 15:09:12 -0400 (EDT) Received: from lucy.corp.lumeta.com ([127.0.0.1]) by localhost (lucy.corp.lumeta.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18619-04 for ; Fri, 13 Jun 2003 15:09:12 -0400 (EDT) Received: from hburch.corp.lumeta.com (hburch.corp.lumeta.com [65.246.246.59]) by lucy.corp.lumeta.com (Postfix) with ESMTP id 0363DA8968 for ; Fri, 13 Jun 2003 15:09:12 -0400 (EDT) Received: by hburch.corp.lumeta.com (Postfix, from userid 2007) id 1EDE35E3; Fri, 13 Jun 2003 15:09:09 -0400 (EDT) Message-Id: <20030613190909.1EDE35E3@hburch.corp.lumeta.com> Date: Fri, 13 Jun 2003 15:09:09 -0400 (EDT) From: Hal Burch To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/53288: tail will sometimes display more lines than it is told X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Hal Burch List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2003 19:10:17 -0000 >Number: 53288 >Category: bin >Synopsis: tail will sometimes display more lines than it is told >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jun 13 12:10:14 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Hal Burch >Release: FreeBSD 4.8-RC i386 >Organization: Lumeta Comporation >Environment: System: FreeBSD hburch.corp.lumeta.com 4.8-RC FreeBSD 4.8-RC #1: Wed Mar 26 17:25:56 EST 2003 root@hburch.corp.lumeta.com:/usr/obj/usr/src/sys/LOCAL i386 >Description: tail will sometimes output more lines than it is told if the file is being appended to. I believe this is occurs when data is written to the file after tail computes where to start displaying data, but before the display starts. >How-To-Repeat: Run one program that continuously prints out lines to a file: while [ 1 ]; do echo test; done > file While that is running, run a bunch of tails and compute their length for i in `seq 1 1000`; do tail file | wc -l | done > linecnt (In case it's not clear from the name, seq prints out 1 through 1000) Look at the distribution of the line counts that were displayed: sort -n linecnt | uniq -c On my run: 975 10 1 61 1 68 1 118 1 131 1 134 2 138 1 168 2 170 1 174 1 205 1 227 1 235 1 259 1 291 1 348 1 362 1 367 1 797 1 1170 1 1562 1 2198 1 5738 1 5861 >Fix: No known fix. tail could declare the end of the file (when -f is not done) to be the length of the file when it first touches it, but that could cause additional problems. >Release-Note: >Audit-Trail: >Unformatted: