Bug 111768

Summary: /proc/pid/statm can return negative values
Product: Red Hat Enterprise Linux 2.1 Reporter: Greg Marsden <greg.marsden>
Component: kernelAssignee: Mark DeWandel <mdewand>
Status: CLOSED ERRATA QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.1CC: petrides, riel
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-05-12 01:07:54 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 Greg Marsden 2003-12-09 21:30:18 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5)
Gecko/20031120 Firebird/0.7

Description of problem:
Linux memory value reported under /proc/ can become negative
# cat /proc/14907/statm
2116 1350 -2644 53 0 1297 539

This is most likely a result of a type discrepancy in proc/array.c
 return sprintf(buffer,"%d %d %d %d %d %d %d\n",
                        size, resident, share, trs, lrs, drs, dt);
 share = mm->mm_stat.sharable;
 int share in proc/array.c
 unsigned long in sched.h:mm_stat 



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


How reproducible:
Sometimes

Steps to Reproduce:
1. Problem arises for huge shared memory values.
2.
3.
    

Additional info:

Comment 1 Greg Marsden 2003-12-09 21:32:40 UTC
This problem is in AS2.1, havent tested in RHEL 3

Comment 3 John Flanagan 2004-05-12 01:07:54 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-2004-188.html