Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 39658 - du crashes when run with "-sh .*"
Summary: du crashes when run with "-sh .*"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-28 05:48 UTC by Sorin CONSTANTINESCU
Modified: 2004-10-03 01:22 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sorin CONSTANTINESCU 2004-01-28 05:48:28 UTC
When i run "du -sh .*" in /root (wanting to get the size of all files and directories in /root), du crashes.

korra root # du -sh .* 
727M    .
du: `..': No such file or directory
du: du.c:432: process_file: Assertion `(size_t) info->level == prev_level - 1' failed.
Aborted
korra root #


i ran it with gdb, if it makes more sense to you.

korra root # gdb du
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(no debugging symbols found)...
(gdb) run -sh .*
Starting program: /bin/du -sh .*
727M    .
/bin/du: `..': No such file or directory
du: du.c:432: process_file: Assertion `(size_t) info->level == prev_level - 1' f
ailed.
(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGABRT, Aborted.
0x48fa1731 in kill () from /lib/libc.so.6
(gdb) bt
#0  0x48fa1731 in kill () from /lib/libc.so.6
#1  0x48fa14d5 in raise () from /lib/libc.so.6
#2  0x48fa2a7b in abort () from /lib/libc.so.6
#3  0x48f9ad09 in __assert_fail () from /lib/libc.so.6
#4  0x0804a83f in __ctype_b_loc ()
#5  0x0804fcbd in nftw64 ()
#6  0x0804f46e in nftw64 ()
#7  0x08049e8b in __ctype_b_loc ()
#8  0x08049d14 in __ctype_b_loc ()
#9  0x48f8ddcc in __libc_start_main () from /lib/libc.so.6
(gdb) quit
The program is running.  Exit anyway? (y or n) y



Reproducible: Sometimes
Steps to Reproduce:
1. cd /root
2. du -sh .*


Actual Results:  
du: `..': No such file or directory
du: du.c:432: process_file: Assertion `(size_t) info->level == prev_level - 1'
failed.


Expected Results:  
show size of all (hidden and not hidden) files and directories.

Portage 2.0.49-r20 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r9, 2.6.1-gentoo)
=================================================================
System uname: 2.6.1-gentoo i686 AMD Duron(tm) processor
Gentoo Base System version 1.4.3.10
ccache version 2.3 [enabled]
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=i686 -funroll-loops -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.1/share/config /usr/kde/3/share/config /usr/share/config
/var/qmail/alias /var/qmail/control /var/vpopmail/domains /var/vpopmail/etc"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O3 -march=i686 -funroll-loops -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="ftp://ftp.roedu.net/pub/mirrors/gentoo.org
ftp://ftp.lug.ro/gentoo http://ftp.lug.ro/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://gentoo.inode.at/gentoo-portage"
USE="3dnow X alsa apm arts avi berkdb bonobo crypt cups encode esd foomaticdb gd
gdbm gif gphoto2 gpm gtk gtk2 gtkhtml guile imap imlib jpeg kde libg++ libwww
mad mikmod mmx motif mpeg mysql ncurses nls oggvorbis opengl oss pam perl png
python qt quicktime readline samba sdl slang spell sse ssl svga tcltk tcpd
truetype usb x86 xml2 xmms xv zlib"
Comment 1 Stefan Sperling 2004-01-28 11:49:34 UTC
Do an 'ls -R .*'
You'll see that every file in your machine is being listed.
Seems like du recursively searches it's arguments or something...
ls .* works fine.

As a workaround you can do du -sh .[!.]*, this excludes the '..' directory.
There might be a nicer way though...
Comment 2 aethyr 2004-01-28 14:34:55 UTC
Two things:

#1 it works on my machine (i.e. doesn't crash), but that's with fileutils-4.1.11.  Not sure if your errors are because of how you compiled it.

#2 if I understand what you're trying to do, that's not how you do it. 

Try `du --max-depth=1 -h` instead.
Comment 3 solar (RETIRED) gentoo-dev 2004-01-28 16:34:20 UTC
Works fine with sys-apps/coreutils-5.0.91-r4

When reporting bugs it's really helpfull if you can give the version 
and the name of the pkg your having problems with.

qpkg -f /bin/du
emerge -pv pkgname
Comment 4 Sorin CONSTANTINESCU 2004-01-28 22:40:14 UTC
Hi,

I know it computes the space usage for /root/.. which is actually / , but it shouldn't crash, should it?

korra root # epm -qf /bin/du
fileutils-4.1.11-r1
coreutils-5.0.91-r4
korra root # emerge -pv fileutils

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild     U ] sys-apps/fileutils-4.1.11-r2 [4.1.11-r1]

korra root # emerge -pv coreutils

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] sys-apps/coreutils-5.0.91-r4  +nls -build -acl -selinux -static

korra root #
Comment 5 SpanKY gentoo-dev 2004-10-03 01:22:42 UTC
seems to be resolved in 5.2.1 (or at least a quick test on my box showed it not crashing)