yowcow / goromdb

Yet another single process KVS server implemented over file-based database
The Unlicense
12 stars 5 forks source link

bdb: segmentation fault at db_close #62

Closed yowcow closed 6 years ago

yowcow commented 6 years ago
2017/12/08 08:15:01 radixhandler.go:47: radixhandler got a new file to load at './tmp/data.db'
2017/12/08 08:15:01 radixhandler.go:54: radixhandler loading data from 'tmp/data00/data.db'
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x80 addr=0x0 pc=0x7f85ace0a5a1]

runtime stack:
runtime.throw(0x599e58, 0x2a)
        /usr/local/go-1.9.2/src/runtime/panic.go:605 +0x95
runtime.sigpanic()
        /usr/local/go-1.9.2/src/runtime/signal_unix.go:351 +0x2b8

goroutine 6 [syscall, locked to thread]:
runtime.cgocall(0x5307f0, 0xc420039c70, 0x599af2)
        /usr/local/go-1.9.2/src/runtime/cgocall.go:132 +0xe4 fp=0xc420039c30 sp=0xc420039bf0 pc=0x4035c4
github.com/yowcow/goromdb/vendor/github.com/ajiyoshi-vg/goberkeleydb/bdb._Cfunc_db_close(0x12ec090, 0x0, 0x0)
        github.com/yowcow/goromdb/vendor/github.com/ajiyoshi-vg/goberkeleydb/bdb/_obj/_cgo_gotypes.go:984 +0x4d fp=0xc420039c70 sp=0xc420039c30 pc=0x5035bd
github.com/yowcow/goromdb/vendor/github.com/ajiyoshi-vg/goberkeleydb/bdb.(*BerkeleyDB).Close.func1(0x12ec090, 0x0, 0xc420039ce0)
        /home/vagrant/go/src/github.com/yowcow/goromdb/vendor/github.com/ajiyoshi-vg/goberkeleydb/bdb/berkeleydb_c.go:172 +0x68 fp=0xc420039ca8 sp=0xc420039c70 pc=0x505218
github.com/yowcow/goromdb/vendor/github.com/ajiyoshi-vg/goberkeleydb/bdb.(*BerkeleyDB).Close(0xc42000e068, 0x0, 0xc420014160, 0x0)
        /home/vagrant/go/src/github.com/yowcow/goromdb/vendor/github.com/ajiyoshi-vg/goberkeleydb/bdb/berkeleydb_c.go:172 +0x3a fp=0xc420039ce0 sp=0xc420039ca8 pc=0x50435a
github.com/yowcow/goromdb/storage/bdbstorage.(*Storage).LoadAndIterate(0xc42000e030, 0xc437f02d00, 0x12, 0xc43d686000, 0xc420014160, 0x0, 0x0)
        /home/vagrant/go/src/github.com/yowcow/goromdb/storage/bdbstorage/bdbstorage.go:48 +0x129 fp=0xc420039d20 sp=0xc420039ce0 pc=0x506d39
github.com/yowcow/goromdb/handler/radixhandler.(*Handler).Load(0xc42005e570, 0xc437f02d00, 0x12, 0x0, 0x0)
        /home/vagrant/go/src/github.com/yowcow/goromdb/handler/radixhandler/radixhandler.go:77 +0xec fp=0xc420039da0 sp=0xc420039d20 pc=0x4c3f3c
github.com/yowcow/goromdb/handler/radixhandler.(*Handler).start(0xc42005e570, 0xc42005c120, 0xc4200641e0, 0xc42005c180)
        /home/vagrant/go/src/github.com/yowcow/goromdb/handler/radixhandler/radixhandler.go:55 +0x4cf fp=0xc420039fc0 sp=0xc420039da0 pc=0x4c3a0f
runtime.goexit()
        /usr/local/go-1.9.2/src/runtime/asm_amd64.s:2337 +0x1 fp=0xc420039fc8 sp=0xc420039fc0 pc=0x4588a1
created by github.com/yowcow/goromdb/handler/radixhandler.(*Handler).Start
        /home/vagrant/go/src/github.com/yowcow/goromdb/handler/radixhandler/radixhandler.go:31 +0x7f
yowcow commented 6 years ago

Also at db_get

2017/12/08 08:18:20 server.go:52: server got a client connection closed
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x19 pc=0x7fa07ac392a6]

runtime stack:
runtime.throw(0x599e58, 0x2a)
        /usr/local/go-1.9.2/src/runtime/panic.go:605 +0x95
runtime.sigpanic()
        /usr/local/go-1.9.2/src/runtime/signal_unix.go:351 +0x2b8

goroutine 13 [syscall, locked to thread]:
runtime.cgocall(0x530a10, 0xc420035b80, 0x599af2)
        /usr/local/go-1.9.2/src/runtime/cgocall.go:132 +0xe4 fp=0xc420035b40 sp=0xc420035b00 pc=0x4035c4
github.com/yowcow/goromdb/vendor/github.com/ajiyoshi-vg/goberkeleydb/bdb._Cfunc_db_get(0x7fa064001540, 0x0, 0xc429726de0, 0xc429726d50, 0x0, 0x7fa000000000)
        github.com/yowcow/goromdb/vendor/github.com/ajiyoshi-vg/goberkeleydb/bdb/_obj/_cgo_gotypes.go:1118 +0x4d fp=0xc420035b80 sp=0xc420035b40 pc=0x5039fd
github.com/yowcow/goromdb/vendor/github.com/ajiyoshi-vg/goberkeleydb/bdb.(*BerkeleyDB).Get.func1(0x7fa064001540, 0x0, 0xc429726de0, 0xc429726d50, 0x0, 0xc420035c28)
        /home/vagrant/go/src/github.com/yowcow/goromdb/vendor/github.com/ajiyoshi-vg/goberkeleydb/bdb/berkeleydb_c.go:195 +0x129 fp=0xc420035bc0 sp=0xc420035b80 pc=0x505369
github.com/yowcow/goromdb/vendor/github.com/ajiyoshi-vg/goberkeleydb/bdb.(*BerkeleyDB).Get(0xc42000e060, 0x0, 0xc429b800c0, 0x3e, 0x40, 0xc400000000, 0x0, 0x0, 0x0, 0x0, ...)
        /home/vagrant/go/src/github.com/yowcow/goromdb/vendor/github.com/ajiyoshi-vg/goberkeleydb/bdb/berkeleydb_c.go:195 +0x12e fp=0xc420035c18 sp=0xc420035bc0 pc=0x50454e
github.com/yowcow/goromdb/storage/bdbstorage.(*Storage).Get(0xc42000e030, 0xc429b800c0, 0x3e, 0x40, 0x3e, 0x40, 0x85cb01, 0x1, 0xc420035d40)
        /home/vagrant/go/src/github.com/yowcow/goromdb/storage/bdbstorage/bdbstorage.go:60 +0x70 fp=0xc420035c80 sp=0xc420035c18 pc=0x506eb0
github.com/yowcow/goromdb/handler/radixhandler.Handler.Get(0xc4298e3b90, 0x859f60, 0xc42000e030, 0xc420014160, 0xc420064190, 0xc42a15e005, 0x3e, 0xffb, 0x0, 0x0, ...)
        /home/vagrant/go/src/github.com/yowcow/goromdb/handler/radixhandler/radixhandler.go:100 +0x19c fp=0xc420035d10 sp=0xc420035c80 pc=0x4c429c
github.com/yowcow/goromdb/handler/radixhandler.(*Handler).Get(0xc42005e570, 0xc42a15e005, 0x3e, 0xffb, 0xc429726d08, 0x1, 0x1, 0x0, 0x0, 0xb, ...)
        <autogenerated>:1 +0x9c fp=0xc420035da0 sp=0xc420035d10 pc=0x4c46fc
github.com/yowcow/goromdb/server.Server.HandleConn(0x5921c7, 0x3, 0x7ffe37b9cb38, 0x6, 0x859f20, 0x8882d8, 0x859ea0, 0xc42005e570, 0xc420064190, 0x85b260, ...)
yowcow commented 6 years ago

I see no problem as long as db is not replaced at runtime. This happens when db is switched.