Bug#922875: xdu: miscounts the size of root directory
Package: xdu Version: 3.0-19 Followup-For: Bug #922875 Dear Maintainer, Here's a patch to fix the issue. -- System Information: Debian Release: 10.0 Architecture: amd64 (x86_64) Kernel: Linux 4.14.0-2-amd64 (SMP w/12 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US: (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages xdu depends on: ii libc6 2.28-10 ii libx11-6 2:1.6.7-1 ii libxaw7 2:1.0.13-1+b2 ii libxt61:1.1.5-1 xdu recommends no packages. xdu suggests no packages. -- no debconf information--- a/xdu.c +++ b/xdu.c @@ -305,6 +305,10 @@ } name++; } + if (arg == 0 && indx == 0) { + top.size = size; + return; + } buf[indx] = 0; path[arg++] = strdup(buf); path[arg] = NULL;
Bug#922875: xdu: miscounts the size of root directory
Hello, Le 22 février 2019, Tanaka Akira a écrit: > Package: xdu > Version: 3.0-18+b2 > Severity: normal > > I found that xdu miscounts the size of root directory. Well, to be honest, this is an old well known upstream bug for a software without active upstream. I will accept any patch that solve it, and might look at it this summer. Thanks for your report. [...] -- Rémi Vanicat
Bug#922875: xdu: miscounts the size of root directory
Package: xdu Version: 3.0-18+b2 Severity: normal I found that xdu miscounts the size of root directory. The problem is reproducible as follows. I used small chroot environment but this problem can occur without chroot. # mkdir /tmp/chroot # cd /tmp/chroot # mkdir -p lib64 lib/x86_64-linux-gnu # cp /lib64/ld-linux-x86-64.so.2 lib64/ # cp /lib/x86_64-linux-gnu/libc.so.6 lib/x86_64-linux-gnu/ # cp /usr/bin/du du # find . . ./lib64 ./lib64/ld-linux-x86-64.so.2 ./lib ./lib/x86_64-linux-gnu ./lib/x86_64-linux-gnu/libc.so.6 ./du # chroot . /du / > /tmp/du-abs.txt # cat /tmp/du-abs.txt 156 /lib64 1656/lib/x86_64-linux-gnu 1660/lib 1924/ # du . > /tmp/du-rel.txt # cat /tmp/du-rel.txt 156 ./lib64 1656./lib/x86_64-linux-gnu 1660./lib 1924. # xdu < /tmp/du-abs.txt # xdu < /tmp/du-rel.txt "xdu < /tmp/du-abs.txt" shows following tree as boxes: * [root] (3740) * lib64 (156) * lib (1660) * x86_64-linux-gnu (1656) * (1924) "xdu < /tmp/du-rel.txt" shows following tree as boxes: * . (1924) * lib64 (156) * lib (1660) * x86_64-linux-gnu (1656) "[root] (3740)" in "xdu < /tmp/du-abs.txt" is wrong. The correct total size is 1924 which is described in du-abs.txt and du-rel.txt. The size 1924 is shown as a unnamed directory under the root directory. I think "xdu < /tmp/du-abs.txt" should show same as "xdu < /tmp/du-rel.txt" except top directory name. -- System Information: Debian Release: 9.7 APT prefers stable APT policy: (500, 'stable') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.9.0-8-amd64 (SMP w/4 CPU cores) Locale: LANG=ja_JP.utf8, LC_CTYPE=ja_JP.utf8 (charmap=UTF-8), LANGUAGE=ja_JP.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages xdu depends on: ii libc6 2.24-11+deb9u3 ii libx11-6 2:1.6.4-3+deb9u1 ii libxaw7 2:1.0.13-1+b2 ii libxt61:1.1.5-1 xdu recommends no packages. xdu suggests no packages. -- no debconf information