Bug 75113 - /proc/uptime shows wrong uptime (slightly) and idle time (totally)
/proc/uptime shows wrong uptime (slightly) and idle time (totally)
Status: CLOSED ERRATA
Product: Red Hat Linux
Classification: Retired
Component: kernel (Show other bugs)
8.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Arjan van de Ven
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-10-04 12:34 EDT by Lev Makhlis
Modified: 2007-04-18 12:47 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-10-17 05:22:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Lev Makhlis 2002-10-04 12:34:03 EDT
From Bugzilla Helper: 
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.0.0-10; Linux) 
 
Description of problem: 
In /proc/uptime, the fractional part of uptime is always .00, 
and the idle time is bogus. 
 
Version-Release number of selected component (if applicable): 
 
 
How reproducible: 
Always 
 
Steps to Reproduce: 
1. awk '/cpu/{print $1, $2 + $3 + $4 + $5, $5}' /proc/stat 
2. cat /proc/uptime 
 
  
 
Actual Results: 
cpu 12993221 12411794 
cpu0 12993221 12411794 
129932.00 21.124147 
 
 
Expected Results: 
cpu 12993221 12411794 
cpu0 12993221 12411794 
129932.21 124117.94 (approximately) 
 
Additional info: 
 
This happens because at line 141 in fs/proc/proc_misc.c, 
a 64-bit parameter (uptime64 >> 9) to sprintf() is interpreted 
as a 32-bit one ("%lu"). 
Either casting the shift result to unsigned long, or changing the format to 
"%llu" will solve the problem.
Comment 1 Arjan van de Ven 2002-10-17 05:22:43 EDT
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2002-206.html

Note You need to log in before you can comment on or make changes to this bug.