AW: AW: AW: AW: AW: Issue with tar (Busybox 1.20.2): unknown file type

dietmar.schindler at manroland-web.com dietmar.schindler at manroland-web.com
Tue Jun 25 07:01:49 UTC 2013


> Von: piquemal michel [mailto:michel_piquemal at yahoo.fr]
> Gesendet: Montag, 24. Juni 2013 16:09
> ...
> I did rebuilt the whole uclibc and toolchain with long file support: same result (see below
> the extended printf of stat structure): it's definitely an alignment issue.
> Could that come from some GCC optimization? I've not set any in busybox config. It seems
> default buildroot toochain build has some GGC optimizations.
>
> It really seems a related busybox issue (probably something in .config), since other own-
> applications I compiled work without issues: including those working with stat/lstat (through
> glob() for instance).

You cannot infer from a working glob() that there is no issue with [l]stat, since glob() doesn't need the mode flags for example.

> I could not upload cross-compiled uClibc on target, since if I touch the target's one in /lib
> (ram mapped), the target won't work anymore, and I can not build/flash a new firmware.
>
>
>
> # busybox_dyn tar -cf toto.tar tst
> tar: status=0 flags=1  statbuf.st_ino=117074 statbuf.st_mode=838
> tar: sizeof(statbuf.st_ino)=4   offsetof(struct stat, st_mode)=20
> device    : 0x1
> inode     : 117074
> mode      : 0x346
> nlink     : 16877
> uid       : 2
> gid       : 0
> rdev      : 0x0
> size      : 0
> blksize   : 0
> blocks    : 4096
> atime     : 796000001
> mtime     : 796000001
> ctime     : 796000001
> tar: tst: unknown file type
> tar: error exit delayed from previous errors
>
> # busybox_stat tar -cf toto.tar tst
>
> tar: status=0 flags=1  statbuf.st_ino=838 statbuf.st_mode=16877
> tar: sizeof(statbuf.st_ino)=4   offsetof(struct stat, st_mode)=20
> device    : 0x1
> inode     : 838
> mode      : 0x41ed
> nlink     : 2
> uid       : 0
> gid       : 0
> rdev      : 0x0
> size      : 0
> blksize   : 4096
> blocks    : 0
> atime     : 1372079482
> mtime     : 1371975600
> ctime     : 1371975600
> ...

To sum up the findings: The different libc versions on your development and target systems have different definitions of "struct stat"; the development system has st_mode at offset 20, whereas the target's libc places st_ino at offset 20 and st_mode behind it.
The right thing to do would be using the same or compatible versions of libc (most importantly, the header files) on both systems. If you neither dare to update the target's libc nor can find the old libc header files for use on the development system, a dirty hack would be to patch the header file containing the definition of "struct stat" so that st_mode is moved back to offset 20. (You might post "struct stat" if you're unsure how to do it.)
--
Regards,
Dietmar
________________________________________
manroland web systems GmbH -- Managing Director: Eckhard Hoerner-Marass
Registered Office: Augsburg -- Trade Register: AG Augsburg -- HRB-No. 26816 -- VAT: DE281389840

Confidentiality note:
This eMail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient, you are hereby notified that any use or dissemination of this communication is strictly prohibited. If you have received this eMail in error, then please delete this eMail.

! Please consider your environmental responsibility before printing this eMail
________________________________________


More information about the busybox mailing list