Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 384505 - app-admin/conky-1.8.1-r2 down and upspeed keep remain high even when interface is idle
Summary: app-admin/conky-1.8.1-r2 down and upspeed keep remain high even when interfac...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Daniel Pielmeier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-26 03:27 UTC by Renato Alves
Modified: 2011-10-28 17:26 UTC (History)
4 users (show)

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


Attachments
net_stat.addrs field size fix (conky_max_interfaces_fix.patch,405 bytes, patch)
2011-10-19 01:44 UTC, Cesar Garcia
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Renato Alves 2011-09-26 03:27:51 UTC
When transferring a file one expects to see the transfer rate of the interface being displayed on the variables "downspeed" and "upspeed". With the version 1.8.1-r2 these values either grow or remain constant even after restarting conky.

After tinkering a bit with the ebuild I was able to recover the correct behavior by disabling the conky-1.8.1-maxinterfaces.patch added in bug 365287. This means that the mentioned patch is either incomplete or has unwanted side-effects.

Reproducible: Always

Steps to Reproduce:
1. Install conky-1.8.1-r2
2. Start downloading a big file while monitoring the output of the downspeed variable in conky (it will increase gradually even if transfer rate is constant)
3. Edit ebuild, disable conky-1.8.1-maxinterfaces.patch and rebuild conky
4. Repeat step 2 and compare output (should be back to normal)



% emerge --info
Portage 2.1.10.11 (default/linux/amd64/10.0, gcc-4.5.3, glibc-2.12.2-r0, 2.6.39-gentoo-r3 x86_64)
=================================================================
System uname: Linux-2.6.39-gentoo-r3-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T9600_@_2.80GHz-with-gentoo-2.0.3
Timestamp of tree: Sun, 25 Sep 2011 14:00:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:          4.1_p9
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.1-r1, 3.2.2
dev-util/ccache:          2.4-r9
dev-util/cmake:           2.8.4-r1
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.9.3-r1
sys-apps/sandbox:         2.4
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r1
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 2.6.36.1 (virtual/os-headers)
sys-libs/glibc:           2.12.2
Repositories: gentoo science sunrise local
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA PUEL skype-eula dlj-1.1 googleearth AdobeFlash-10 AdobeFlash-10.1 RTCW-ETEULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -msse4.1 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core2 -msse4.1 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--load-average 3 --jobs 2"
FEATURES="assume-digests binpkg-logs ccache collision-protect distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://darkstar.ist.utl.pt/gentoo/ http://ftp.dei.uc.pt/pub/linux/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
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"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/science /var/lib/layman/sunrise /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X alsa amd64 bzip2 cli cracklib crypt cups cxx dbus dri firefox fortran gdbm gif gnutls gpm iconv ipv6 jpeg mmx modules mudflap multilib ncurses nls nptl nptlonly opengl openmp pcre perl png pppd python readline sdl session smp sse sse2 sse3 ssl ssse3 sysfs tcpd tiff truetype unicode xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache 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_ftp proxy_http rewrite setenvif speling status unique_id userdir usertrack vhost_alias wsgi" APACHE2_MPMS="worker" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="joystick keyboard mouse synaptics evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="vesa nv nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

app-admin/conky-1.8.1-r2 active flags (X hddtemp mpd nvidia portmon truetype)
Comment 1 Cesar Garcia 2011-10-19 01:15:59 UTC
I can confirm this one, in my case the shown download speed is halved. After removing conky-1.8.1-maxinterfaces.patch everything goes back to normal.
Comment 2 Cesar Garcia 2011-10-19 01:43:15 UTC
Found the cause of why conky-1.8.1-maxinterfaces.patch gives wrong values. Since this patch isn't in upstream i am gonna describe the bug here.

The bug occurs in src/linux.c:397 at this line
memset(ns->addrs, 0, 17 * MAX_NET_INTERFACES + 1); /* Up to 17 chars per ip, max MAX_NET_INTERFACES interfaces. Nasty memory usage... */

The bug happens because in the declaration of the addrs field on the net_stat struct the field is char addrs[273], and that value can be read as "17 * 16 + 1" (16 is the unpatched value of MAX_NET_INTERFACES).

Increasing the MAX_NET_INTERFACES causes a memset of "17*64+1" in a area of only "17*16+1" corrupting the array.

Proposed fix in attached patch.
Comment 3 Cesar Garcia 2011-10-19 01:44:37 UTC
Created attachment 290219 [details, diff]
net_stat.addrs field size fix
Comment 4 Ivan Iraci 2011-10-20 08:28:18 UTC
(In reply to comment #3)

> Created attachment 290219 [details, diff]
> net_stat.addrs field size fix

The above mentioned patch fixes this problem for me too. Thank you! :)
Comment 5 Renato Alves 2011-10-20 23:29:25 UTC
The provided patch also works here. I'd call it a final solution. Thanks to everyone involved.

Can someone add the change to the maxinterfaces.patch file on the main tree?
Comment 6 Daniel Pielmeier gentoo-dev 2011-10-25 17:30:53 UTC
+*conky-1.8.1-r3 (25 Oct 2011)
+
+  25 Oct 2011; Daniel Pielmeier <billie@gentoo.org> -conky-1.8.1-r2.ebuild,
+  +conky-1.8.1-r3.ebuild, files/conky-1.8.1-maxinterfaces.patch:
+  Revison bump to fix bug #384505. Thanks to Renato Alves for the report and
+  Cesar Garcia for the fix.
+
Comment 7 Markos Chandras (RETIRED) gentoo-dev 2011-10-26 22:51:03 UTC
With this match I can't start conky. I am having the usual error again

Conky: desktop window (b4) is root window
Conky: drawing to desktop window
Conky: drawing to double buffer
Conky: too many interfaces used (limit is 16)
Conky: Error destroying thread

I am using 1.8.1-r3
Comment 8 Markos Chandras (RETIRED) gentoo-dev 2011-10-26 22:52:41 UTC
That is because you patched configure.ac.in and NOT configure.ac. You need to patch configure.ac.in and run eautoreconf
Comment 9 Markos Chandras (RETIRED) gentoo-dev 2011-10-26 22:54:32 UTC
Patching configure.ac fixed the problem

Index: files/conky-1.8.1-maxinterfaces.patch
===================================================================
RCS file: /var/cvsroot/gentoo-x86/app-admin/conky/files/conky-1.8.1-maxinterfaces.patch,v
retrieving revision 1.2
diff -u -b -B -u -r1.2 conky-1.8.1-maxinterfaces.patch
--- files/conky-1.8.1-maxinterfaces.patch	25 Oct 2011 17:28:42 -0000	1.2
+++ files/conky-1.8.1-maxinterfaces.patch	26 Oct 2011 22:53:42 -0000
@@ -12,8 +12,8 @@
 
 diff --git a/configure.ac.in b/configure.ac.in
 index 0f00237..d52d998 100644
---- a/configure.ac.in
-+++ b/configure.ac.in
+--- a/configure.ac
++++ b/configure.ac
 @@ -802,7 +802,7 @@ AC_DEFINE(CONFIG_FILE, "$HOME/.conkyrc", [Configfile of the user])
  AC_DEFINE(MAX_SPECIALS_DEFAULT, 512, [Default maximum number of special things, e.g. fonts, offsets, aligns, etc.])
  AC_DEFINE(MAX_USER_TEXT_DEFAULT, 16384, [Default maximum size of config TEXT buffer, i.e. below TEXT line.])
Comment 10 Nikolaj Šujskij 2011-10-27 14:02:20 UTC
Conky from tree works now fine for me (on ~amd64).

Thanks to Renato and Cesar, this bug was really getting on my nerves! Bugfix of the month for me and no mistake. Actually, I write here just to thank you for it. Cheers!
Comment 11 Daniel Pielmeier gentoo-dev 2011-10-28 17:26:37 UTC
(In reply to comment #8)
> That is because you patched configure.ac.in and NOT configure.ac. You need to
> patch configure.ac.in and run eautoreconf

Thanks, you are right. I thought eautoreconf uses configure.ac.in. The patch now applies to configure.ac.