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/gzip: crash in gunzip #6549

Closed
krasin opened this issue Oct 8, 2013 · 2 comments
Closed

compress/gzip: crash in gunzip #6549

krasin opened this issue Oct 8, 2013 · 2 comments

Comments

@krasin
Copy link

krasin commented Oct 8, 2013

$ go version
go version devel +add507d4646f Tue Oct 08 13:13:40 2013 -0700 linux/amd64

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. Download will_crash.gz data file
2. Either download go_gunzip.go or take the program from
http://play.golang.org/p/lLS8o9c-RO
3. Run it
go go_gunzip.go < will_crash.gz

What is the expected output?
Before io.Copy
After io.Copy
<exit status 0>

What do you see instead?

$ go run go_gunzip.go < will_crash.gz 
2013/10/08 21:34:26 Before io.Copy
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x290 pc=0x424a53]

goroutine 1 [running]:
runtime.panic(0x4b3c60, 0x5b3328)
        /home/krasin/go/src/pkg/runtime/panic.c:266 +0xb6
compress/gzip.(*Reader).Read(0x0, 0xc210050000, 0x2000, 0x2000, 0x2005b6e58, ...)
        /home/krasin/go/src/pkg/compress/gzip/gunzip.go:200 +0x43
io/ioutil.devNull.ReadFrom(0x0, 0x7fd38de52180, 0x0, 0x0, 0x0, ...)
        /home/krasin/go/src/pkg/io/ioutil/ioutil.go:144 +0xb0
io.Copy(0x7fd38de51190, 0x0, 0x7fd38de52180, 0x0, 0x0, ...)
        /home/krasin/go/src/pkg/io/io.go:348 +0x124
main.main()
        /home/krasin/testdata/go_gunzip.go:20 +0x243
exit status 2

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

Which operating system are you using?
Ubuntu Linux 12.04 x86-64 (also tested on 13.04).

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

$ go version
go version devel +add507d4646f Tue Oct 08 13:13:40 2013 -0700 linux/amd64

Please provide any additional information below.

Attachments:

  1. will_crash.gz (32768 bytes)
  2. go_gunzip.go (359 bytes)
@krasin
Copy link
Author

krasin commented Oct 8, 2013

Comment 1:

I am stupid. I forgot to check the error from gzip.NewReader, r is nil and it
predictably fails after that.
Please, ignore this bug.

@ianlancetaylor
Copy link
Contributor

Comment 2:

Status changed to Retracted.

@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

3 participants