Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 279672 - sys-process/iotop-0.4 fails on missing /proc/vmstat
Summary: sys-process/iotop-0.4 fails on missing /proc/vmstat
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Justin Lecher (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-30 13:07 UTC by Michael O'Brien
Modified: 2012-04-04 06:59 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch from Debian (iotop-gentoo.patch,3.53 KB, patch)
2010-05-31 09:48 UTC, Paul Wise (Debian)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael O'Brien 2009-07-30 13:07:58 UTC
Launch sys-process/iotop-0.3 or 0.3.1 after emerging and watch this show up in my terminal:

Traceback (most recent call last):
  File "/usr/bin/iotop", line 16, in <module>
    main()
  File "/usr/lib64/python2.6/site-packages/iotop/ui.py", line 365, in main
    main_loop()
  File "/usr/lib64/python2.6/site-packages/iotop/ui.py", line 355, in <lambda>
    main_loop = lambda: run_iotop(options)
  File "/usr/lib64/python2.6/site-packages/iotop/ui.py", line 271, in run_iotop
    return curses.wrapper(run_iotop_window, options)
  File "/usr/lib64/python2.6/curses/wrapper.py", line 44, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/lib64/python2.6/site-packages/iotop/ui.py", line 263, in run_iotop_window
    process_list = ProcessList(taskstats_connection, options)
  File "/usr/lib64/python2.6/site-packages/iotop/data.py", line 313, in __init__
    self.vmstat = vmstat.VmStat()
  File "/usr/lib64/python2.6/site-packages/iotop/vmstat.py", line 6, in __init__
    self.vmstat = self.read()
  File "/usr/lib64/python2.6/site-packages/iotop/vmstat.py", line 23, in read
    return pgpgin, pgpgout
UnboundLocalError: local variable 'pgpgin' referenced before assignment

Reproducible: Always

Steps to Reproduce:
1. emerge -a sys-process/iotop
2. iotop
3. iotop crashes

Actual Results:  
Traceback (most recent call last):
  File "/usr/bin/iotop", line 16, in <module>
    main()
  File "/usr/lib64/python2.6/site-packages/iotop/ui.py", line 365, in main
    main_loop()
  File "/usr/lib64/python2.6/site-packages/iotop/ui.py", line 355, in <lambda>
    main_loop = lambda: run_iotop(options)
  File "/usr/lib64/python2.6/site-packages/iotop/ui.py", line 271, in run_iotop
    return curses.wrapper(run_iotop_window, options)
  File "/usr/lib64/python2.6/curses/wrapper.py", line 44, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/lib64/python2.6/site-packages/iotop/ui.py", line 263, in run_iotop_window
    process_list = ProcessList(taskstats_connection, options)
  File "/usr/lib64/python2.6/site-packages/iotop/data.py", line 313, in __init__
    self.vmstat = vmstat.VmStat()
  File "/usr/lib64/python2.6/site-packages/iotop/vmstat.py", line 6, in __init__
    self.vmstat = self.read()
  File "/usr/lib64/python2.6/site-packages/iotop/vmstat.py", line 23, in read
    return pgpgin, pgpgout
UnboundLocalError: local variable 'pgpgin' referenced before assignment

Expected Results:  
user gets to watch which processes are using disk I/O

I had this problem on gentoo-sources, kernel version 2.6.28 before I hopped to zen-sources. I have tried "sane" CFlags/LDFlags even though I've *never* had a problem with the ones listed below with Xfce4 or even OpenOffice.

emerge --info:
Portage 2.2_rc33 (default/linux/amd64/2008.0, gcc-4.3.3, glibc-2.10.1-r0, 2.6.30-zen1 x86_64)
=================================================================
System uname: Linux-2.6.30-zen1-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q6700_@_2.66GHz-with-gentoo-2.0.1
Timestamp of tree: Wed, 29 Jul 2009 22:00:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p28
dev-java/java-config: 2.1.8-r1
dev-lang/python:     2.5.4-r3, 2.6.2-r1
dev-util/ccache:     2.4-r8
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.4.3-r3
sys-apps/sandbox:    2.0
sys-devel/autoconf:  2.63-r1
sys-devel/automake:  1.9.6-r2, 1.10.2, 1.11
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -mno-push-args -mcx16 -msahf"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=native -O2 -pipe -mno-push-args -mcx16 -msahf"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--jobs 3 --keep-going"
FEATURES="ccache distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.mirrors.easynews.com/linux/gentoo/ http://mirror.usu.edu/mirrors/gentoo/ http://gentoo.osuosl.org/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,-z,now -Wl,--hash-style=gnu"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/usr/portage/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/berkano /usr/local/portage/layman/xfce-dev /usr/local/portage/layman/java-overlay /usr/local/portage/layman/zen-overlay /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="a52 aac acl acpi alsa amd64 berkdb bzip2 cdr cli cracklib crypt dbus dri dts dvd dvdr dvdread encode flac fortran gdbm gif gtk hal hashstyle iconv isdnlog jpeg midi minimal mmx mmx2 mmxext mp3 mpeg mudflap multilib ncurses nls nptl nptlonly openmp pam pcre pdf perl php png pppd python quicktime readline reflection rtsp session spl sse sse2 sse3 ssl ssse3 startup-notification svg sysfs tcpd threads tiff truetype unicode vorbis x264 xml xorg zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="alias authz_host autoindex cache deflate dir disk_cache file_cache filter headers include log_config logio mem_cache mime mime_magic setenvif unique_id usertrack" APACHE2_MPMS="worker" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="ncurses text" USERLAND="GNU" VIDEO_CARDS="nvidia"
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-09-24 04:02:27 UTC
It doesn't even start?
Comment 2 Michael O'Brien 2009-09-24 08:46:41 UTC
(In reply to comment #1)
> It doesn't even start?
> 

That would be correct
Comment 3 Conrad Kostecki gentoo-dev 2009-10-07 19:29:25 UTC
Yes, same problem here :(

Bl4ckB0x / # iotop
Traceback (most recent call last):
  File "/usr/bin/iotop", line 16, in <module>
    main()
  File "/usr/lib64/python2.6/site-packages/iotop/ui.py", line 541, in main
    main_loop()
  File "/usr/lib64/python2.6/site-packages/iotop/ui.py", line 531, in <lambda>
    main_loop = lambda: run_iotop(options)
  File "/usr/lib64/python2.6/site-packages/iotop/ui.py", line 446, in run_iotop
    return curses.wrapper(run_iotop_window, options)
  File "/usr/lib64/python2.6/curses/wrapper.py", line 44, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/lib64/python2.6/site-packages/iotop/ui.py", line 438, in run_iotop_window
    process_list = ProcessList(taskstats_connection, options)
  File "/usr/lib64/python2.6/site-packages/iotop/data.py", line 332, in __init__
    self.vmstat = vmstat.VmStat()
  File "/usr/lib64/python2.6/site-packages/iotop/vmstat.py", line 6, in __init__
    self.vmstat = self.read()
  File "/usr/lib64/python2.6/site-packages/iotop/vmstat.py", line 23, in read
    return pgpgin, pgpgout
UnboundLocalError: local variable 'pgpgin' referenced before assignment
Comment 4 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-10-30 04:35:13 UTC
Hi, sorry...I seem to have missed this comment.

This package works for me and other people that I have asked to confirm this bug. If anyone finds something wrong (with a fix) please let me know. Thanks for understanding.
Comment 5 Xake 2009-12-23 14:44:34 UTC
I did hit this bug rarely before, but not since 0.3.2{,-r1} afaik. Have you tried that version?
Comment 6 Vitaliy V. Osypenko 2010-01-16 14:06:08 UTC
Same error with iotop-0.4

Traceback (most recent call last):
  File "/usr/bin/iotop", line 16, in <module>
    main()
  File "/usr/lib64/python2.6/site-packages/iotop/ui.py", line 547, in main
    main_loop()
  File "/usr/lib64/python2.6/site-packages/iotop/ui.py", line 537, in <lambda>
    main_loop = lambda: run_iotop(options)
  File "/usr/lib64/python2.6/site-packages/iotop/ui.py", line 452, in run_iotop
    return curses.wrapper(run_iotop_window, options)
  File "/usr/lib64/python2.6/curses/wrapper.py", line 44, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/lib64/python2.6/site-packages/iotop/ui.py", line 444, in run_iotop_window
    process_list = ProcessList(taskstats_connection, options)
  File "/usr/lib64/python2.6/site-packages/iotop/data.py", line 335, in __init__
    self.vmstat = vmstat.VmStat()
  File "/usr/lib64/python2.6/site-packages/iotop/vmstat.py", line 6, in __init__
    self.vmstat = self.read()
  File "/usr/lib64/python2.6/site-packages/iotop/vmstat.py", line 23, in read
    return pgpgin, pgpgout
UnboundLocalError: local variable 'pgpgin' referenced before assignment

Portage 2.2_rc61 (default/linux/amd64/10.0/desktop, gcc-4.4.2, glibc-2.11-r1, 2.6.31-zen10-bfs x86_64)
=================================================================
System uname: Linux-2.6.31-zen10-bfs-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_3800+-with-gentoo-2.0.1
Timestamp of tree: Sat, 16 Jan 2010 01:45:03 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p35
dev-java/java-config: 2.1.10
dev-lang/python:     2.6.4, 3.1.1-r1
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.8.0
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.0
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.6.3-r1, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe -fomit-frame-pointer --param max-gcse-passes=8 -fno-strict-overflow -fno-delete-null-pointer-checks -fno-tree-vrp -mno-align-stringops -minline-stringops-dynamically -mno-push-args -fno-ident"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo"
CXXFLAGS="-O2 -march=native -pipe -fomit-frame-pointer --param max-gcse-passes=8 -fno-strict-overflow -fno-delete-null-pointer-checks -fno-tree-vrp -mno-align-stringops -minline-stringops-dynamically -mno-push-args -fno-ident"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y --keep-going"
FEATURES="assume-digests buildpkg ccache distlocks fixpackages metadata-transfer news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.linux.cz/pub/linux/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="en cs ru"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp/portage"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/desktop-effects /usr/local/portage/layman/gnome /usr/local/portage/layman/sunrise /usr/local/portage/layman/Spring /usr/local/portage/layman/zugaina /usr/local/portage/layman/kde-testing /usr/local/portage/layman/rion /usr/local/portage/layman/arcon /usr/local/portage/layman/rostov /usr/local/portage/layman/kde3 /usr/local/portage/layman/mozilla /system/portage-local /usr/portage"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext 64bit 7zip X a52 aac acl acpi alsa amd64 avi bash-completion bitmap-fonts bluetooth branding bzip2 cairo cddb cdr cli cpudetection cracklib crypt css cups cxx dbus devmap dlloader dri dts dv dvd dvdr dvdread emboss emul-linux-x86 encode evo extensions fam fbcon ffmpeg firefox flac fortran ftp fuse gdbm gif glut gnutls gpm gstreamer gtk gtk2 hal htmlhandbook iconv ieee1394 ipv6 jpeg kde lame libg++ libnotify lm_sensors logitech-mouse mad mikmod mmx mng modules mp3 mp4 mpeg mplayer mudflap multilib musepack musicbrainz ncurses nls nptl nptlonly nvidia ogg opengl openmp oss pam pcre pdf pdflib perl png ppds pppd python qt3 qt3support qt4 quicktime readline reflection sdl session spell spl sse sse-filters sse2 sse3 ssl startup-notification svg symlink sysfs tcpd threads thunar tiff tk truetype truetype-fonts type1-fonts udev unicode usb utf8 vcd vorbis x264 xcomposite xml xorg xscreensaver xulrunner xv xvid zlib" ALSA_CARDS="intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en cs ru" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia vesa"
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Comment 7 Max Arnold 2010-05-07 17:53:12 UTC
Hit the same issue with iotop-0.4. In order to work it needs some kernel counters in /proc/vmstat. Enable CONFIG_VM_EVENT_COUNTERS in kernel configuration.

Probably ebuild needs additional CONFIG_CHECK entry.
Comment 8 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-05-23 04:53:36 UTC
nice find, thanks for the follow-up
Comment 9 Paul Wise (Debian) 2010-05-31 09:48:25 UTC
Created attachment 233611 [details, diff]
patch from Debian

Here is a patch from Debian that detects the lack of CONFIG_VM_EVENT_COUNTERS in the kernel config and fails gracefully instead of crashing. As an added bonus it prevents iotop from whining about requirements that are available.
Comment 10 Michael Weber (RETIRED) gentoo-dev 2011-03-30 07:17:29 UTC
Hi, can you please test this with iotop-0.4.1 in tree, thank you.

It should die with an decent message like

gauss linux # iotop
Could not run iotop as some of the requirements are not met:
- Linux >= 2.6.20 with
  - VM event counters (CONFIG_VM_EVENT_COUNTERS)
Comment 11 Dirkjan Ochtman (RETIRED) gentoo-dev 2012-02-16 13:32:51 UTC
Reassigning to new maintainer.
Comment 12 Justin Lecher (RETIRED) gentoo-dev 2012-04-04 06:59:21 UTC
should be fixed sufficiently