ls returns large file sizes

Jonathan Lester jlester at intel-research.net
Thu Dec 22 02:20:06 UTC 2005


Hey,

I've been having trouble with Busybox telling me that all the file and
directories on my filesystem are extremely large: in this case
17592186044416 (which is 2^44). I have a previous binary version of
Busybox from another distribution that correctly displays the right file
sizes so I'm fairly certain it's not a filesystem or kernel problem.
However, whenever I compile Busybox I end up with these large file
sizes. 
[I've included some sample 'ls -al' output at the bottom of the e-mail.]

Interestingly the /dev devices show up correctly (as long as they
correspond to an actual device) and the /proc files and directories show
up as 4398046511104 (which is 2^42) or 0. 

I wasn't able to find any useful clues on Google other than to check to
make sure -malign-double (which isn't a valid flag for an ARM target)
wasn't on and that this might be caused by a conflict between kernel
headers. I so far haven't been able to get Busybox to build if I
explicitly specify -I<blah>/linux-2.6.14/include/linux (it fails with
several parse errors, i.e.
/usr/local/arm/iwmmxt/arm-iwmmxt-linux-gnu/include/gconv.h:72: error:
parse error before "size_t"). I tried changing some of the Rules.mak to
add in various directories and to force it to not use the standard
library/include paths with -nostdlib and -nostdinc. I also tried playing
around leaving in/taking out large file support which didn't seem to
make difference (leaving it out caused init to freak out when parsing
some of the init.d scripts)

 -nostdlib produces a busybox executable that doesn't seem to get past
'Freeing init memory:' (I had to specify crt1.o, crti.o, and libc.a to
get it to compile which didn't seem to help)

 And -nostdinc hasn't compiled yet because of the size_t parse errors.

If anyone has a tricks/patches to fix this problem I'd love to be able
to get this all working. I'm hoping there's a simple solution to getting
past the size_t problem and that will magically make everything work :)


The environment I'm using is:
    Target:     XScale PXA27x processor
    Kernel:     Linux 2.6.14
    Filesystem: jffs2 filesystem
    Toolchain:  created with crosstool 0.38:
                 gcc 3.4.4
                 glibc 2.3.5
                 binutils 2.16.1
    Build Host: Linux 2.6.13 i686 machine


Some examples:
#ls -al
drwxr-xr-x   15 root     root    17592186044416 Jan  1 00:00 .
drwxr-xr-x   15 root     root    17592186044416 Jan  1 00:00 ..
drwxr-xr-x    2 root     root    17592186044416 Dec 19  2005 bin
drwxr-xr-x    5 root     root    17592186044416 Dec 16  2005 dev
drwxr-xr-x    6 root     root    17592186044416 Sep 28  2005 etc
drwxr-xr-x    3 root     root    17592186044416 Dec 17  2005 lib
lrwxrwxrwx    1 root     root    17592186044416 Dec 19  2005 linuxrc ->
bin/busybox
drwxr-xr-x    4 root     root    17592186044416 Sep 26  2005 mnt
dr-xr-xr-x   32 root     root    4398046511104 Jan  1 00:00 proc
drwxr-xr-x    2 root     root    17592186044416 Sep 26  2005 root
drwxr-xr-x    2 root     root    17592186044416 Dec 18  2005 sbin
drwxr-xr-x   10 root     root    17592186044416 Jan  1 00:00 sys
drwxr-xr-x    2 root     root    17592186044416 Jan  1 00:00 tmp
drwxr-xr-x    7 root     root    17592186044416 Sep 28  2005 usr
drwxr-xr-x    4 root     root    17592186044416 Nov 28  2004 var

./proc:
dr-xr-xr-x    4 root     root    4398046511104 Jan  1 00:05 733
-r--r--r--    1 root     root    4398046511104 Jan  1 00:05 apm
-r--r--r--    1 root     root    4398046511104 Jan  1 00:05 buddyinfo
dr-xr-xr-x    4 root     root            0 Jan  1 00:05 bus
-r--r--r--    1 root     root    4398046511104 Jan  1 00:05 cmdline
dr-xr-xr-x    2 root     root            0 Jan  1 00:05 cpu
-r--r--r--    1 root     root    4398046511104 Jan  1 00:05 cpuinfo
-r--r--r--    1 root     root    4398046511104 Jan  1 00:05 devices
-r--r--r--    1 root     root    4398046511104 Jan  1 00:05 diskstats
dr-xr-xr-x    2 root     root            0 Jan  1 00:05 driver
-r--r--r--    1 root     root    4398046511104 Jan  1 00:05 execdomains




More information about the busybox mailing list