write error with new version of tar

Chris Staub chris at beaker67.com
Fri Mar 19 06:08:54 PDT 2010


I started a new build of current dev LFS, and noticed some strange 
behavior from tar once inside chroot. Using tar 1.23, attempting to pipe 
its "tf" output through "head" results in a "tar: write error". In other 
words...

tar -tjf /home/sources/glibc-2.11.1.tar.bz2 | head -n1
glibc-2.11.1/
./tar-1.23/src/tar: write error

I do not get any kind of error message when just using "tar -tf" by 
itself, only when piping through "head". Also, I tried piping through 
various other programs (grep, sed...) and got nothing. Initially I 
thought there was some problem with filesystems mounted or something 
like that in the chroot, but I get exactly the same result on my host 
system. In fact, if I unpack tar 1.22 and do "./configure && make", then 
do the same with tar 1.23, and try using the "tf" option with both 
versions of tar (this is on my host system)...

chris at chris_laptop:~$ ./tar-1.22/src/tar -tjf 
/home/sources/glibc-2.11.1.tar.bz2 | head -n1
./tar-1.22/src/tar: Record size = 8 blocks
glibc-2.11.1/
chris at chris_laptop:~$ ./tar-1.23/src/tar -tjf 
/home/sources/glibc-2.11.1.tar.bz2 | head -n1
glibc-2.11.1/
./tar-1.23/src/tar: write error
chris at chris_laptop:~$

I also get the same result inside chroot. My host system is a 
few-months-old CLFS build with EGLIBC, and the chroot environment is a 
current LFS dev build, so there are different versions of both libc and 
Coreutils, but I get the same results. I don't know why it seems to come 
up only when piping through head, and it doesn't really seem to affect 
anything - my scripts (which use tar tf | head and are the reason I 
noticed this in the first place) still seem to work fine. I just want to 
verify if anyone else gets the same result - basically take Tar 1.23, do 
"tar tf [filename] | head" and see what happens.



More information about the lfs-support mailing list