Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compress/bzip2: "superfluous level in Huffman tree" should not be critical? #7279

Closed
gopherbot opened this issue Feb 7, 2014 · 4 comments
Closed
Milestone

Comments

@gopherbot
Copy link

by tvrkng:

What steps will reproduce the problem?

1. Download http://play.golang.org/p/CnggE5bY6l as "test.go"
2. Download
http://distfiles.gentoo.org/releases/amd64/autobuilds/20131226/stage3-amd64-20131226.tar.bz2
(170 MB).  Digests are in
http://distfiles.gentoo.org/releases/amd64/autobuilds/20131226/stage3-amd64-20131226.tar.bz2.DIGESTS.asc
(e.g., the SHA512 is
8b32da32800d710cef952beadbdaea2517cc4dabddd0ad774335a903370b83246034dc0d17949a31e69bddd0a851807bcfde0a5facd704ed0791bece0b4b12d8).
3. Run:

     $ go run test.go < stage3-amd64-20131226.tar.bz2

What is the expected output?

  Nothing.

What do you see instead?

  bzip2 data invalid: superfluous level in Huffman tree
  exit status 1

Which compiler are you using (5g, 6g, 8g, gccgo)?

  Whatever 'go run' uses internally.  I haven't installed any additional Go compilers (e.g. I haven't enabled GCC's Go compiler).

Which operating system are you using?

  Gentoo, via dev-lang/go-1.2::gentoo

Which version are you using?  (run 'go version')

  go version go1.2 linux/amd64

Please provide any additional information below.

  This spun off from moby/moby#3816, but the test above produces the error without involving any Docker code.  I'm not sure which bzip implementation was used to generate the tarball, but if I recompress it with bzip2 v1.0.6, I don't see an error:

    $ bzcat stage3-amd64-20131226.tar.bz2 | bzip2 | go run test.go
    $ echo $?
    0
@ianlancetaylor
Copy link
Contributor

Comment 1:

Labels changed: added repo-main, release-go1.3.

@bradfitz
Copy link
Contributor

Comment 2:

Adam, the Docker folks are being affected by this. Could you take a look and decide
whether it's something we should fix?
I imagine if the regular bzip tool handles it and we don't, we should match.

Owner changed to @agl.

Status changed to Accepted.

@agl
Copy link
Contributor

agl commented Feb 14, 2014

Comment 3:

I'm pretty sure that this is an encoder bug however if it exists in the wild then it
would be nice to handle it. I've mailed https://golang.org/cl/64010043 for
review. Sadly handling this is subtle but it doesn't mess up the code too much.
I've confirmed that it can now process the buggy input referenced in #1 and produces the
same output as bzip2 from the command line.

@agl
Copy link
Contributor

agl commented Feb 14, 2014

Comment 4:

This issue was closed by revision 9f0008b.

Status changed to Fixed.

@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@rsc rsc removed the release-go1.3 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants