Subject: kern/30115: getrusage returns bogus ru_utime values
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <john@iastate.edu>
List: netbsd-bugs
Date: 05/02/2005 14:50:00
>Number: 30115
>Category: kern
>Synopsis: getrusage returns bogus ru_utime values
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon May 02 14:50:00 +0000 2005
>Originator: john@iastate.edu
>Release: NetBSD 1.6.1_STABLE
>Organization:
Iowa State University
>Environment:
System: NetBSD netreg-2.ait.iastate.edu 1.6.1_STABLE NetBSD 1.6.1_STABLE (NETREG) #0: Mon May 10 14:59:57 CDT 2004 root@socrates.ait.iastate.edu:/tmp/compile/NETREG i386
Architecture: i386
Machine: i386
>Description:
Two calls of getrusage surround a function which does some amount
of work. Sometimes the second call indicates that the process has
used less user time (ru_utime) than was used before the function.
For example the first call might return 0 seconds, 913842 usecs
and then second call might later return 0 seconds, 913803 usecs
which would seem to indicate that the function used the cpu for
a negative 39 usecs. This does not always happen, and I
have never seen it happen in the system time (ru_stime)
>How-To-Repeat:
several times, call getrusage() around a function that does
some small amount of work. See if the second call shows a
lower value than the first in ru_stime.
>Fix: