NetBSD Problem Report #29505

From njoly@pasteur.fr  Tue Feb 22 13:50:14 2005
Return-Path: <njoly@pasteur.fr>
Received: from electre.pasteur.fr (electre.pasteur.fr [157.99.64.120])
	by narn.netbsd.org (Postfix) with ESMTP id 8C39B63B400
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 22 Feb 2005 13:50:13 +0000 (UTC)
Message-Id: <20050222135000.CEEDC6B431@lanfeust.sis.pasteur.fr>
Date: Tue, 22 Feb 2005 14:50:00 +0100 (CET)
From: njoly@pasteur.fr
Reply-To: njoly@pasteur.fr
To: gnats-bugs@netbsd.org
Subject: Csw value overflow in "systat vmstat"
X-Send-Pr-Version: 3.95

>Number:         29505
>Category:       bin
>Synopsis:       Csw value overflow in "systat vmstat"
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 22 13:51:00 +0000 2005
>Closed-Date:    Tue Feb 22 15:25:44 +0000 2005
>Last-Modified:  Tue Feb 22 15:25:44 +0000 2005
>Originator:     Nicolas Joly
>Release:        NetBSD 2.99.16
>Organization:
Institut Pasteur, Paris.
>Environment:
System: NetBSD lanfeust.sis.pasteur.fr 2.99.16 NetBSD 2.99.16 (LANFEUST) #9: Fri Feb 18 16:10:29 CET 2005 njoly@lanfeust.sis.pasteur.fr:/local/src/NetBSD/obj/amd64/sys/arch/amd64/compile/LANFEUST amd64
Architecture: x86_64
Machine: amd64
>Description:
I noticed that Csw field in `systat vmstat' display sometimes overflow the
4 characters limit; by exmaple, while running some xscreensaver GL hacks:

Proc:r  d  s  w    Csw   Trp   Sys  Int  Sof   Flt            PAGING   SWAPPING
     1    13      **** 15424 22861   17 7614  7942            in  out   in  out

Increasing the field to allow 5 characters give better result:

Proc:r  d  s  w    Csw   Trp   Sys  Int  Sof   Flt            PAGING   SWAPPING
     1    13     12927 13154 19840    5 6609  6677            in  out   in  out

>How-To-Repeat:

>Fix:
Index: usr.bin/systat/vmstat.c
===================================================================
RCS file: /cvsroot/src/usr.bin/systat/vmstat.c,v
retrieving revision 1.57
diff -u -r1.57 vmstat.c
--- usr.bin/systat/vmstat.c	3 Feb 2005 16:16:00 -0000	1.57
+++ usr.bin/systat/vmstat.c	22 Feb 2005 13:37:43 -0000
@@ -142,7 +142,7 @@
 #define PROCSROW	 2	/* uses 2 rows and 20 cols */
 #define PROCSCOL	 0
 #define GENSTATROW	 2	/* uses 2 rows and 30 cols */
-#define GENSTATCOL	18
+#define GENSTATCOL	17
 #define VMSTATROW	 7	/* uses 17 rows and 15 cols */
 #define VMSTATCOL	64
 #define GRAPHROW	 5	/* uses 3 rows and 51 cols */
@@ -355,7 +355,7 @@
 	if (LINES - 1 > VMSTATROW + 16)
 		mvprintw(VMSTATROW + 16, VMSTATCOL + 10, "pdscn");

-	mvprintw(GENSTATROW, GENSTATCOL, " Csw   Trp   Sys  Int  Sof   Flt");
+	mvprintw(GENSTATROW, GENSTATCOL, "  Csw   Trp   Sys  Int  Sof   Flt");

 	mvprintw(GRAPHROW, GRAPHCOL,
 		"    . %% Sy    . %% Us    . %% Ni    . %% In    . %% Id");
@@ -540,12 +540,12 @@
 	PUTRATE(uvmexp.pgswapin, PAGEROW + 3, PAGECOL + 5, 5);
 	PUTRATE(uvmexp.pgswapout, PAGEROW + 3, PAGECOL + 10, 5);

-	PUTRATE(uvmexp.swtch, GENSTATROW + 1, GENSTATCOL, 4);
-	PUTRATE(uvmexp.traps, GENSTATROW + 1, GENSTATCOL + 4, 6);
-	PUTRATE(uvmexp.syscalls, GENSTATROW + 1, GENSTATCOL + 10, 6);
-	PUTRATE(uvmexp.intrs, GENSTATROW + 1, GENSTATCOL + 16, 5);
-	PUTRATE(uvmexp.softs, GENSTATROW + 1, GENSTATCOL + 21, 5);
-	PUTRATE(uvmexp.faults, GENSTATROW + 1, GENSTATCOL + 26, 6);
+	PUTRATE(uvmexp.swtch, GENSTATROW + 1, GENSTATCOL, 5);
+	PUTRATE(uvmexp.traps, GENSTATROW + 1, GENSTATCOL + 5, 6);
+	PUTRATE(uvmexp.syscalls, GENSTATROW + 1, GENSTATCOL + 11, 6);
+	PUTRATE(uvmexp.intrs, GENSTATROW + 1, GENSTATCOL + 17, 5);
+	PUTRATE(uvmexp.softs, GENSTATROW + 1, GENSTATCOL + 22, 5);
+	PUTRATE(uvmexp.faults, GENSTATROW + 1, GENSTATCOL + 27, 6);
 	for (l = 0, i = 0, r = DISKROW, c = DISKCOL; i < dk_ndrive; i++) {
 		if (!dk_select[i])
 			continue;

>Release-Note:

>Audit-Trail:
From: Christos Zoulas <christos@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/29505 CVS commit: src/usr.bin/systat
Date: Tue, 22 Feb 2005 15:13:57 +0000 (UTC)

 Module Name:	src
 Committed By:	christos
 Date:		Tue Feb 22 15:13:57 UTC 2005

 Modified Files:
 	src/usr.bin/systat: vmstat.c

 Log Message:
 PR/29505: Nicolas Joly: Increase width of csw value in systat vmstat.


 To generate a diff of this commit:
 cvs rdiff -r1.57 -r1.58 src/usr.bin/systat/vmstat.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->closed
State-Changed-By: christos@netbsd.org
State-Changed-When: Tue, 22 Feb 2005 10:25:44 -0500
State-Changed-Why:
fixed thanks


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.