go: cmd/compile: BoltDB with SSA crashes with: unexpected fault address 0xc420a00000
- What version of Go are you using (
go version
)? go version go1.7 darwin/amd64 go version go1.7 linux/amd64 - What operating system and processor architecture are you using (
go env
)? GOARCH=“amd64” GOBIN=“” GOEXE=“” GOHOSTARCH=“amd64” GOHOSTOS=“darwin” GOOS=“darwin” GOPATH=“” GORACE=“” GOROOT=“/usr/local/Cellar/go/1.7/libexec” GOTOOLDIR=“/usr/local/Cellar/go/1.7/libexec/pkg/tool/darwin_amd64” CC=“clang” GOGCCFLAGS=“-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/lm/g9hbhwd10gj8g_t64zzm63pm0000gn/T/go-build065044530=/tmp/go-build -gno-record-gcc-switches -fno-common” CXX=“clang++” CGO_ENABLED=“1”
GOARCH=“amd64” GOBIN=“” GOEXE=“” GOHOSTARCH=“amd64” GOHOSTOS=“linux” GOOS=“linux” GOPATH=“” GORACE=“” GOROOT=“/usr/local/go” GOTOOLDIR=“/usr/local/go/pkg/tool/linux_amd64” CC=“gcc” GOGCCFLAGS=“-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build785786852=/tmp/go-build -gno-record-gcc-switches” CXX=“g++” CGO_ENABLED=“1”
- What did you do? When creating a number of nested buckets, my app will intermittently crash. Here is the relevant part of the stack trace. The location of the failure is quite consistent under both Mac OS and Linux.
unexpected fault address 0xc420a00000 fatal error: fault [signal SIGBUS: bus error code=0x2 addr=0xc420a00000 pc=0xef856]
goroutine 7 [running]: runtime.throw(0x27f950, 0x5) /usr/local/Cellar/go/1.7/libexec/src/runtime/panic.go:566 +0x95 fp=0xc42004f210 sp=0xc42004f1f0 runtime.sigpanic() /usr/local/Cellar/go/1.7/libexec/src/runtime/sigpanic_unix.go:21 +0x1d0 fp=0xc42004f268 sp=0xc42004f210 github.com/boltdb/bolt.(_node).write(0xc420098070, 0xc4209ffff0) /Users/ebusto/Perforce/mq-watch/src/github.com/boltdb/bolt/node.go:205 +0x86 fp=0xc42004f3a8 sp=0xc42004f268 github.com/boltdb/bolt.(_Bucket).write(0xc42004f4c0, 0xc420098070, 0x9, 0x0) /Users/ebusto/Perforce/mq-watch/src/github.com/boltdb/bolt/bucket.go:598 +0xb1 fp=0xc42004f408 sp=0xc42004f3a8 github.com/boltdb/bolt.(_Bucket).CreateBucket(0xc4200bec40, 0xc420910600, 0x9, 0x9, 0x9, 0x9, 0x0) /Users/ebusto/Perforce/mq-watch/src/github.com/boltdb/bolt/bucket.go:181 +0x2bf fp=0xc42004f508 sp=0xc42004f408 pkg/journal.(_TX).set(0xc420152028, 0xc4200bec40, 0xc4209105f6, 0x9, 0x9, 0x237f80, 0xc4205a85a0, 0x15)
- What did you expect to see? Under Go 1.6, and Go 1.7 with SSA disabled (go build -gcflags=“-ssa=0”), Bolt will happily create buckets without fail.
- What did you see instead? SIGBUS on Mac OS, and SIGSEGV on Linux.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 17 (14 by maintainers)
Commits related to this issue
- fix Go 1.7 pointer reference bug This commit fixes a bug where page end-of-header pointers were being converted to byte slices even when the pointer did not point to allocated memory. This occurs wit... — committed to benbjohnson/bolt by benbjohnson 8 years ago
- fix segfault in boltdb https://github.com/golang/go/issues/16772 — committed to samdfonseca/flipadelphia by deleted user 8 years ago
This program demonstrates what the problem is: