Bug 171996 - Net-SNMP can't handle 64-bit CPU values, return values
Net-SNMP can't handle 64-bit CPU values, return values
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: net-snmp (Show other bugs)
4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Radek Vokal
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-28 17:00 EDT by Hrunting Johnson
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-11-01 08:37:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Patch to fix reading of 64-bit CPU and interrupt counters (2.47 KB, patch)
2005-10-28 17:01 EDT, Hrunting Johnson
no flags Details | Diff
64-bit return value check patch (25.39 KB, patch)
2005-10-28 17:04 EDT, Hrunting Johnson
no flags Details | Diff
64-bit return value check patch (24.73 KB, patch)
2005-10-28 17:33 EDT, Hrunting Johnson
no flags Details | Diff

  None (edit)
Description Hrunting Johnson 2005-10-28 17:00:05 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7

Description of problem:
The way net-snmp is coded, it cannot handle the 64-bit state values from /proc/stat.  Furthermore, certain 64-bit values for things like interfaces can be returned in Counter32 fields.  When these fields are queried from 64-bit boxes, they're 64-bit values, not 32-bit values as they should be.  When these fields are queried from 32-bit boxes, they either return 0 or break the SNMP read altogether because they're the wrong size.

Version-Release number of selected component (if applicable):
net-snmp-5.2.1.2-fc4.1

How reproducible:
Always

Steps to Reproduce:
1. Start up box
2. Let it run for approximately 200 days
3. Try to query the systemStats table for raw CPU counters
  

Actual Results:  Values aren't returned.

Expected Results:  32-bit counters returned.

Additional info:

I'll attache two patches, one to fix specifically the CPU counter problem and one to fix the overall 64-bit-value-in-32-bit-fields problem.
Comment 1 Hrunting Johnson 2005-10-28 17:01:47 EDT
Created attachment 120521 [details]
Patch to fix reading of 64-bit CPU and interrupt counters

This patch is taken from net-snmp-5.2.2pre4, which is the latest release to
contain this fix.  It's relatively minor, changing the sscanf to grab
long-longs and then converting them to unsigned longs.
Comment 2 Hrunting Johnson 2005-10-28 17:04:18 EDT
Created attachment 120522 [details]
64-bit return value check patch

This patch checks the size of long on the host system and if it's longer than 4
bytes, truncates the returning value for fields that are only 32-bits wide. 
This patch was taken from net-snmp-5.2.2pre4, which is the latest version to
contain this fix.  It's a relatively clean patch.  This patch is basically the
same as that found at this URL:

http://sourceforge.net/tracker/download.php?group_id=12694&atid=456380&file_id=146117&aid=1259966
Comment 3 Hrunting Johnson 2005-10-28 17:33:22 EDT
Created attachment 120523 [details]
64-bit return value check patch

This patch checks the size of long on the host system and if it's longer than 4

bytes, truncates the returning value for fields that are only 32-bits wide. 
This patch was taken from net-snmp-5.2.2pre4, which is the latest version to
contain this fix.  It's a relatively clean patch.  This patch is basically the
same as that found at this URL:

http://sourceforge.net/tracker/download.php?group_id=12694&atid=456380&file_id=146117&aid=1259966


[Updated to be the right patch]
Comment 4 Radek Vokal 2005-11-01 08:37:59 EST
I've updated rawhide to net-snmp-5.2.2.rc3 so this issue is fixed there. 

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