Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Jul 1999 16:00:52 -0500 (CDT)
From:      toasty@dragondata.com
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/12808: vmstat -i output wraps to negative values
Message-ID:  <199907252100.QAA55309@nfs.dragondata.com>

next in thread | raw e-mail | index | archive | help

>Number:         12808
>Category:       bin
>Synopsis:       vmstat -i output wraps to negative values
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 25 14:10:01 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     Kevin Day
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
DragonData Internet Services
>Environment:

Any FreeBSD system

>Description:

The output of vmstat -i will wrap around to negative numbers.

# vmstat -i
interrupt      total      rate
fxp0 irq11   1986997576      618
ata-pci0 irq14 43093267       13
ata-pci0 irq15 85069735       26
pn0 irq10    1083789644      337
ahc0 irq9      433666        0
clk irq0     321001949       99
rtc irq8     410878329      127
Total        -363703130     -113

The 'total' variable is only a signed long. Could this possibly be changed
to an unsigned long or even a long long?

>How-To-Repeat:


>Fix:

In vmstat.c:
	
void
dointr()
{
        register long *intrcnt, inttotal, uptime;


inttotal should be changed to an unsigned long, if not a larger datatype.


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199907252100.QAA55309>