From davidf@mks.com  Fri Dec 29 21:46:44 1995
Received: from mail.mks.com (mks-gate.mks.com [142.77.7.224])
          by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id VAA00865
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 29 Dec 1995 21:46:38 -0800 (PST)
Received: from mks.com (giga.mks.com [1.0.0.51])
	by mail.mks.com (8.6.8.1/DEKA-950919b) with SMTP id AAA22192
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 30 Dec 1995 00:45:36 -0500
Received: from deci.mks.com by mks.com (4.1/GIGA-950913a)
	id AA10102; Sat, 30 Dec 95 00:45:34 EST
Received: (from davidf@localhost) by deci.mks.com (8.6.12/8.6.12) id AAA00447; Fri, 29 Dec 1995 00:47:43 -0500
Message-Id: <199512290547.AAA00447@deci.mks.com>
Date: Fri, 29 Dec 1995 00:47:43 -0500
From: "David J. Fiander" <davidf@mks.com>
Reply-To: davidf@mks.com
To: FreeBSD-gnats-submit@freebsd.org
Subject:
X-Send-Pr-Version: 3.2

>Number:         921
>Category:       kern
>Synopsis:       getrusage() returns 0 after system up for a long time
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 29 21:50:01 PST 1995
>Closed-Date:    Tue Oct 22 13:49:16 PDT 1996
>Last-Modified:  Tue Nov 27 18:52:39 PST 2001
>Originator:     David J. Fiander
>Release:        FreeBSD 2.1-STABLE i386
>Organization:
Mortice Kern Systems, Inc.
>Environment:

	

>Description:

	The user and system times returned by getrusage() stop
	working once the system has been up sufficiently long (I'm
	not sure what "sufficiently long" is, but it's on the order
	of hours or days).  When they break, they always return 0.

	I've tracked this down to the kernel function calcru().
	This breaks time(1), top(1), and the kernel status information
	returned from the extended control character ^T.

	For top(1) and the kernel status info, not only are the
	times broken, but so is the %cpu reported.

>How-To-Repeat:

	Leave the system running for a while with top running.
	Eventually the most active processes will suddenly have
	0% CPU usage.
>Fix:
	
	My guess is that the calculations in calcru() are overflowing.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: scrappy 
State-Changed-When: Mon Oct 21 23:31:31 PDT 1996 
State-Changed-Why:  

Dust off the cobwebs - Confirm Status 
State-Changed-From-To: feedback->closed 
State-Changed-By: scrappy 
State-Changed-When: Tue Oct 22 13:49:16 PDT 1996 
State-Changed-Why:  

Originator Confirmed Closure 
>Unformatted:
David J. Fiander
no
getrusage(2) stops working once the system has been up long enough
non-critical
high
sw-bug
