Bug 75113

Summary: /proc/uptime shows wrong uptime (slightly) and idle time (totally)
Product: [Retired] Red Hat Linux Reporter: Lev Makhlis <lev_makhlis>
Component: kernelAssignee: Arjan van de Ven <arjanv>
Status: CLOSED ERRATA QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-10-17 09:22:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lev Makhlis 2002-10-04 16:34:03 UTC
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 09:22:43 UTC
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