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

bufio: 1.5.1 panic slice bounds out of range #12925

Closed
semihalev opened this issue Oct 14, 2015 · 6 comments
Closed

bufio: 1.5.1 panic slice bounds out of range #12925

semihalev opened this issue Oct 14, 2015 · 6 comments
Milestone

Comments

@semihalev
Copy link

Hi,

Today, i received panic from bufio reader. I used bufio for tcp connections. The function running for 30 days without problem.

Here is the sample code:

func TCPReader(connection *net.TCPConn) {
    reader := bufio.NewReaderSize(connection, 8192)

    header := make([]byte, 9)
    for {
        len, err := reader.Read(header[:])
    }
}

Panic Log:
panic: runtime error: slice bounds out of range

goroutine 490939 [running]:
bufio.(*Reader).Read(0xc828791f80, 0xc82858b670, 0x9, 0x9, 0x0, 0x0, 0x0)
/usr/local/go/src/bufio/bufio.go:214 +0x3c8

@ianlancetaylor ianlancetaylor changed the title 1.5.1 panic slice bounds out of range for bufio package bufio: 1.5.1 panic slice bounds out of range Oct 14, 2015
@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Oct 14, 2015
@ianlancetaylor
Copy link
Contributor

Have you run your program under the race detector?

@semihalev
Copy link
Author

Yes, I did'nt see any problem for read.

@adg
Copy link
Contributor

adg commented Oct 14, 2015

We're going to need a short program that reproduces this. Can you isolate the issue?

@semihalev
Copy link
Author

Ok, i will create a small project, and inform you again.

@semihalev
Copy link
Author

I found data race in tcp reconnect function. I try to change first this. I will inform you.

@adg
Copy link
Contributor

adg commented Oct 14, 2015

In that case, I'm going to close this issue until you report back.

@adg adg closed this as completed Oct 14, 2015
@golang golang locked and limited conversation to collaborators Oct 17, 2016
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