如何跟踪恐慌错误:切片范围超出范围

时间:2017-09-28 20:19:25

标签: go

我的程序因以下错误而崩溃。通常我可以找到导致恐慌的代码行,但现在只有Go特定代码。是否有任何选项可以增加跟踪的行/堆栈的大小(即引起恐慌的代码)?

panic: runtime error: slice bounds out of range

goroutine 1354 [running]:
io.copyBuffer(0x4c9da60, 0xc420142c88, 0x4c9b5a0, 0xc4206e1c80, 0xc42068a000, 0x8000, 0x8000, 0xc42001b370, 0xc42001b300, 0x47846a0)
    /usr/local/Cellar/go/1.9/libexec/src/io/io.go:394 +0x340
io.Copy(0x4c9da60, 0xc420142c88, 0x4c9b5a0, 0xc4206e1c80, 0xc42024533e, 0xc4202c5c80, 0x4916258)
    /usr/local/Cellar/go/1.9/libexec/src/io/io.go:362 +0x68
os/exec.(*Cmd).stdin.func1(0xc420291c28, 0xc4206d1d80)
    /usr/local/Cellar/go/1.9/libexec/src/os/exec/exec.go:219 +0x55
os/exec.(*Cmd).Start.func1(0xc420136580, 0xc4206f94e0)
    /usr/local/Cellar/go/1.9/libexec/src/os/exec/exec.go:380 +0x27
created by os/exec.(*Cmd).Start
    /usr/local/Cellar/go/1.9/libexec/src/os/exec/exec.go:379 +0x646

OS

$ go version
go version go1.9 darwin/amd64

0 个答案:

没有答案