Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 341955 - dev-lang/ghc-{6.12.3,6.10.4-r1} broken distfiles during unpack
Summary: dev-lang/ghc-{6.12.3,6.10.4-r1} broken distfiles during unpack
Status: RESOLVED DUPLICATE of bug 320313
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Haskell Language team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-21 04:21 UTC by K. Posern
Modified: 2010-11-04 01:32 UTC (History)
3 users (show)

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


Attachments
emerge --info (emerge-info,8.26 KB, text/plain)
2010-10-21 04:23 UTC, K. Posern
Details
emerge log (dev-lang:ghc-6.12.3:20101021-041852.log,1.91 KB, text/plain)
2010-10-21 04:23 UTC, K. Posern
Details
new emerge --info (emerge-info,8.06 KB, text/plain)
2010-10-26 17:32 UTC, K. Posern
Details
the new emerge log for ghc (dev-lang:ghc-6.12.3:20101026-164407.log,2.37 KB, text/plain)
2010-10-26 17:33 UTC, K. Posern
Details
bzip2 -v -v -v -d ghc-bin-6.12.3-amd64.tbz2 &>/tmp/bzip2_-v_-v_-v_-d_ghc-bin-6.12.3-amd64.tbz2_.txt (bzip2_-v_-v_-v_-d_ghc-bin-6.12.3-amd64.tbz2_.txt,34.13 KB, text/plain)
2010-10-27 15:54 UTC, K. Posern
Details
tar xjvf ghc-bin-6.12.3-amd64.tbz2 &>/tmp/tar_xjvf_ghc-bin-6.12.3-amd64.tbz2_.txt (tar_xjvf_ghc-bin-6.12.3-amd64.tbz2_.txt,428.37 KB, text/plain)
2010-10-27 15:55 UTC, K. Posern
Details
output of: emerge --info app-arch/tar app-arch/bzip2 app-arch/pbzip2 sys-devel/gcc sys-libs/gcc (emerge_--info_FROM_tar_bzip2_pbzip2_gcc,9.02 KB, text/plain)
2010-10-28 12:39 UTC, K. Posern
Details
output of: emerge --info app-arch/tar app-arch/bzip2 app-arch/pbzip2 sys-devel/gcc sys-libs/gcc sys-libs/glibc (emerge_--info_FROM_tar_bzip2_pbzip2_gcc_glibc,9.23 KB, text/plain)
2010-10-28 12:43 UTC, K. Posern
Details

Note You need to log in before you can comment on or make changes to this bug.
Description K. Posern 2010-10-21 04:21:16 UTC
Hi.

I am sorry... because I guess I *must* miss something very obvious here ... but I waited now a couple of weeks and the issue just persists.
Also I found this:
http://forums.gentoo.org/viewtopic-t-835209-start-0.html
Which seemingly talks about the same problem already in July 2010 ;)

So here is the problem:


Reproducible: Always

Steps to Reproduce:
 root@seven ~ # emerge -auDNvtq ghc

Actual Results:  
[nomerge      ] dev-lang/ghc-6.12.3 [6.8.2-r1] USE="bash-completion -binary% -doc -ghcbootstrap" 
[ebuild  N    ]  app-admin/haskell-updater-1.1.0.0 
[ebuild     U ]   dev-lang/ghc-6.12.3 [6.8.2-r1] USE="bash-completion -binary% -doc -ghcbootstrap" 

Would you like to merge these packages? [Yes/No] 
>>> Verifying ebuild manifests
>>> Starting parallel fetch
>>> Emerging (1 of 2) dev-lang/ghc-6.12.3
>>> Failed to emerge dev-lang/ghc-6.12.3, Log file:
>>>  '/var/log/portage/dev-lang:ghc-6.12.3:20101021-041852.log'
>>> Jobs: 0 of 2 complete, 1 failed                 Load avg: 0.82, 0.38, 0.33
 * Package:    dev-lang/ghc-6.12.3
 * Repository: gentoo
 * Maintainer: haskell@gentoo.org
 * USE:  amd64 bash-completion elibc_glibc kernel_linux multilib userland_GNU

~~~~~~{ setup }~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Allow: '/vola/ccache:/vola/distcc::/mnt/vola/sd/src/'

>>> cfg-update-1.8.2-r1: Checksum index is up-to-date ...

~~~~~~{ unpack }~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Allow: '/vola/ccache:/vola/distcc::/mnt/vola/sd/src/'

pbzip2: *ERROR unconsumed in after BZ2_bzDecompress loop:ret=4; block=0; seq=790; avail_in=15050
Terminator thread: premature exit requested - quitting...
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
 * ERROR: dev-lang/ghc-6.12.3 failed:
 *   failure unpacking ghc-bin-6.12.3-amd64.tbz2
 * 
 * Call stack:
 *               ebuild.sh, line   56:  Called src_unpack
 *             environment, line 4082:  Called base_src_unpack
 *             environment, line  757:  Called unpack 'ghc-6.12.3-src.tar.bz2' 'ghc-bin-6.12.3-amd64.tbz2'
 *               ebuild.sh, line  388:  Called assert_sigpipe_ok 'failure unpacking ghc-bin-6.12.3-amd64.tbz2'
 *   isolated-functions.sh, line   37:  Called die
 * The specific snippet of code:
 *              [[ $x -ne 0 && $x -ne ${PORTAGE_SIGPIPE_STATUS:-141} ]] && die "$@"
 * 
 * If you need support, post the output of 'emerge --info =dev-lang/ghc-6.12.3',
 * the complete build log and the output of 'emerge -pqv =dev-lang/ghc-6.12.3'.
 * The complete build log is located at '/var/log/portage/dev-lang:ghc-6.12.3:20101021-041852.log'.
 * The ebuild environment file is located at '/mnt/ramdisk/portage/dev-lang/ghc-6.12.3/temp/environment'.
 * S: '/mnt/ramdisk/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3'

~~~~~~{  }~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Allow: '/vola/ccache:/vola/distcc::/mnt/vola/sd/src/'

 root@seven ~ # 




I tried both versions: dev-lang/ghc-6.12.3 and dev-lang/ghc-6.10.4-r1
I tried dev-lang/ghc-6.12.3 with or without the binary USEFLAG.
I tried manually downloading and unpacking the tbz2 file with tar xjf, with the same result.
... and of course I made sure that I have enough space ;)
Comment 1 K. Posern 2010-10-21 04:23:17 UTC
Created attachment 251403 [details]
emerge --info
Comment 2 K. Posern 2010-10-21 04:23:48 UTC
Created attachment 251405 [details]
emerge log
Comment 3 K. Posern 2010-10-21 04:25:00 UTC
Please let me know if you would need anything else.

Any hint would be really appreciated, because I tried to understand/resolve the problem, I tried to google... but all seems to point to a broken upstream binary package?!

Thanks!!
Comment 4 K. Posern 2010-10-21 23:56:57 UTC
I just did another MANUAL test:

 root@seven /vola/portage/dev-lang/ghc # wget http://ftp.halifax.rwth-aachen.de/gentoo/distfiles/ghc-bin-6.12.3-amd64.tbz2 
 root@seven /vola/portage/dev-lang/ghc # mkdir c
 root@seven /vola/portage/dev-lang/ghc # cd c
 root@seven /vola/portage/dev-lang/ghc/c # tar xvjf ../ghc-bin-6.12.3-amd64.tbz2
./
./usr/
./usr/bin/
./usr/bin/hp2ps
./usr/bin/hpc
./usr/bin/ghc
./usr/bin/ghc-6.12.3
./usr/bin/runhaskell
./usr/bin/runghc
./usr/bin/ghc-pkg
./usr/bin/ghc-pkg-6.12.3
./usr/bin/hsc2hs
./usr/bin/ghci
./usr/bin/ghci-6.12.3
./usr/lib64/
./usr/lib64/ghc-6.12.3/
./usr/lib64/ghc-6.12.3/libHSffi.a
./usr/lib64/ghc-6.12.3/libHSffi_p.a
./usr/lib64/ghc-6.12.3/libHSrtsmain.a
./usr/lib64/ghc-6.12.3/libHSrts.a
./usr/lib64/ghc-6.12.3/libHSrts_p.a
./usr/lib64/ghc-6.12.3/libHSrts_l.a

bzip2: Compressed file ends unexpectedly;
        perhaps it is corrupted?  *Possible* reason follows.
bzip2: Inappropriate ioctl for device
        Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
Comment 5 Christian Faulhammer (RETIRED) gentoo-dev 2010-10-26 09:07:12 UTC
Please delete the file from /usr/portage/distfiles, resync and refetch the file with GENTOO_MIRRORS="". 
Comment 6 K. Posern 2010-10-26 17:31:57 UTC
Done:

Used:
GENTOO_MIRRORS=""

Did remove all ghc files (case insensitive) from the distfiles dir.

Synced.

Updated portage :)

Then: emerge -auvt ghc

Which did:

Connecting to darcs.haskell.org (darcs.haskell.org)|69.30.63.204|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 26592939 (25M) [application/x-bzip2]
Saving to: `/mnt/vola/sd/distfiles/ghc-6.12.3-src.tar.bz2'

Connecting to gentoo.osuosl.org (gentoo.osuosl.org)|64.50.233.100|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 82390661 (79M) [text/plain]
Saving to: `/mnt/vola/sd/distfiles/ghc-bin-6.12.3-amd64.tbz2'

But it did not work again?!
Comment 7 K. Posern 2010-10-26 17:32:36 UTC
Created attachment 252065 [details]
new emerge --info
Comment 8 K. Posern 2010-10-26 17:33:21 UTC
Created attachment 252067 [details]
the new emerge log for ghc
Comment 9 Sergei Trofimovich (RETIRED) gentoo-dev 2010-10-27 06:43:56 UTC
> pbzip2: *ERROR unconsumed in after BZ2_bzDecompress loop:ret=4; block=0; seq=790; avail_in=15050
> Terminator thread: premature exit requested - quitting...

I don't like this pbzip error. Does stock bzip2 work for you?
Comment 10 K. Posern 2010-10-27 15:52:57 UTC
... well me neither ;)

md5sum ghc-bin-6.12.3-amd64.tbz2
91f216559890968c19b230676ea31aea  ../ghc-bin-6.12.3-amd64.tbz2

tar and bzip2 fail see their (verbose) output in the following 2 attachments.
Comment 11 K. Posern 2010-10-27 15:54:46 UTC
Created attachment 252231 [details]
bzip2 -v -v -v -d ghc-bin-6.12.3-amd64.tbz2 &>/tmp/bzip2_-v_-v_-v_-d_ghc-bin-6.12.3-amd64.tbz2_.txt
Comment 12 K. Posern 2010-10-27 15:55:34 UTC
Created attachment 252233 [details]
tar xjvf ghc-bin-6.12.3-amd64.tbz2 &>/tmp/tar_xjvf_ghc-bin-6.12.3-amd64.tbz2_.txt
Comment 13 Sergei Trofimovich (RETIRED) gentoo-dev 2010-10-27 19:45:00 UTC
(In reply to comment #10)
> ... well me neither ;)
> 
> md5sum ghc-bin-6.12.3-amd64.tbz2
> 91f216559890968c19b230676ea31aea  ../ghc-bin-6.12.3-amd64.tbz2
> 
> tar and bzip2 fail see their (verbose) output in the following 2 attachments.
> 

From what I see stock bzip unpacks files correctly.
You can make sure to output actual status for bzip command:

    # app-arch/bzip2
    $ /bin/bzip2 -t ghc-bin-6.12.3-amd64.tbz2; echo $?

    # app-arch/pbzip2
    $ /usr/bin/bzip2 -t ghc-bin-6.12.3-amd64.tbz2; echo $?

Please, paste your results for commands above.

Trailing garbage athe the EOF always was in our ghc tarballse.
Moreover, we create .tbz2 files with help of portage:

    $ ebuild ghc.... package.

So, the problem you see either in:
* portage and was there for ages
* pbzip2, which fails to handle trailing stuff in .bz2 stream

And I'm afraid none of them is specific to ghc.
Comment 14 K. Posern 2010-10-27 21:43:03 UTC
(In reply to comment #13)
> (In reply to comment #10)
> > ... well me neither ;)
> > 
> > md5sum ghc-bin-6.12.3-amd64.tbz2
> > 91f216559890968c19b230676ea31aea  ../ghc-bin-6.12.3-amd64.tbz2
> > 
> > tar and bzip2 fail see their (verbose) output in the following 2 attachments.
> > 
> 
> From what I see stock bzip unpacks files correctly.
> You can make sure to output actual status for bzip command:
> 
>     # app-arch/bzip2
>     $ /bin/bzip2 -t ghc-bin-6.12.3-amd64.tbz2; echo $?
> 
>     # app-arch/pbzip2
>     $ /usr/bin/bzip2 -t ghc-bin-6.12.3-amd64.tbz2; echo $?
> 
> Please, paste your results for commands above.
> 
> Trailing garbage athe the EOF always was in our ghc tarballse.
> Moreover, we create .tbz2 files with help of portage:
> 
>     $ ebuild ghc.... package.
> 
> So, the problem you see either in:
> * portage and was there for ages
> * pbzip2, which fails to handle trailing stuff in .bz2 stream
> 
> And I'm afraid none of them is specific to ghc.
> 
Hi.

Thanks a lot for your (fast) answer!

/1st/
In Comment #4 I got: 
tar: Error is not recoverable: exiting now
Today I got:
bzip2: (stdin): trailing garbage after EOF ignored
So TAR did not crash anymore :)
Which is in line with the file list being very SHORT for Comment #4 and LONG today.
So either tar used once pbzip2 and once bzip2 or the packet changed ;)
Because I tried 2 - 3 manual downloads from different mirrors on different continents at different times.

/2nd/ So from what I can tell app-arch/bzip2 seems to be the problem (see below)... but you said that app-arch/pbzip2 would be the problem, right?

2 more things about bzip2 vs. pbzip2:

"which bzip2" points to /bin/bzip2 in my root console which I used for my earlier comments today as well.

I looked what portage does:
"bzip2 -d -c -- /mnt/ramdisk/portage/dev-lang/ghc-6.12.3/distdir/ghc-bin-6.12.3-amd64.tbz2"

/3rd/ Why does it seem to work for the majority and only very few people seemed to have this problem (see my forum link in the "Description"?
Is it just because not everyone has pbzip2 AND bzip2 installed?
.... I will try removing one and the other and see if this helps later!

----

So here is what I did:

 root@seven /vola/distfiles/c # (/usr/bin/bzip2 -t ghc-bin-6.12.3-amd64.tbz2; echo $? ) &>/tmp/usr_bin_bzip2_-t_ghc-bin-6.12.3-amd64.tbz2

 root@seven /vola/distfiles/c # (/bin/bzip2 -t ghc-bin-6.12.3-amd64.tbz2; echo $? ) &>/tmp/bin_bzip2_-t_ghc-bin-6.12.3-amd64.tbz2

 root@seven /vola/distfiles/c # cat /tmp/bin_bzip2_-t_ghc-bin-6.12.3-amd64.tbz2 
bzip2: ghc-bin-6.12.3-amd64.tbz2: trailing garbage after EOF ignored
0

 root@seven /vola/distfiles/c # cat /tmp/usr_bin_bzip2_-t_ghc-bin-6.12.3-amd64.tbz2 
0

 root@seven /vola/distfiles/c # qfile /bin/bzip2
app-arch/bzip2 (/bin/bzip2)
 root@seven /vola/distfiles/c # qfile /usr/bin/bzip2 
app-arch/pbzip2 (/usr/bin/bzip2)

---

Comment 15 Sergei Trofimovich (RETIRED) gentoo-dev 2010-10-28 07:37:23 UTC
> /1st/
> In Comment #4 I got: 
> tar: Error is not recoverable: exiting now
> Today I got:
> bzip2: (stdin): trailing garbage after EOF ignored
> So TAR did not crash anymore :)
> Which is in line with the file list being very SHORT for Comment #4 and LONG
> today.
> So either tar used once pbzip2 and once bzip2 or the packet changed ;)

We certainly didn't change binary tarballs. We would have to do it for all arches and all ghcs.

> /2nd/ So from what I can tell app-arch/bzip2 seems to be the problem (see
> below)... but you said that app-arch/pbzip2 would be the problem, right?

Yes. I think pbzip2 is the real offender. Your build failures say so:
> pbzip2: *ERROR unconsumed in after BZ2_bzDecompress loop:ret=4; block=0; seq=790; avail_in=15050
> Terminator thread: premature exit requested - quitting...
> tar: Unexpected EOF in archive

> I looked what portage does:
> "bzip2 -d -c --
> /mnt/ramdisk/portage/dev-lang/ghc-6.12.3/distdir/ghc-bin-6.12.3-amd64.tbz2"
> 
> /3rd/ Why does it seem to work for the majority and only very few people seemed
> to have this problem (see my forum link in the "Description"?
> Is it just because not everyone has pbzip2 AND bzip2 installed?
> .... I will try removing one and the other and see if this helps later!

My $PATH contains '/usr/bin' before '/bin', so it's rather odd you see '/bin/bzip2' in 'which' output.

I think you are one of the few who use 'USE=symlink app-arch/pbzip2'

>  root@seven /vola/distfiles/c # cat /tmp/bin_bzip2_-t_ghc-bin-6.12.3-amd64.tbz2 
> bzip2: ghc-bin-6.12.3-amd64.tbz2: trailing garbage after EOF ignored
> 0
> 
>  root@seven /vola/distfiles/c # cat
> /tmp/usr_bin_bzip2_-t_ghc-bin-6.12.3-amd64.tbz2 
> 0

Seems -t file does not reveal actual unpacking problem or the real problem is in pipe interaction with tar.

Please, attach the output of

    emerge --info app-arch/tar app-arch/bzip2 app-arch/pbzip2 sys-devel/gcc sys-libs/gcc

I'll try to reproduce the failure myself with your versions.

Daniel (added to CC),

may I ask you to add USE=symlink description for app-arch/pbzip2
(or give me perms to do so)? Global one is misleading:

    $ equery u app-arch/pbzip2
     U I
     - - symlink : Force kernel ebuilds to automatically update the /usr/src/linux symlink

Should be something: "Install symlinks which override default bzip2 implementation (app-arch/bzip2)".
Comment 16 Sergei Trofimovich (RETIRED) gentoo-dev 2010-10-28 07:38:55 UTC
>     emerge --info app-arch/tar app-arch/bzip2 app-arch/pbzip2 sys-devel/gcc
> sys-libs/gcc

Sorry, I meant:

    emerge --info app-arch/tar app-arch/bzip2 app-arch/pbzip2 sys-devel/gcc sys-libs/glibc
Comment 17 Sergei Trofimovich (RETIRED) gentoo-dev 2010-10-28 07:41:37 UTC
> Daniel (added to CC),

Don't know why I typed this name.

Sorry, Dror!
Comment 18 K. Posern 2010-10-28 12:39:35 UTC
Created attachment 252355 [details]
output of: emerge --info app-arch/tar app-arch/bzip2 app-arch/pbzip2 sys-devel/gcc sys-libs/gcc
Comment 19 K. Posern 2010-10-28 12:43:37 UTC
Created attachment 252357 [details]
output of: emerge --info app-arch/tar app-arch/bzip2 app-arch/pbzip2 sys-devel/gcc sys-libs/gcc sys-libs/glibc

And sorry, I did not read all the messages before doing what you asked for ;)
Comment 20 K. Posern 2010-10-28 12:53:53 UTC
I agree that the symlink description is misleading. That's why I was not aware that pbzip2 uses this.

I recompiled pbzip2 without symlink and now the unpack PASSES, just spits out the error message:

bzip2: /mnt/ramdisk/portage/dev-lang/ghc-6.12.3/distdir/ghc-bin-6.12.3-amd64.tbz2: trailing garbage after EOF ignored

I think I will pass this on to the pbzip2 guys/girls. Because otherwise so fare pbzip2 as drop-in replacement for bzip2 (with the symlink) did a good job for me and on my 4 core machine I prefer the parallel version :)

If I should try anything else, please let me know!
And thanks for the tip with the symlink!
Comment 21 K. Posern 2010-10-28 13:09:07 UTC
Ok I also confirmed now (without the symlink ;) that pbzip2 is not drop-in compatible with bzip2 in this case:

 root@seven /mnt/ramdisk # /usr/bin/pbzip2 -d -c -- /mnt/ramdisk/ghc-bin-6.12.3-amd64.tbz2 >/dev/null; echo $?
pbzip2: *ERROR unconsumed in after BZ2_bzDecompress loop:ret=4; block=0; seq=790; avail_in=15050
Terminator thread: premature exit requested - quitting...
1
 root@seven /mnt/ramdisk # /bin/bzip2 -d -c -- /mnt/ramdisk/ghc-bin-6.12.3-amd64.tbz2 >/dev/null; echo $? 

bzip2: /mnt/ramdisk/ghc-bin-6.12.3-amd64.tbz2: trailing garbage after EOF ignored
0

I am reporting this to the author of pbzip2.

P.S.: That was a neat "bug". Sorry about the confusion and thanks a lot for your help!!! 
Comment 22 K. Posern 2010-11-04 01:31:59 UTC
I want to mark this bug as a duplicate of this earlier reported bug 320313
Comment 23 K. Posern 2010-11-04 01:32:18 UTC

*** This bug has been marked as a duplicate of bug 320313 ***