From nobody@FreeBSD.org  Thu Mar 16 03:00:33 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9B54716A431
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Mar 2006 03:00:33 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 477B143D4C
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Mar 2006 03:00:24 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k2G30OT8014800
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Mar 2006 03:00:24 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k2G30ObR014799;
	Thu, 16 Mar 2006 03:00:24 GMT
	(envelope-from nobody)
Message-Id: <200603160300.k2G30ObR014799@www.freebsd.org>
Date: Thu, 16 Mar 2006 03:00:24 GMT
From: Peter Verschoor <peter.j.verschoor@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: linprocfs /proc/memory reports wrong size for swap
X-Send-Pr-Version: www-2.3

>Number:         94528
>Category:       kern
>Synopsis:       [linprocfs] linprocfs /proc/memory reports wrong size for swap
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    brucec
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 16 15:09:12 GMT 2006
>Closed-Date:    Tue Mar 02 10:30:41 UTC 2010
>Last-Modified:  Tue Mar 02 10:30:41 UTC 2010
>Originator:     Peter Verschoor
>Release:        5-stable
>Organization:
>Environment:
>Description:
uninitialized variables in sys/compat/linprocfs/linprocfs.c
function: linprocfs_domeminfo()  i and j are uninitialized

you call swap_pager_status(&i, &j);

swap_pager_status does
  *i += sp->sw_nblks;
  *j += sp->sw_used;
 but i and j contain random data

>How-To-Repeat:
top reports wrong size for swap
cat /proc/meminfo has wrong size

has been reported before as kern/31048
still shows as open
>Fix:
solution: initialize i and j to 0 in linprocfs.c before call
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->brucec  
Responsible-Changed-By: brucec 
Responsible-Changed-When: Sun Feb 28 14:37:46 UTC 2010 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=94528 
State-Changed-From-To: open->closed 
State-Changed-By: des 
State-Changed-When: Tue Mar 2 10:30:39 UTC 2010 
State-Changed-Why:  
Fixed in r159995, confirmed by brucec@ 

http://www.freebsd.org/cgi/query-pr.cgi?pr=94528 
>Unformatted:
