Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 4 product line. The current stable release is 4.9. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 461503

Summary: hrProcessorLoad is not 64bit safe
Product: Red Hat Enterprise Linux 4 Reporter: Olivier Fourdan <ofourdan>
Component: net-snmpAssignee: Jan Safranek <jsafrane>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: urgent    
Version: 4.9CC: kem, ksrot, mkoci, rvokal, tao, vfalico
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-18 20:18:13 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:
Attachments:
Description Flags
Use a long to hold the load average none

Description Olivier Fourdan 2008-09-08 16:45:19 UTC
Created attachment 316106 [details]
Use a long to hold the load average

Description of problem:

In agent/mibgroup/host/hr_proc.c, the avg load is computed internally with an integer whereas the size expected in long, which breaks on 64bit systems () as sizeof(int) != sizeof(long)) so that the load average returns random values on Red Hat Enterprise Linux 4 in 64bits.

Version-Release number of selected component (if applicable):

net-snmp 5.1.2-13

How reproducible:

100% reproducible

Steps to Reproduce:
1. Install net-snmp 5.1.2-13 on a Red Hat Enterprise Linux 4 64bit
2. run snmpwalk localhost -c public -v 2c .1.3.6.1.2.1.25.3.3
  
Actual results:

truncating signed value to 32bits (1)

*or*

HOST-RESOURCES-MIB::hrProcessorLoad.768 = INTEGER: 544106784
HOST-RESOURCES-MIB::hrProcessorLoad.769 = INTEGER: 544106784

Expected results:

HOST-RESOURCES-MIB::hrProcessorFrwID.768 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.769 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorLoad.768 = INTEGER: 2
HOST-RESOURCES-MIB::hrProcessorLoad.769 = INTEGER: 1

Additional info:

This not the same issue as bug 458996 or bug 431439 where the value is not accurate, here the problem is specific to 64bit systems.

The proposed patch here just addresses the issue with 64bit and does not change the way the load is actually computed.

Comment 2 RHEL Program Management 2008-09-08 16:47:33 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 9 errata-xmlrpc 2009-05-18 20:18:13 UTC
An advisory 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 therefore 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/RHBA-2009-0984.html