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

archive/tar: cannot read GNU sparse files #3864

Closed
tebeka opened this issue Jul 25, 2012 · 15 comments
Closed

archive/tar: cannot read GNU sparse files #3864

tebeka opened this issue Jul 25, 2012 · 15 comments

Comments

@tebeka
Copy link
Contributor

tebeka commented Jul 25, 2012

This might be related to https://golang.org/issue/3300, but I'm no
tar expert :)

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. Run http://play.golang.org/p/8qQdqWCvPE (not from the web interface)

What is the expected output?
List all entries in archive without an error (tar tf testtar.tar works).

What do you see instead?
error reading - archive/tar: invalid tar heade

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

Which operating system are you using?
Ubuntu 12.04 (64bit)

Which version are you using?  (run 'go version')
go version go1.0.2
@davecheney
Copy link
Contributor

Comment 1:

After a bit of playing around with this, it looks like the checksum inside that tar file
may be incorrect (possibly deliberately, possibly not).
lucky(~/src) % go run 3864.go
ustar/regtype [6KB]
ustar/dirtype// [0KB]
ustar/dirtype-with-size// [0KB]
regtype [0KB]
ustar/sparse [84KB]
ustar/umlauts-������� [6KB]
ustar/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/1234567/longname
[6KB]
../linktest1/regtype [0KB]
ustar/linktest1/regtype [6KB]
./ustar/linktest1/regtype [0KB]
gnu/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/
[6KB]
gnu/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/
[0KB]
checksum:  UVWXYZab
error reading - archive/tar: checksum mismatch: expected 0, got 43352

@davecheney
Copy link
Contributor

Comment 2:

So, it turns out the header was incorrect because archive/tar doesn't correctly handle
GNU sparse files. ustar sparse files are handled properly, but the GNU version 'S' is
not.

Status changed to Accepted.

@davecheney
Copy link
Contributor

Comment 3:

Labels changed: added priority-later, removed priority-triage.

Status changed to HelpWanted.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 5:

Labels changed: added go1.2maybe.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 6:

Labels changed: added feature.

@robpike
Copy link
Contributor

robpike commented Aug 30, 2013

Comment 7:

Not for 1.2.

Labels changed: removed go1.2maybe.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 8:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 9:

Labels changed: removed feature.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 10:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 11:

Labels changed: added repo-main.

@davidthomas426
Copy link
Contributor

Comment 12:

I just submitted a CL to fix this: https://golang.org/cl/64740043/

@ianlancetaylor
Copy link
Contributor

Comment 13:

Marking as 1.3Maybe since it would be nice to get that CL reviewed.

Labels changed: added release-go1.3maybe, removed priority-later, release-none.

@dsymonds
Copy link
Contributor

dsymonds commented Apr 2, 2014

Comment 14:

I'm able to provide oversight for archive/tar, but I'm not familiar enough with sparse
files to review that CL for correctness.

Labels changed: added expertneeded.

@rsc
Copy link
Contributor

rsc commented Apr 3, 2014

Comment 15:

This issue was closed by revision 730db0a.

Status changed to Fixed.

@ianlancetaylor
Copy link
Contributor

Comment 16:

Issue #8014 has been merged into this issue.

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

8 participants