From owner-freebsd-bugs@FreeBSD.ORG Tue Jul 15 00:10:18 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 CBCAC37B401 for ; Tue, 15 Jul 2003 00:10:18 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D6AEA43FBD for ; Tue, 15 Jul 2003 00:10:17 -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 h6F7AHUp067015 for ; Tue, 15 Jul 2003 00:10:17 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h6F7AHYD067014; Tue, 15 Jul 2003 00:10:17 -0700 (PDT) Resent-Date: Tue, 15 Jul 2003 00:10:17 -0700 (PDT) Resent-Message-Id: <200307150710.h6F7AHYD067014@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, Colin Percival Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 01A8637B401 for ; Tue, 15 Jul 2003 00:02:41 -0700 (PDT) Received: from builder.daemonology.net (h24-87-233-42.vc.shawcable.net [24.87.233.42]) by mx1.FreeBSD.org (Postfix) with SMTP id 1949E43FBD for ; Tue, 15 Jul 2003 00:02:40 -0700 (PDT) (envelope-from cperciva@builder.daemonology.net) Received: (qmail 26216 invoked by uid 1000); 15 Jul 2003 07:02:32 -0000 Received: (for user cperciva) Message-Id: <20030715070232.26214.qmail@builder.daemonology.net> Date: 15 Jul 2003 07:02:32 -0000 From: Colin Percival To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/54492: tail -F duplicates lines X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Colin Percival List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 07:10:19 -0000 >Number: 54492 >Category: bin >Synopsis: tail -F duplicates lines >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jul 15 00:10:17 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Colin Percival >Release: FreeBSD 4.7-SECURITY >Organization: >Environment: >Description: tail -F sometimes duplicates lines after the first rotation. >How-To-Repeat: cperciva@beastie$ rm foo && touch foo && ( for x in 1 2 3 4 5; do echo hello $x > foo && sleep 2 && echo world $x >> foo;done & tail -F foo ) hello 1 world 1 hello 2 hello 2 # this line shouldn't be here world 2 hello 3 hello 3 # this line shouldn't be here world 3 hello 4 hello 4 # this line shouldn't be here world 4 hello 5 hello 5 # this line shouldn't be here world 5 I've also observed this when using `tail -F` on Apache logfiles (again, after the file has been rotated once; when that happens, it prints out all the lines in the file again, as if the file had been rotated). >Fix: Based on the symptoms, I'd say it looks like a bug in either the rotation-detection or the truncation-detection code; but I'm not familiar enough with kqueue to say any more than that. >Release-Note: >Audit-Trail: >Unformatted: