NetBSD Problem Report #40642

From www@NetBSD.org  Sat Feb 14 15:37:51 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 44E4F63C183
	for <gnats-bugs@gnats.netbsd.org>; Sat, 14 Feb 2009 15:37:51 +0000 (UTC)
Message-Id: <20090214153751.16C6F63C181@narn.NetBSD.org>
Date: Sat, 14 Feb 2009 15:37:51 +0000 (UTC)
From: 6bone@6bone.informatik.uni-leipzig.de
Reply-To: 6bone@6bone.informatik.uni-leipzig.de
To: gnats-bugs@NetBSD.org
Subject: ps shows negative RSS
X-Send-Pr-Version: www-1.0

>Number:         40642
>Category:       bin
>Synopsis:       ps shows negative RSS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 14 15:40:00 +0000 2009
>Closed-Date:    Thu Dec 05 08:27:27 +0000 2013
>Last-Modified:  Thu Dec 05 08:27:27 +0000 2013
>Originator:     Uwe Toenjes
>Release:        netbsd-5-rc2
>Organization:
University of Leipzig
>Environment:
NetBSD 6bone.informatik.uni-leipzig.de 5.0_RC2 NetBSD 5.0_RC2 (MYCONF) #0: Sat Feb 14 09:38:36 CET 2009  root@6bone.informatik.uni-leipzig.de:/usr/obj/sys/arch/amd64/compile/MYCONF amd64

>Description:
ps shows negative RSS for large processes
>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40642 CVS commit: src/bin/ps
Date: Mon, 13 Jun 2011 03:42:15 +0000

 Module Name:	src
 Committed By:	dholland
 Date:		Mon Jun 13 03:42:15 UTC 2011

 Modified Files:
 	src/bin/ps: print.c

 Log Message:
 When converting from pages to kilobytes, cast the return value of
 getpagesize() to size_t. For some reason getpagesize() is defined to
 return int, and several of the page counts we get come back from the
 kernel as int32_t; in LP64 without the cast the byte count will be
 computed in a 32-bit value and for large processes will overflow and
 become negative... and then remain negative when divided by 1024 to
 convert to kilobytes.

 Fixes a problem I hit the other day where I saw negative RSS, which
 turns out also to be PR 40642.

 Note: other logic in here will break down when we first get >2TB
 processes... and int32 page counts will break on >8TB processes. But
 hopefully we won't see any of that for a few years yet.


 To generate a diff of this commit:
 cvs rdiff -u -r1.117 -r1.118 src/bin/ps/print.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Tue, 03 Dec 2013 17:39:30 +0000
State-Changed-Why:
I fixed it in 2011 and evidently forgot to process the PR. Have you
seen the problem since?


From: 6bone@6bone.informatik.uni-leipzig.de
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, dholland@NetBSD.org
Subject: Re: bin/40642 (ps shows negative RSS)
Date: Thu, 5 Dec 2013 08:59:51 +0100 (CET)

 the problem is soved.


 thank you for your efforts

 regards
 Uwe


 On Tue, 3 Dec 2013, dholland@NetBSD.org wrote:

 > Date: Tue,  3 Dec 2013 17:39:31 +0000 (UTC)
 > From: dholland@NetBSD.org
 > Reply-To: gnats-bugs@NetBSD.org
 > To: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, dholland@NetBSD.org,
 >     6bone@6bone.informatik.uni-leipzig.de
 > Subject: Re: bin/40642 (ps shows negative RSS)
 > 
 > Synopsis: ps shows negative RSS
 >
 > State-Changed-From-To: open->feedback
 > State-Changed-By: dholland@NetBSD.org
 > State-Changed-When: Tue, 03 Dec 2013 17:39:30 +0000
 > State-Changed-Why:
 > I fixed it in 2011 and evidently forgot to process the PR. Have you
 > seen the problem since?
 >
 >
 >

State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Thu, 05 Dec 2013 08:27:27 +0000
State-Changed-Why:
Confirmed fixed, thanks.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.