From owner-freebsd-current@FreeBSD.ORG Mon Jun 13 20:50:56 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 0515D16A41C for ; Mon, 13 Jun 2005 20:50:56 +0000 (GMT) (envelope-from emaste@phaedrus.sandvine.ca) Received: from mailserver.sandvine.com (sandvine.com [199.243.201.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id 906DC43D49 for ; Mon, 13 Jun 2005 20:50:53 +0000 (GMT) (envelope-from emaste@phaedrus.sandvine.ca) Received: from labgw2.phaedrus.sandvine.com ([192.168.3.11]) by mailserver.sandvine.com with Microsoft SMTPSVC(5.0.2195.6713); Mon, 13 Jun 2005 16:50:52 -0400 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 12627) id 47CE013607; Mon, 13 Jun 2005 16:50:52 -0400 (EDT) Date: Mon, 13 Jun 2005 16:50:52 -0400 From: Ed Maste To: Doug White Message-ID: <20050613205052.GA91486@sandvine.com> References: <20050613192308.GA87640@sandvine.com> <20050613130317.G2682@carver.gumbysoft.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="17pEHd4RhPHOinZp" Content-Disposition: inline In-Reply-To: <20050613130317.G2682@carver.gumbysoft.com> User-Agent: Mutt/1.4.2.1i X-OriginalArrivalTime: 13 Jun 2005 20:50:52.0500 (UTC) FILETIME=[963E6940:01C57059] 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: Mon, 13 Jun 2005 20:50:56 -0000 --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. Problem originally discovered by Adrian Dewhurst. -- Ed Maste, Sandvine Inc. --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="savecore.patch" --- savecore.c.orig 2005-06-13 16:19:41.000000000 -0400 +++ savecore.c 2005-06-13 16:16:39.000000000 -0400 @@ -236,7 +236,6 @@ int bounds, status; u_int sectorsize; - bounds = getbounds(); dmpcnt = 0; mediasize = 0; status = STATUS_UNKNOWN; @@ -337,10 +336,10 @@ if (verbose >= 2) { printf("First dump headers:\n"); - printheader(stdout, &kdhf, device, bounds, -1); + printheader(stdout, &kdhf, device, -1, -1); printf("\nLast dump headers:\n"); - printheader(stdout, &kdhl, device, bounds, -1); + printheader(stdout, &kdhl, device, -1, -1); printf("\n"); } @@ -373,6 +372,8 @@ goto closefd; } + bounds = getbounds(); + sprintf(buf, "info.%d", bounds); /* --17pEHd4RhPHOinZp--