You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seemingly randomly, I get a crash with this call stack:
panic: runtime error: index out of range [256] with length 256
goroutine 40 [running]:
bufio.(*Reader).ReadByte(0xc000580360)
C:/Program Files/Go/src/bufio/bufio.go:271 +0xa5
github.com/ziutek/telnet.(*Conn).tryReadByte(0xc0016d2000)
C:/Users/kinlougn/go/pkg/mod/github.com/ziutek/[email protected]/conn.go:230 +0x25
github.com/ziutek/telnet.(*Conn).Read(0xc0016d2000, {0xc000ce7e28, 0x100, 0xc000ce7e60?})
C:/Users/kinlougn/go/pkg/mod/github.com/ziutek/[email protected]/conn.go:299 +0x45
breeze/avocent.continuouslyReadOutput()
C:/Users/kinlougn/Github Repos/Breeze/avocent/avocent.go:60 +0x66
created by breeze/avocent.Connect in goroutine 10
C:/Users/kinlougn/Github Repos/Breeze/avocent/avocent.go:42 +0x105
exit status 2
This is the code that I'm using to call it. Am I doing something wrong, or is this a bug?
func continuouslyReadOutput() {
buf := make([]byte, 256)
for {
select {
case <-done:
return // Stop the goroutine when the connection is closed
default:
n, err := conn.Read(buf)
if err != nil {
if err == io.EOF {
log.Println("Connection closed by the server.")
return
}
log.Printf("Error reading from connection: %v", err)
continue
}
if n > 0 {
output := string(buf[:n])
accumulatedOutput.WriteString(output)
}
}
}
}
The text was updated successfully, but these errors were encountered:
As the panic is inside bufio.(*Reader).ReadByte and the ReadByte function tries to read a byte from buf[len(buf)] it seems to me that the same bufio buffer was used concurrently. telnet.Conn cannot be used concurrently by multiple goroutines. Maybe this is your problem.
Seemingly randomly, I get a crash with this call stack:
panic: runtime error: index out of range [256] with length 256
goroutine 40 [running]:
bufio.(*Reader).ReadByte(0xc000580360)
C:/Program Files/Go/src/bufio/bufio.go:271 +0xa5
github.com/ziutek/telnet.(*Conn).tryReadByte(0xc0016d2000)
C:/Users/kinlougn/go/pkg/mod/github.com/ziutek/[email protected]/conn.go:230 +0x25
github.com/ziutek/telnet.(*Conn).Read(0xc0016d2000, {0xc000ce7e28, 0x100, 0xc000ce7e60?})
C:/Users/kinlougn/go/pkg/mod/github.com/ziutek/[email protected]/conn.go:299 +0x45
breeze/avocent.continuouslyReadOutput()
C:/Users/kinlougn/Github Repos/Breeze/avocent/avocent.go:60 +0x66
created by breeze/avocent.Connect in goroutine 10
C:/Users/kinlougn/Github Repos/Breeze/avocent/avocent.go:42 +0x105
exit status 2
This is the code that I'm using to call it. Am I doing something wrong, or is this a bug?
The text was updated successfully, but these errors were encountered: