Closed
Description
What version of Go are you using (go version
)?
go1.9.1
What operating system and processor architecture are you using (go env
)?
android/arm64
What did you do?
I have a large golang server application that uses a variety of libraries, including some that use cgo. The app runs on many different platforms and is deployed on hundreds of different hardware and operating systems combinations.
On android/arm64 specifically, I see periodic crashes in the golang runtime.
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x4000017698 pc=0x20285915f8]
runtime stack:
runtime.throw(0x2028bda477, 0x2a)
go/src/runtime/panic.go:605 +0x70
runtime.sigpanic()
go/src/runtime/signal_unix.go:351 +0x264
runtime.inheap(...)
go/src/runtime/mheap.go:377
runtime.gcmarkwb_m(0x442052bf20, 0x4425da67f0)
go/src/runtime/mbarrier.go:163 +0xa0
runtime.writebarrierptr_prewrite1.func1()
go/src/runtime/mbarrier.go:193 +0x54
runtime.systemstack(0x4420524f38)
go/src/runtime/asm_arm64.s:241 +0x8c
runtime.mstart()
go/src/runtime/proc.go:1125
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x4000006578 pc=0x203b7dd330]
runtime stack:
runtime.throw(0x203be25477, 0x2a)
go/src/runtime/panic.go:605 +0x70
runtime.sigpanic()
go/src/runtime/signal_unix.go:351 +0x264
runtime.heapBitsForObject(0x442195e660, 0x442195b770, 0x0, 0x441ff361cb, 0x4400000000, 0x204da725f0, 0x442001d260, 0x68)
go/src/runtime/mbitmap.go:392 +0x88
runtime.scanobject(0x442195b770, 0x442001d260)
go/src/runtime/mgcmark.go:1187 +0x218
runtime.gcDrain(0x442001d260, 0xd)
go/src/runtime/mgcmark.go:943 +0x1dc
runtime.gcBgMarkWorker.func2()
go/src/runtime/mgc.go:1796 +0x16c
runtime.systemstack(0x442001e600)
go/src/runtime/asm_arm64.s:241 +0x8c
runtime.mstart()
go/src/runtime/proc.go:1125
I also observed this issue before upgrading to golang 1.9. Here's a crash from golang 1.8:
unexpected fault address 0x400004bea8
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x1 addr=0x400004bea8 pc=0x200cfc127c]
goroutine 5 [running]:
runtime.throw(0x200d4f970a, 0x5)
go/src/runtime/panic.go:596 +0x70 fp=0x44207ad530 sp=0x44207ad510
runtime.sigpanic()
go/src/runtime/signal_unix.go:297 +0x224 fp=0x44207ad580 sp=0x44207ad530
runtime.bulkBarrierPreWrite(0x4432faaea8, 0x4432f44a28, 0x10)
go/src/runtime/mbitmap.go:581 +0x324 fp=0x44207ad610 sp=0x44207ad590
runtime.typedmemmove(0x200d6650c0, 0x4432faaea8, 0x4432f44a28)
go/src/runtime/mbarrier.go:237 +0xa4 fp=0x44207ad640 sp=0x44207ad610
runtime.evacuate(0x200d6aeac0, 0x4426172570, 0x2)
go/src/runtime/hashmap.go:1072 +0x5b4 fp=0x44207ad730 sp=0x44207ad640
runtime.growWork(0x200d6aeac0, 0x4426172570, 0x1)
go/src/runtime/hashmap.go:957 +0x8c fp=0x44207ad750 sp=0x44207ad730
runtime.mapassign(0x200d6aeac0, 0x4426172570, 0x44207ad8a0, 0x200dc5b5d8)
go/src/runtime/hashmap.go:513 +0x524 fp=0x44207ad7f0 sp=0x44207ad750
Slightly longer versions of these crashes are available in blevesearch/bleve#634, but I'm also happy to provide the full list of goroutine backtraces if that is helpful.
Given that the same codebase works fine on linux/freebsd/windows across amd64/i686/arm, I suspect this issue is specific to the arm64 golang runtime.
cc @aclements