bug: 370557 title: ifdata doesn't support long device names date-reported: Fri, 01 May 2009 21:26:46 -0000 date-updated: Fri, 08 May 2009 13:07:16 -0000 reporter: Alan Pope 🍺🐧🐱 πŸ¦„ (popey) duplicate-of: duplicates: attachments: https://bugs.launchpad.net/bugs/370557/+attachment/578947/+files/Dependencies.txt text/plain; charset="utf-8" https://bugs.launchpad.net/bugs/370557/+attachment/579442/+files/moreutils.diff text/x-diff patches: https://bugs.launchpad.net/bugs/370557/+attachment/579518/+files/patch.txt text/plain tags: apport-bug i386 subscribers: Alan Pope 🍺🐧🐱 πŸ¦„ (popey) James Westby (james-w) task: moreutils (Ubuntu) status: Fix Released date-created: Fri, 01 May 2009 21:26:46 -0000 date-left-new: Fri, 08 May 2009 13:07:15 -0000 date-confirmed: Fri, 08 May 2009 13:07:15 -0000 date-triaged: Fri, 08 May 2009 13:07:15 -0000 date-inprogress: Fri, 08 May 2009 13:07:15 -0000 date-closed: Fri, 08 May 2009 13:07:15 -0000 date-fix-committed: Fri, 08 May 2009 13:07:15 -0000 date-fix-released: Fri, 08 May 2009 13:07:15 -0000 reporter: Alan Pope 🍺🐧🐱 πŸ¦„ (popey) importance: Undecided component: universe assignee: milestone: task: moreutils (Debian) status: Fix Released date-created: Sat, 02 May 2009 15:12:40 -0000 date-closed: Wed, 06 May 2009 12:33:57 -0000 date-fix-released: Wed, 06 May 2009 12:33:57 -0000 reporter: Alan Pope 🍺🐧🐱 πŸ¦„ (popey) watch: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=526654 importance: Unknown component: main assignee: milestone: Content-Type: multipart/mixed; boundary="===============4145885075060892294==" MIME-Version: 1.0 --===============4145885075060892294== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Binary package hint: moreutils alan@hactar:~$ ifdata -sib wlan0 Invalid data read, check! Error getting statistics for wlan0 alan@hactar:~$ cat /proc/net/dev Inter-| Receive | Transmit face |bytes packets errs drop fifo frame compressed multicast|bytes = packets errs drop fifo colls carrier compressed lo: 51332 644 0 0 0 0 0 0 51332 = 644 0 0 0 0 0 0 eth0: 0 0 0 0 0 0 0 0 0 = 0 0 0 0 0 0 0 wmaster0: 0 0 0 0 0 0 0 0 = 0 0 0 0 0 0 0 0 wlan0:91263412 82099 0 0 0 0 0 0 8292238 = 65428 0 0 0 0 0 0 vboxnet0: 0 0 0 0 0 0 0 0 = 0 0 0 0 0 0 0 0 pan0: 0 0 0 0 0 0 0 0 0 = 0 0 0 0 0 0 0 This is due to the check on the field length of the device not being long enough. wmaster0 is more than 6 chars. *** moreutils/ifdata.c 2008-02-02 22:00:53.000000000 +0000 --- moreutils-0.34ubuntu2/ifdata.c 2009-05-01 19:58:38.000000000 +0100 *************** *** 246,252 **** =20 do { int items =3D fscanf(fd, ! " %6[^:]:%llu %llu %llu %llu %llu %llu %llu %llu " "%llu %llu %llu %llu %llu %llu %llu %llu", name, &ifstat->in_bytes, &ifstat->in_packets, --- 246,252 ---- =20 do { int items =3D fscanf(fd, ! " %20[^:]:%llu %llu %llu %llu %llu %llu %llu %llu " "%llu %llu %llu %llu %llu %llu %llu %llu", name, &ifstat->in_bytes, &ifstat->in_packets, ProblemType: Bug Architecture: i386 DistroRelease: Ubuntu 9.04 Package: moreutils 0.34 ProcEnviron: PATH=3D(custom, user) LANG=3Den_GB.UTF-8 SHELL=3D/bin/bash SourcePackage: moreutils Uname: Linux 2.6.28-11-generic i686 --===============4145885075060892294== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Author: =?utf-8?b?QWxhbiBQb3BlIPCfjbrwn5Cn8J+QsSDwn6aEIChwb3BleSk=?= Date: Fri, 01 May 2009 21:26:46 -0000 Message-Id: <20090501212647.6076.75386.malone@potassium.ubuntu.com> --===============4145885075060892294== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Author: =?utf-8?b?QWxhbiBQb3BlIPCfjbrwn5Cn8J+QsSDwn6aEIChwb3BleSk=?= Date: Fri, 01 May 2009 22:03:53 -0000 Message-Id: <20090501220353.31814.261.malone@palladium.canonical.com> Hope this patch works out ok. --===============4145885075060892294== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Author: =?utf-8?b?QWxhbiBQb3BlIPCfjbrwn5Cn8J+QsSDwn6aEIChwb3BleSk=?= Date: Fri, 01 May 2009 22:05:07 -0000 Message-Id: <20090501220507.6076.57557.malone@potassium.ubuntu.com> Lets try that again :) --===============4145885075060892294== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Author: =?utf-8?b?QWxhbiBQb3BlIPCfjbrwn5Cn8J+QsSDwn6aEIChwb3BleSk=?= Date: Fri, 01 May 2009 23:06:55 -0000 Message-Id: <20090501230655.31814.57236.malone@palladium.canonical.com> Ok, to expand on my brief description. ifdata fails with "Invalid data read, check! Error getting statistics for wlan0" due to it looking for 17 items from /proc/net/dev/ on a line (the wlan0 line in my system). However it also carves up the line expecting the net device to be up to 6 characters in length (which typically they are with eth1, wlan0 as examples). However sometimes they are longer:- alan@hactar:~/Development/moreutils/moreutils-0.34$ cat /proc/net/dev Inter-| Receive | Transmit face |bytes packets errs drop fifo frame compressed multicast|bytes = packets errs drop fifo colls carrier compressed lo: 11860 170 0 0 0 0 0 0 11860 = 170 0 0 0 0 0 0 eth0: 0 0 0 0 0 0 0 0 0 = 0 0 0 0 0 0 0 wmaster0: 0 0 0 0 0 0 0 0 = 0 0 0 0 0 0 0 0 wlan0: 4015561 7480 0 0 0 0 0 0 1157487 = 8080 0 0 0 0 0 0 vboxnet0: 0 0 0 0 0 0 0 0 = 0 0 0 0 0 0 0 0 pan0: 0 0 0 0 0 0 0 0 0 = 0 0 0 0 0 0 0 Note vboxnet0 and wmaster0 are both longer than 6 characters. According to include/linux/device.h the net device name can be up to 20 characters in length. So the patch just accommodates larger device names. --===============4145885075060892294== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Author: James Westby (james-w) Date: Sat, 02 May 2009 13:31:40 -0000 Message-Id: <20090502133141.31814.73548.malone@palladium.canonical.com> Hi Alan, I actually meant to provide more explanation in the changelog, not the bug report :-) Also, the Maintainer field has to be adjusted according to https://wiki.ubuntu.com/DebianMaintainerField which can be done with "update-maintainer" in the ubuntu-dev-tools package. Attached is a patch with the suggested changes. Did you manage to get submittodebian to work? Once the patch is in the Debian BTS then I would be happy to upload this. Thanks, James --===============4145885075060892294== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Author: =?utf-8?b?QWxhbiBQb3BlIPCfjbrwn5Cn8J+QsSDwn6aEIChwb3BleSk=?= Date: Sat, 02 May 2009 14:52:59 -0000 Message-Id: <20090502145259.31814.85434.malone@palladium.canonical.com> Have incorporated your change James and submitted to debian. --===============4145885075060892294== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Author: James Westby (james-w) Date: Wed, 06 May 2009 12:51:18 -0000 Message-Id: <20090506125118.26473.53972.malone@gangotri.canonical.com> Hey Popey, This fix was just uploaded to Debian. As the package is unchanged in Ubuntu and because of where we are in the release cycle the autosyncer will update the package next time it is run. Once that's done we can close the bug. Thanks, James --===============4145885075060892294== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Author: James Westby (james-w) Date: Fri, 08 May 2009 13:07:15 -0000 Message-Id: <20090508130715.21664.92903.malone@palladium.canonical.com> This has been synced now. Thanks popey. James --===============4145885075060892294==--