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

runtime: slice bounds out of range: panic during panic #44075

Open
pmishchenko-ua opened this issue Feb 2, 2021 · 3 comments
Open

runtime: slice bounds out of range: panic during panic #44075

pmishchenko-ua opened this issue Feb 2, 2021 · 3 comments

Comments

@pmishchenko-ua
Copy link

@pmishchenko-ua pmishchenko-ua commented Feb 2, 2021

What version of Go are you using (go version)?

$ go version
go version go1.13.8 linux/amd64

Does this issue reproduce with the latest release?

haven't tried since it occurred on a machine controlled by third-pary

What operating system and processor architecture are you using (go env)?

Linux local 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux

go env Output
$ go env
O111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/pmishchenko-ua/.cache/go-build"
GOENV="/home/pmishchenko-ua/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/pmishchenko-ua/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build816744651=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Cobra-based CLI program has been distributed and failed on one the machines it was run on

What did you expect to see?

A link to where the actual code failed

What did you see instead?

The message about panic during throwing panic:

runtime stack:
runtime.throw(0x9b9400, 0x19)
/usr/local/go/src/runtime/panic.go:774 +0x72
runtime.panicCheck1(0x44c04d, 0x9b9400, 0x19)
/usr/local/go/src/runtime/panic.go:21 +0xd9
runtime.goPanicSliceB(0x66400103, 0x2f05f9)
/usr/local/go/src/runtime/panic.go:102 +0x44
runtime.pcvalue(0xb3cfc8, 0xd91160, 0x66400103, 0x4ba020, 0x7f58cceee960, 0xa70301, 0xaf06b0)
/usr/local/go/src/runtime/symtab.go:671 +0x54d
runtime.funcspdelta(0xb3cfc8, 0xd91160, 0x4ba020, 0x7f58cceee960, 0x10)
/usr/local/go/src/runtime/symtab.go:775 +0x5f
runtime.gentraceback(0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0xc0001cb980, 0x0, 0x0, 0x7fffffff, 0x9d94f8, 0x7f58cceeebe0, 0x0, ...)
/usr/local/go/src/runtime/traceback.go:220 +0x1598
runtime.copystack(0xc0001cb980, 0x1000, 0x7f58d0868801)
/usr/local/go/src/runtime/stack.go:886 +0x25a
runtime.newstack()
/usr/local/go/src/runtime/stack.go:1055 +0x2fb
runtime.morestack()
/usr/local/go/src/runtime/asm_amd64.s:449 +0x8f

goroutine 18 [copystack]:
runtime.newMarkBits(0x400, 0x0)
/usr/local/go/src/runtime/mheap.go:1933 +0x349 fp=0xc00020cb68 sp=0xc00020cb60 pc=0x429769
runtime.heapBits.initSpan(0x7f58cdf06100, 0x20300000000000, 0x7f58ce0f1fff, 0x7f58d0868848)
/usr/local/go/src/runtime/mbitmap.go:792 +0x74 fp=0xc00020cbe8 sp=0xc00020cb68 pc=0x416e74
runtime.(*mcentral).grow(0xdd5d18, 0x0)
/usr/local/go/src/runtime/mcentral.go:264 +0x13e fp=0xc00020cc28 sp=0xc00020cbe8 pc=0x41952e
runtime.(*mcentral).cacheSpan(0xdd5d18, 0x50)
/usr/local/go/src/runtime/mcentral.go:106 +0x2fe fp=0xc00020cc88 sp=0xc00020cc28 pc=0x418f8e
runtime.(*mcache).refill(0x7f58d08c2d98, 0x2)
/usr/local/go/src/runtime/mcache.go:138 +0x85 fp=0xc00020cca8 sp=0xc00020cc88 pc=0x418a35
runtime.(*mcache).nextFree(0x7f58d08c2d98, 0x50010000418e02, 0x0, 0xc0000dd558, 0x418e2e)
/usr/local/go/src/runtime/malloc.go:854 +0x87 fp=0xc00020cce0 sp=0xc00020cca8 pc=0x40d4e7
runtime.mallocgc(0x8, 0x911800, 0x1, 0xc0000dd638)
/usr/local/go/src/runtime/malloc.go:1022 +0x793 fp=0xc00020cd80 sp=0xc00020cce0 pc=0x40de23
runtime.growslice(0x911800, 0x0, 0x0, 0x0, 0x1, 0x0, 0xc0000e2a80, 0x7f58d08c2d98)
/usr/local/go/src/runtime/slice.go:181 +0x1e2 fp=0xc00020cde8 sp=0xc00020cd80 pc=0x445502
runtime.(*timersBucket).addtimerLocked(0xdd39e0, 0xc000280008, 0x20)
/usr/local/go/src/runtime/time.go:153 +0x186 fp=0xc00020ce38 sp=0xc00020cde8 pc=0x44cfe6
runtime.addtimer(0xc000280008)
/usr/local/go/src/runtime/time.go:134 +0x81 fp=0xc00020ce78 sp=0xc00020ce38 pc=0x44ce01
time.startTimer(0xc000280008)
/usr/local/go/src/runtime/time.go:114 +0x2b fp=0xc00020ce90 sp=0xc00020ce78 pc=0x44cc9b
fatal error: slice bounds out of range
panic during panic

runtime stack:
runtime.throw(0x9b9400, 0x19)
/usr/local/go/src/runtime/panic.go:774 +0x72
runtime.panicCheck1(0x44c04d, 0x9b9400, 0x19)
/usr/local/go/src/runtime/panic.go:21 +0xd9
runtime.goPanicSliceB(0x66400103, 0x2f05f9)
/usr/local/go/src/runtime/panic.go:102 +0x44
runtime.pcvalue(0xb3cfc8, 0xd91160, 0x66400103, 0x4ba020, 0x7f58cceee198, 0x9ae101, 0x1)
/usr/local/go/src/runtime/symtab.go:671 +0x54d
runtime.funcspdelta(0xb3cfc8, 0xd91160, 0x4ba020, 0x7f58cceee198, 0x21)
/usr/local/go/src/runtime/symtab.go:775 +0x5f
runtime.gentraceback(0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0xc0001cb980, 0x0, 0x0, 0x64, 0x0, 0x0, 0x0, ...)
/usr/local/go/src/runtime/traceback.go:220 +0x1598
runtime.traceback1(0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0xc0001cb980, 0x0)
/usr/local/go/src/runtime/traceback.go:722 +0xf0
runtime.traceback(0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0xc0001cb980)
/usr/local/go/src/runtime/traceback.go:676 +0x52
runtime.tracebackothers(0xc000001500)
/usr/local/go/src/runtime/traceback.go:911 +0x28a
runtime.dopanic_m(0xc000001500, 0x42f602, 0x7f58cceee6c0, 0x1)
/usr/local/go/src/runtime/panic.go:974 +0x29e
runtime.fatalthrow.func1()
/usr/local/go/src/runtime/panic.go:829 +0x5f
runtime.fatalthrow()
/usr/local/go/src/runtime/panic.go:826 +0x57
runtime.throw(0x9b9400, 0x19)
/usr/local/go/src/runtime/panic.go:774 +0x72
runtime.panicCheck1(0x44c04d, 0x9b9400, 0x19)
/usr/local/go/src/runtime/panic.go:21 +0xd9
runtime.goPanicSliceB(0x66400103, 0x2f05f9)
/usr/local/go/src/runtime/panic.go:102 +0x44
runtime.pcvalue(0xb3cfc8, 0xd91160, 0x66400103, 0x4ba020, 0x7f58cceee960, 0xa70301, 0xaf06b0)
/usr/local/go/src/runtime/symtab.go:671 +0x54d
runtime.funcspdelta(0xb3cfc8, 0xd91160, 0x4ba020, 0x7f58cceee960, 0x10)
/usr/local/go/src/runtime/symtab.go:775 +0x5f
runtime.gentraceback(0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0xc0001cb980, 0x0, 0x0, 0x7fffffff, 0x9d94f8, 0x7f58cceeebe0, 0x0, ...)
/usr/local/go/src/runtime/traceback.go:220 +0x1598
runtime.copystack(0xc0001cb980, 0x1000, 0x7f58d0868801)
/usr/local/go/src/runtime/stack.go:886 +0x25a
runtime.newstack()
/usr/local/go/src/runtime/stack.go:1055 +0x2fb
runtime.morestack()
/usr/local/go/src/runtime/asm_amd64.s:449 +0x8f

@ianlancetaylor ianlancetaylor changed the title Slice bounds out of range: panic during panic runtime: slice bounds out of range: panic during panic Feb 2, 2021
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Feb 2, 2021

We no longer support Go 1.13. It would be useful to know whether this happens with a newer Go release. Thanks.

@davecheney
Copy link
Contributor

@davecheney davecheney commented Feb 3, 2021

This could be memory corruption. Have you tried running your program under the race detector? See https://blog.golang.org/race-detector .

@pmishchenko-ua
Copy link
Author

@pmishchenko-ua pmishchenko-ua commented Feb 3, 2021

Thanks for prompt responses! The issue has not been reproduced after the machine reboot, so some sort of memory corruption should have occurred indeed. If the stacktrace above is not sufficient for any kind of investigation, then the ticket can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants