Your message dated Sun, 31 Jan 2010 11:06:05 +0000
with message-id <[email protected]>
and subject line Bug#558361: fixed in procps 1:3.2.8-3
has caused the Debian Bug report #558361,
regarding zero instead of real stats (vmstat and others) after counter wrap
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
558361: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=558361
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: procps
Version: 1:3.2.8-2tls
Severity: normal
Tags: patch
Most in-kernel counters nowadays are 64bits, even on 32bit arches.
But procps uses unsigned long internally, and strtoul() to convert
from text to number. In case of overflow, strtoul() returns -1,
and comparing two -1s always results in 0. So with large in-kernel
counters vmstat stops displaying statistics properly, leading to
false system troubleshooting analisys.
The attached patch provides a very simple fix for this, which does
not solve the root problem but makes it disappear in almost all
cases (it only occurs when the actual counter overflows, in which
case the difference between "this" and "previous" will be around
2**32, only once, and this difference is easy to understand) s
that it stops becoming an issue. Real fix involves major code
changes.
Thanks.
-- System Information:
Debian Release: 5.0.3
APT prefers stable
APT policy: (990, 'stable'), (60, 'testing'), (50, 'unstable'), (1,
'experimental')
Architecture: i386 (x86_64)
Kernel: Linux 2.6.32-rc7-amd64 (SMP w/2 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages procps depends on:
ii initscripts 2.86.ds1-61 Scripts for initializing and shutt
ii libc6 2.7-18 GNU C Library: Shared libraries
ii libncurses5 5.7+20081213-1 shared libraries for terminal hand
ii lsb-base 3.2-20 Linux Standard Base 3.2 init scrip
Versions of packages procps recommends:
ii psmisc 22.6-1 Utilities that use the proc filesy
procps suggests no packages.
-- no debconf information
after some uptime, vmstat starts displaying zeros in various
stats columns instead of real numbers. This is because most
kernel counters are now 64bit but in procps they're 32bits on
i386 (and other 32bit arches). To convert values read from
files in /proc, procps uses strtoul(), which returns -1 in
case of overflow. But comparing two -1s always gives 0, so
the statistics becomes useless.
The real fix to this and other similar problems is to always
use 64bit counters in procps. But that requires alot more
changes all over the places.
But much simpler fix is possible too: changing strtoul() to
strtoull() which returns 64bit integer. Hopefully that one
will not overflow. We convert the result into our native
unsigned long by truncating the most significant part if
necessary. This way, we will still have proper least
significant part, which is enough for comparison with
previous value of the same nature, and substraction gives
good result.
Signed-off-by: Michael Tokarev <[email protected]>
--- procps-3.2.8/proc/sysinfo.c.orig 2008-03-24 07:33:43.000000000 +0300
+++ procps-3.2.8/proc/sysinfo.c 2009-11-28 11:53:45.816811421 +0300
@@ -606,3 +606,3 @@ void meminfo(void){
if(!found) goto nextline;
- *(found->slot) = strtoul(head,&tail,10);
+ *(found->slot) = (unsigned long)strtoull(head,&tail,10);
nextline:
--- End Message ---
--- Begin Message ---
Source: procps
Source-Version: 1:3.2.8-3
We believe that the bug you reported is fixed in the latest version of
procps, which is due to be installed in the Debian FTP archive:
libproc-dev_3.2.8-3_amd64.deb
to main/p/procps/libproc-dev_3.2.8-3_amd64.deb
procps_3.2.8-3.debian.tar.gz
to main/p/procps/procps_3.2.8-3.debian.tar.gz
procps_3.2.8-3.dsc
to main/p/procps/procps_3.2.8-3.dsc
procps_3.2.8-3_amd64.deb
to main/p/procps/procps_3.2.8-3_amd64.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Craig Small <[email protected]> (supplier of updated procps package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Sun, 31 Jan 2010 18:31:08 +1100
Source: procps
Binary: procps libproc-dev
Architecture: source amd64
Version: 1:3.2.8-3
Distribution: unstable
Urgency: low
Maintainer: Craig Small <[email protected]>
Changed-By: Craig Small <[email protected]>
Description:
libproc-dev - library for accessing process information from /proc
procps - /proc file system utilities
Closes: 306778 331419 347476 460331 503089 505571 526604 545007 550009 551173
551933 554808 558089 558134 558361 567704
Changes:
procps (1:3.2.8-3) unstable; urgency=low
.
* Changed source format to 3.0 quilt
* rules file to new debhelper tiny format
* some pid points set to null if status file cannot be read Closes: #550009
* vmstat doesn't scale things that shouldn't Closes: #558134
* Limit counter wrap with vmstat Closes: #558361
* Adjusted rules file so wont build amd64 files on i386 Closes:
#558089
* Removed kernel.maps_protect from example file Closes: #554808
* skill doesnt treat null param as 0 Closes: #551173
* Reduced init.d verbosity Closes: #567704
* Documented /etc/sysctl.d directory Closes: #551933
* sysctl.conf warns about RAs ignored with ipv6 forwarding Closes:
#545007
* free -o better documented Closes: #526604
* slabtop -o doesnt use ncurses slabtop_once patch Closes: #503089
* libproc.so symlink in -dev package Closes: #306778
* skill/snice option parsing fixed Closes: #331419
* Forced libproc constructor order Closes: #460331
* pmap -x prints RSS and dirty columns Closes: #347476, #505571
Checksums-Sha1:
dba3e75ae34c15e2d484cca369e29cb5b48e8847 1022 procps_3.2.8-3.dsc
6166efd2f4cbb3167193b2a47ed3ca2e273c39d9 81831 procps_3.2.8-3.debian.tar.gz
b3f0861f2cb3559ab76974084c31471774ca0b9e 246846 procps_3.2.8-3_amd64.deb
f3fa5abdc4ae83b8e4cd9f2668944e048b8a9cf0 64660 libproc-dev_3.2.8-3_amd64.deb
Checksums-Sha256:
cf48e363beb174c9469a88bf37167f5a0885e5d86df6c874343b3111ccef994f 1022
procps_3.2.8-3.dsc
64029e1b0873e7076c390da86a74dd02c0e540c37ab28da1b41114dcbabbdf39 81831
procps_3.2.8-3.debian.tar.gz
af4d07ea8b91b34088da7a071f37eca9c964412538f81c94a3ba1685b7c37f47 246846
procps_3.2.8-3_amd64.deb
318f36d1fbbd46c5ea09dc6d7a1e6d8aa905bc3eed1d6df819a05e6153893ff5 64660
libproc-dev_3.2.8-3_amd64.deb
Files:
d020c30fd7972c8387357bcaf2146eb4 1022 admin required procps_3.2.8-3.dsc
9a8b64dd7a2bebfcac0a84d011d9cb44 81831 admin required
procps_3.2.8-3.debian.tar.gz
a1f626d5eccb26f745debe83861d3efd 246846 admin required procps_3.2.8-3_amd64.deb
feafc7fdbe0935a82f95c278aad0f041 64660 libdevel optional
libproc-dev_3.2.8-3_amd64.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iD8DBQFLZV9Kx2zlrBLK36URAsClAJ9UhcxcjBKg4qrhU0XWKPNQdTuUPACfTjvR
kwhtQ43liljg+++7BIyzGDY=
=EgZ2
-----END PGP SIGNATURE-----
--- End Message ---