-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: Go 1.9beta1 source archive is packed in some strange way #20707
Comments
@dsnet, could you take a look? OpenBSD 6.1's tar apparently doesn't like our tar. |
If I may ask, what is the exact version of the tar utility being used? This works on both BSD and GNU tar:
|
I'm going to guess this is the implementation of the tar utility that you are using? I don't have an OpenBSD setup, so this may take me some time to repro. |
Yes, you are right, it is a standard Steps to reproduce:
Note: this is a first time it occurs. Never had any troubles with any previous archives. |
Previous release to compare (on same system):
|
@dsnet, any ideas? |
After some tweaking I found at least a block in archive which after the things start to break apart: offset into ungzipped tar: 0x01B69600 The block contains a long file name ("go/src/cmd/vendor/github.com/google/pprof/internal/driver/testdata/PaxHeaders.0/pprof.contention.fla") truncated to 100 chars. Probably reference issue #17630 |
When Go1.8 was released, we ran into a similar breakage internally when dpkg failed to work on .deb packages since the Debian package manager only accepted the GNU format and not PAX. For that issue, I filed #18710. It's possible that the BSD version of tar doesn't support PAX, but my brief glance through their source code seemed to indicate that it does. The other thing I can think of is that the BSD tar tool doesn't like a non-NULL terminated name. I'll finally get around to setting up OpenBSD tomorrow and test that theory out. |
The null-termination of name doesn't matter. (See 2 attached files.) The main difference is, how filename is encoded. BSD tar (pax) splits path in prefix and remainder such that length of remainder is less then 100 bytes. (Data Interchange Format - Extended tar header format - POSIX 1003.1-1990) Go tar-ball is encoded differently. The full name is truncated on mark of 100 bytes. The actual name is stored in PAXRecord format ("%d %s=%s\n" % (size, key, value)). |
@dsnet, you can get access to our OpenBSD builders. No need to set up your own. |
CL https://golang.org/cl/46914 mentions this issue. |
Sent out a fix... I wish the OpenBSD implementation would output more debug information than just "invalid header"; it's really unhelpful. Honestly, I think this is an issue with OpenBSD's tar utility, but I'll make a change to Go's writer to play a little nicer. |
What version of Go are you using (
go version
)?1.9beta1
What operating system and processor architecture are you using (
go env
)?OpenBSD 6.1/amd64
What did you do?
What did you expect to see?
extracted tar
What did you see instead?
exit code: 1
The text was updated successfully, but these errors were encountered: