Bug#900001: Conky crashes eventually on linux setups where net interfaces change often
Source: conky Followup-For: Bug #91 Dear Maintainer, this bug seems to be fixed Upstream [1] Best Eike [1] https://github.com/brndnmtthws/conky/pull/479 -- System Information: Debian Release: 9.5 APT prefers stable APT policy: (600, 'stable'), (500, 'stable-updates'), (200, 'unstable'), (100, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.18.0-0.bpo.1-amd64 (SMP w/4 CPU cores) Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=de_DE.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system)
Bug#900001: Conky crashes eventually on linux setups where net interfaces change often
Hi Michael, On Thu, May 24, 2018 at 7:21 AM, Michael Stummvollwrote: > Package: conky > Version: 1.10.8-1 > tags: patch > > Dear Maintainers, > > Conky will keep an internal list of all seen network interfaces, which > is limited to 64. If the number of these interfaces exceeds this limit, > conky will crash. > > While this limit is large enough for most usecases, on a system where > interfaces often appear and disappear (for example by starting > docker-images) conky will eventually run into that limit. > > The supplied patch avoids that issue by removing old network interfaces > from the said internal list, once they disappear. Please forward this patch upstream [1]. Regards, Vincent [1] https://github.com/brndnmtthws/conky
Bug#900001: Conky crashes eventually on linux setups where net interfaces change often
Package: conky Version: 1.10.8-1 tags: patch Dear Maintainers, Conky will keep an internal list of all seen network interfaces, which is limited to 64. If the number of these interfaces exceeds this limit, conky will crash. While this limit is large enough for most usecases, on a system where interfaces often appear and disappear (for example by starting docker-images) conky will eventually run into that limit. The supplied patch avoids that issue by removing old network interfaces from the said internal list, once they disappear. Kind Regards, Michael Stummvoll diff --git a/conky-1.10.8/src/linux.cc b/patched/src/linux.cc index ef39bd0..e4c9fe6 100644 --- a/conky-1.10.8/src/linux.cc +++ b/patched/src/linux.cc @@ -408,6 +408,10 @@ int update_net_stats(void) return 0; } + for (i2 = 0; i2 < MAX_NET_INTERFACES; i2++) { + netstats[i].up = false; + } + /* open file /proc/net/dev. If not something went wrong, clear all * network statistics */ if (!(net_dev_fp = open_file("/proc/net/dev", ))) { @@ -686,6 +690,12 @@ int update_net_stats(void) } #endif /* BUILD_IPV6 */ + for (i = 0; i < MAX_NET_INTERFACES; i++) { + if(netstats[i].dev && !netstats[i].up) { + netstats[i].dev = 0; + } + } + first = 0; fclose(net_dev_fp);