From owner-freebsd-bugs@FreeBSD.ORG Tue Feb 5 14:40:02 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00CC216A41B for ; Tue, 5 Feb 2008 14:40:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D07F813C43E for ; Tue, 5 Feb 2008 14:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m15Ee1GB057139 for ; Tue, 5 Feb 2008 14:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m15Ee10X057138; Tue, 5 Feb 2008 14:40:01 GMT (envelope-from gnats) Resent-Date: Tue, 5 Feb 2008 14:40:01 GMT Resent-Message-Id: <200802051440.m15Ee10X057138@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, Cyrus Rahman Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0994416A418 for ; Tue, 5 Feb 2008 14:34:20 +0000 (UTC) (envelope-from cr@silva.signetica.com) Received: from silva.signetica.com (unknown [IPv6:2002:943f:34a2:0:21e:8cff:fe0b:6b0]) by mx1.freebsd.org (Postfix) with ESMTP id 68C7913C4D3 for ; Tue, 5 Feb 2008 14:34:15 +0000 (UTC) (envelope-from cr@silva.signetica.com) Received: from silva.signetica.com (localhost [127.0.0.1]) by silva.signetica.com (8.14.2/8.14.2) with ESMTP id m15EYAgQ025979 for ; Tue, 5 Feb 2008 07:34:10 -0700 (MST) (envelope-from cr@silva.signetica.com) Received: (from cr@localhost) by silva.signetica.com (8.14.2/8.14.2/Submit) id m15EY7E7025978; Tue, 5 Feb 2008 07:34:07 -0700 (MST) (envelope-from cr) Message-Id: <200802051434.m15EY7E7025978@silva.signetica.com> Date: Tue, 5 Feb 2008 07:34:07 -0700 (MST) From: Cyrus Rahman To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/120293: sa(8) fails to summarize/truncate accounting data X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Cyrus Rahman List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2008 14:40:02 -0000 >Number: 120293 >Category: bin >Synopsis: sa(8) fails to summarize/truncate accounting data >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Feb 05 14:40:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Cyrus Rahman >Release: FreeBSD 7.0-RC1 amd64 >Organization: >Environment: System: FreeBSD silva.signetica.com 7.0-RC1 FreeBSD 7.0-RC1 #0: Tue Jan 29 21:59:21 MST 2008 cr@silva.signetica.com:/usr/src/sys/amd64/compile/SIGNETICA amd64 >Description: Sa(8) no longer truncates accounting data with the -s flag. As a result, the /etc/periodic/daily script simply copies an ever-growing file and the active file grows in length until /var is exhausted. >How-To-Repeat: Enable accounting on a server and wait until that new huge /var is full. Or view the messages from /etc/periodic/daily: # sa -s sa: converting user accounting stats: Inappropriate file type or format sa: user accounting initialization failed >Fix: The version record is correctly written into the user and process summary files, but because the compare routine is not specified on the database dbopen() in db_copy_in(), this version record is not reliably found and the user database is assumed to be a version 1 database. Needless to say, the conversion routine fails. The following patch corrects the problem: --- db.c.orig 2008-02-05 07:17:45.000000000 -0700 +++ db.c 2008-02-05 07:18:22.000000000 -0700 @@ -67,7 +67,7 @@ if (iflag) return (0); - if ((ddb = dbopen(dbname, O_RDONLY, 0, DB_BTREE, NULL)) == NULL) { + if ((ddb = dbopen(dbname, O_RDONLY, 0, DB_BTREE, bti)) == NULL) { if (errno == ENOENT) return (0); warn("retrieving %s summary", uname); >Release-Note: >Audit-Trail: >Unformatted: