pbzip2 -cd sometimes (rarely) truncates data

Bug #1524909 reported by Kevin
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Yavor Nikolov

Bug Description

I occasionally get Gentoo binary packages that will not unpack. I am aware of the previous issues with trailing garbage but this appears to be different and--ignore-trailing-garbage does not affect this problem...

If I do 'tar -tvf broken.tar.bz2' it works fine.
If I do 'pbzip2 -d broken.tar.bz2' I get a correct tar file.
However, if I do 'pbzip2 -cd broken.tar.bz2 > broken.tar' I get a tar file that is truncated at 16384 bytes.

I have placed a small (40KB) example file here for testing: https://sanitarium.net/broken.tar.bz2

This was tested on version 1.1.12 on a Gentoo Linux system.

When I hit a package file that has this problem it is repeatable with that file. My only solutions when I hit this problem are to either delete and rebuilt the package or to temporarily remove the bzip2>pbzip2 symlink so that portage will use regular bzip2 which is fine with these files.

Revision history for this message
Yavor Nikolov (yavor-nikolov) wrote :

Thanks for reporting that issue. I managed to reproduce it on Ubuntu.

Another way I managed to get a non-truncated tar: pbzip2 -cd < broken.tar.bz2 > broken.tar

Revision history for this message
Kevin (m-launch3ad-m) wrote :

Thanks for testing and confirming.

I wasn't really looking for alternative command lines as I would normally just do a tar -xvf but my problem is that portage is doing something like:
pbzip2 -d -cq broken.tar.bz2 | tar -xp -C /tmp/.... -f -
Which also fails. The >broken.tar syntax was the obvious most simple case that both demonstrated the problem and showed that the data was being truncated at an interesting number of bytes.

Revision history for this message
Yavor Nikolov (yavor-nikolov) wrote :

Hi Kevin,
I just pushed a fix to lp:~pbzip2/pbzip2/bug-1524909-cd-truncates-output-sometimes. Would be great if you can test it. (If it's OK we can proceed with merging and releasing the fix).

Revision history for this message
Kevin (m-launch3ad-m) wrote :

Hello Yavor,

This did fix the problem with the file and more importantly it allowed Gentoo's portage system to merge the binary package correctly.

Thanks for the help.

Changed in pbzip2:
status: New → Fix Committed
assignee: nobody → Yavor Nikolov (yavor-nikolov)
importance: Undecided → Medium
milestone: none → 1.1.13
Changed in pbzip2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers