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

ioutil.ReadAll won't finish on tar reader using bytes.Buffer #419

Closed
rsaarelm opened this issue Dec 13, 2009 · 4 comments
Closed

ioutil.ReadAll won't finish on tar reader using bytes.Buffer #419

rsaarelm opened this issue Dec 13, 2009 · 4 comments

Comments

@rsaarelm
Copy link
Contributor

Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull -u" and retry what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
Compile and run the attached program (it will create files "/tmp/foo.txt"
and "/tmp/foo.tar").

What is the expected output? What do you see instead?
It should print "Read 0 bytes" and exit. Instead it hangs forever on the
line "data, _ := ioutil.ReadAll(tr)"

What is your $GOOS?  $GOARCH?

linux 386

Which revision are you using?  (hg identify)

683ed10f7832 tip

Please provide any additional information below.

This does work in place of ioutil.ReadAll(tr):

header, err := tr.Next()
data = make([]byte, header.Size)
n, err2 := io.ReadFull(tr, data)

Attachments:

  1. tarread.go (741 bytes)
@gopherbot
Copy link
Contributor

Comment 1 by cw@f00f.org:

Please try the patch at:
    http://golang.org/cl/162062/show
and let me know if this doesn't work.

@rsaarelm
Copy link
Contributor Author

Comment 2:

The patch seems to fix it.

@robpike
Copy link
Contributor

robpike commented Dec 13, 2009

Comment 3:

Owner changed to r...@golang.org.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Dec 14, 2009

Comment 4:

This issue was closed by revision fe0eb17.

Status changed to Fixed.

Merged into issue #-.

@rsaarelm rsaarelm added the fixed label Dec 14, 2009
@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc unassigned robpike Jun 22, 2022
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

4 participants