runtime: "panic holding locks" when adding a timer #25619
Closed
Milestone
Comments
/cc @eliasnaur too |
Related: #24790 where a crash involves addTimerLocked as well. CC @aclements. @happyEgg: is the crash reproducible? If so, how? |
I can reproduce this with https://play.golang.org/p/vd1Wc0cvhhY. Check that you're not accessing time.Timer instances from multiple goroutines. |
Yes, time.Timer instances from multiple goroutines. It's ok when i add sync.Mutex |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?1.10.2
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/admin/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/admin/workspace/golang"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/4j/wpx8_n613m9dc636mh072qfh0000gn/T/go-build402023923=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
I use gomobile to compile an android Library,it panic when i use time.Reset(xx)。
The phone is xiaomi
05-29 12:58:58.527 E/Go (13646): panic: (runtime.errorString) (0xd0b95010,0xd0c9b538)
05-29 12:58:58.527 E/Go (13646): fatal error: panic holding locks
05-29 12:58:58.536 E/Go (13646):
05-29 12:58:58.536 E/Go (13646): goroutine 27 [running]:
05-29 12:58:58.537 E/Go (13646): runtime.throw(0xd0af0148, 0x13)
05-29 12:58:58.537 E/Go (13646): /usr/local/go/src/runtime/panic.go:616 +0x64 fp=0x90730e48 sp=0x90730e3c pc=0xd09269a0
05-29 12:58:58.537 E/Go (13646): panic(0xd0b95010, 0xd0c9b538)
05-29 12:58:58.537 E/Go (13646): /usr/local/go/src/runtime/panic.go:462 +0x4e8 fp=0x90730e9c sp=0x90730e48 pc=0xd092661c
05-29 12:58:58.537 E/Go (13646): runtime.panicindex()
05-29 12:58:58.537 E/Go (13646): /usr/local/go/src/runtime/panic.go:28 +0x64 fp=0x90730ea8 sp=0x90730e9c pc=0xd0925030
05-29 12:58:58.537 E/Go (13646): runtime.siftupTimer(0x90632400, 0xf5, 0x100, 0x132)
05-29 12:58:58.537 E/Go (13646): /usr/local/go/src/runtime/time.go:331 +0x17c fp=0x90730ec8 sp=0x90730ea8 pc=0xd0946854
05-29 12:58:58.537 E/Go (13646): runtime.(*timersBucket).addtimerLocked(0xd0cccba8, 0x907240c4)
05-29 12:58:58.537 E/Go (13646): /usr/local/go/src/runtime/time.go:146 +0xcc fp=0x90730efc sp=0x90730ec8 pc=0xd0945c1c
05-29 12:58:58.537 E/Go (13646): runtime.addtimer(0x907240c4)
05-29 12:58:58.538 E/Go (13646): /usr/local/go/src/runtime/time.go:131 +0x58 fp=0x90730f0c sp=0x90730efc pc=0xd0945b2c
05-29 12:58:58.538 E/Go (13646): time.startTimer(0x907240c4)
05-29 12:58:58.538 E/Go (13646): /usr/local/go/src/runtime/time.go:111 +0x1c fp=0x90730f14 sp=0x90730f0c pc=0xd0945a20
05-29 12:58:58.539 E/Go (13646): time.(*Timer).Reset(0x907240c0, 0x7e11d600, 0x3, 0x0)
05-29 12:58:58.539 E/Go (13646): /usr/local/go/src/time/sleep.go:130 +0x80 fp=0x90730f38 sp=0x90730f14 pc=0xd0968cd4
05-29 12:58:58.539 E/Go (13646): bt/controller.(*Peer).TimerAnyAuthenticatedPacketTraversal(0x907282c0)
05-29 12:58:58.539 E/Go (13646):
The text was updated successfully, but these errors were encountered: