From owner-freebsd-current@FreeBSD.ORG Wed Jun 15 02:24:25 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2B8B816A41C for ; Wed, 15 Jun 2005 02:24:25 +0000 (GMT) (envelope-from dwhite@gumbysoft.com) Received: from carver.gumbysoft.com (carver.gumbysoft.com [66.220.23.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id F3BE243D49 for ; Wed, 15 Jun 2005 02:24:24 +0000 (GMT) (envelope-from dwhite@gumbysoft.com) Received: by carver.gumbysoft.com (Postfix, from userid 1000) id D301A72DDB; Tue, 14 Jun 2005 19:24:24 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by carver.gumbysoft.com (Postfix) with ESMTP id CD7A072DD4; Tue, 14 Jun 2005 19:24:24 -0700 (PDT) Date: Tue, 14 Jun 2005 19:24:24 -0700 (PDT) From: Doug White To: Ed Maste In-Reply-To: <20050613205052.GA91486@sandvine.com> Message-ID: <20050614191338.N24745@carver.gumbysoft.com> References: <20050613192308.GA87640@sandvine.com> <20050613130317.G2682@carver.gumbysoft.com> <20050613205052.GA91486@sandvine.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-current@freebsd.org Subject: Re: savecore(8) increments /var/crash/bounds on each boot X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2005 02:24:25 -0000 On Mon, 13 Jun 2005, Ed Maste wrote: > On Mon, Jun 13, 2005 at 01:03:50PM -0700, Doug White wrote: > > > On Mon, 13 Jun 2005, Ed Maste wrote: > > > > > I notice that as of sbin/savecore/savecore.c 1.72 and in 5.4-RELEASE > > > savecore increments the number in /var/crash/bounds on each boot, > > > regardless of whether it rebooted due to panic or was a clean shutdown. > > > > > > Is this the desired behaviour or an unintentional side effect? > > > We've been monitoring the value in bounds to detect panics, which > > > of course doesn't work anymore. > > > > Its certainly not the historical behavior :-) > > > > Think you could submit a patch with the fix? > > The attached patch does the trick. In -vv mode the bounds used to > be included with the first/last dump header output -- I just replaced > it with -1. I don't see how this works. It should generate a bunch of use-uninitialized warning since bounds is used in a sprintf at line 376, in DoFile(): 376: sprintf(buf, "info.%d", bounds); plus additional sprintf's down the file, since the value of bounds is only set by that getbounds() call. The correct fix is to put a else goto done; just above the "newfile" label so it doesn't unconditionally rewrite the bounds file on every call. -- Doug White | FreeBSD: The Power to Serve dwhite@gumbysoft.com | www.FreeBSD.org