Date: Sun, 17 Jun 2012 11:04:02 +0300 (EEST) From: <vsjcfm@gmail.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/169174: [patch] sysutils/htop: fix swap size calculation on i386 Message-ID: <201206170804.q5H842xr092750@jw.lds.net.ua> Resent-Message-ID: <201206170820.q5H8KAeR043915@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 169174 >Category: ports >Synopsis: [patch] sysutils/htop: fix swap size calculation on i386 >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jun 17 08:20:09 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Sayetsky Anton <vsjcfm@gmail.com> >Release: FreeBSD 8.3-RELEASE-p1 i386 >Organization: >Environment: System: FreeBSD jw.local 8.3-RELEASE-p1 FreeBSD 8.3-RELEASE-p1 #0 r235504: Wed May 16 14:33:18 EEST 2012 root@jw.local:/tmp/obj/mnt/garbage/build/src/sys/JASONW i386 >Description: There is an error in my previous htop patch. Swap values can overflow on i386. >How-To-Repeat: Install htop 1.0.1_1 and create swap >2GiB, you will see a value of -2097152MiB >Fix: Patch for previous patch attached. --- patch-Makefile begins here --- --- /usr/ports/sysutils/htop/Makefile 2012-05-30 00:22:56.000000000 +0300 +++ Makefile 2012-06-17 10:53:16.000000000 +0300 @@ -7,7 +7,7 @@ PORTNAME= htop PORTVERSION= 1.0.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils MASTER_SITES= SF --- patch-Makefile ends here --- --- patch-patch-ProcessList.c begins here --- --- /usr/ports/sysutils/htop/files/patch-ProcessList.c 2012-05-30 00:22:56.000000000 +0300 +++ patch-ProcessList.c 2012-06-17 10:53:54.000000000 +0300 @@ -51,8 +51,8 @@ + kd = kvm_open(NULL, _PATH_DEVNULL, NULL, O_RDONLY, NULL); + assert(kd != NULL); + kvm_getswapinfo(kd, kvmswapinfo, 1, 0); -+ this->totalSwap = kvmswapinfo[0].ksw_total * PAGE_SIZE / KB; -+ this->usedSwap = kvmswapinfo[0].ksw_used * PAGE_SIZE / KB; ++ this->totalSwap = kvmswapinfo[0].ksw_total * (PAGE_SIZE / KB); ++ this->usedSwap = kvmswapinfo[0].ksw_used * (PAGE_SIZE / KB); + kvm_close(kd); + len = sizeof(this->totalMem); + SYSCTLBYNAME("vm.stats.vm.v_page_count", this->totalMem, len); --- patch-patch-ProcessList.c ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206170804.q5H842xr092750>