Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 359193 - >=sys-apps/portage-2.1.9.26: quickpkg with python-2.6.4-r1 produces broken tbz2 file with tar: Skipping to next header. Hard link
Summary: >=sys-apps/portage-2.1.9.26: quickpkg with python-2.6.4-r1 produces broken tb...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Binary packages support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 338509
  Show dependency tree
 
Reported: 2011-03-16 17:47 UTC by Vladimir Varlamov
Modified: 2011-03-16 21:20 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 Vladimir Varlamov 2011-03-16 17:47:05 UTC
quickpkg gives broken bz2 tarball. Crash happened when unpacked tar.bz2 file with hard links files. 

Reproducible: Always

Steps to Reproduce:
1. first box # quickpkg --include-config=y media-gfx/imagemagick
 * Building package for media-gfx/imagemagick-6.6.1.7 ...                    
                                                               [ ok ]

 * Packages now in '/usr/portage/packages':
 * media-gfx/imagemagick-6.6.1.7: 5.1M
2. second box # emerge -K media-gfx/imagemagick                                   
                                           ..
. done!

>>> Emerging binary (1 of 1) media-gfx/imagemagick-6.6.1.7
 * imagemagick-6.6.1.7.tbz2 MD5 SHA1 size ;-) ...                        [ ok ]
>>> Extracting info
 * Package:    media-gfx/imagemagick-6.6.1.7
 * Repository: gentoo
 * USE:        bzip2 cxx jpeg2k zlib jpeg fontconfig truetype tiff openmp perl
png
 * FEATURES:   preserve-libs sandbox
>>> Extracting media-gfx/imagemagick-6.6.1.7
tar: Skipping to next header
tar: Exiting with failure status due to previous errors
tar failed with status 2
!!! Error Extracting '/usr/portage/packages/All/imagemagick-6.6.1.7.tbz2'

>>> Failed to emerge media-gfx/imagemagick-6.6.1.7, Log file:
>>>  '/var/tmp/portage/media-gfx/imagemagick-6.6.1.7/temp/build.log'

Actual Results:  
emerge crash

Expected Results:  
successfuly emerge

My next steps to debug:

# cd /tmp && cp /usr/portage/packages/All/imagemagick-6.6.1.7.tbz2 .
# qtbz2 -s imagemagick-6.6.1.7.tbz2
# tar -tvf imagemagick-6.6.1.7.tbz2 > log 2&>1
# grep tar -C2 log

-rw-r--r-- root/root       809 2010-05-11 18:40
usr/include/ImageMagick/wand/magick-wand.h
hrw-r--r-- root/root         0 2010-05-11 18:40
usr/include/ImageMagick/wand/magick_wand.h link to
usr/include/ImageMagick/wand/magick-wand.h
tar: Skipping to next header
-rw-r--r-- root/root      1502 2010-05-11 18:40
usr/include/ImageMagick/wand/mogrify.h
-rw-r--r-- root/root       968 2010-05-11 18:40
usr/include/ImageMagick/wand/montage.h
--
drwxr-xr-x root/root         0 2011-02-23 12:59 usr/share/man/man3/
-r--r--r-- root/root      2387 2010-05-11 18:41
usr/share/man/man3/Image::Magick.3pm.bz2
tar: Exiting with failure status due to previous errors

Then I delete /usr/include/ImageMagick/wand/magick-wand.h, then quickpkg and
test tar.bz2 - everything is working correctly. 


Next i am try:

#tar -vcf test.tar.bz2 /usr/include/ImageMagick/wand/m*
tar: Removing leading `/' from member names
/usr/include/ImageMagick/wand/magick-image.h
/usr/include/ImageMagick/wand/magick-property.h
/usr/include/ImageMagick/wand/magick_wand.h
tar: Removing leading `/' from hard link targets
/usr/include/ImageMagick/wand/magick-wand.h
/usr/include/ImageMagick/wand/mogrify.h
/usr/include/ImageMagick/wand/montage.h

And then tested this archive:

tar -vtf t.tar.bz2
-rw-r--r-- root/root     21483 2010-05-11 18:40 usr/include/ImageMagick/wand/magick-image.h
-rw-r--r-- root/root      5558 2010-05-11 18:40 usr/include/ImageMagick/wand/magick-property.h
-rw-r--r-- root/root       809 2010-05-11 18:40 usr/include/ImageMagick/wand/magick_wand.h
hrw-r--r-- root/root         0 2010-05-11 18:40 usr/include/ImageMagick/wand/magick-wand.h link to usr/include/ImageMagick/wand/magick_wand.h
-rw-r--r-- root/root      1502 2010-05-11 18:40 usr/include/ImageMagick/wand/mogrify.h
-rw-r--r-- root/root       968 2010-05-11 18:40 usr/include/ImageMagick/wand/montage.h

No error. 

Why hard link in this archive get "tar: Skipping to next header". Archive gets
broken? Other package are work properly, may simply not contain hard links?
What should I do next to debug?
Comment 1 Zac Medico gentoo-dev 2011-03-16 18:27:59 UTC
Maybe it's related to bug 338509. Please post emerge --info output, since we need at least the portage and python versions.

Also, since python is slotted, it would be nice to know exactly which python version it's using. This can be somewhat tricky to confirm due to interaction with python3 and python2 flags, but the output of the following two commands should suffice:

   eselect python list
   head /usr/bin/emerge
Comment 2 Vladimir Varlamov 2011-03-16 21:09:01 UTC
This bug is related only to for python-2.6.4-r1 on some of my box. Upgrade python to last version on slot 2.6 solved this problem
Comment 3 Zac Medico gentoo-dev 2011-03-16 21:20:23 UTC
I guess we could increase the python dependency for portage, but it seems that this bug it pretty difficult to trigger anyway, given that python-2.6.4 ebuilds are no longer in the tree.