storm icon indicating copy to clipboard operation
storm copied to clipboard

accidental panic: page 16 already freed

Open nkbai opened this issue 6 years ago • 4 comments

panic: page 16 already freed

goroutine 16 [running]: vendor/github.com/coreos/bbolt.(*freelist).free(0xc0422bc5d0, 0x19, 0x45a0000) D:/gotest/beego/src/vendor/github.com/coreos/bbolt/freelist.go:143 +0x45b vendor/github.com/coreos/bbolt.(*Tx).Commit(0xc042415a40, 0x0, 0x0) D:/gotest/beego/src/vendor/github.com/coreos/bbolt/tx.go:171 +0x37f vendor/github.com/coreos/bbolt.(*DB).Update(0xc0423421e0, 0xc042527a00, 0x0, 0x0) D:/gotest/beego/src/vendor/github.com/coreos/bbolt/db.go:674 +0x141 vendor/github.com/asdine/storm.(*node).readWriteTx(0xc04200fe00, 0xc0424f9950, 0x0, 0x0) D:/gotest/beego/src/vendor/github.com/asdine/storm/node.go:114 +0x1cd vendor/github.com/asdine/storm.(*node).Save(0xc04200fe00, 0xc2b9e0, 0xc0423f2340, 0x0, 0x0) D:/gotest/beego/src/vendor/github.com/asdine/storm/store.go:158 +0x36f models.(*ModelDB).LogStateChange(0xc04200fcc0, 0xc2c260, 0xc0424f7048, 0x0, 0x0, 0x0) D:/gotest/beego/src/models/db.go:148 +0xa6

type StateChange struct {
	ID          int `storm:"id,increment"`
	StateChange transfer.StateChange
}
func (model *ModelDB) LogStateChange(stateChange transfer.StateChange) (id int, err error) {
	sc := &StateChange{
		StateChange: stateChange,
	}
	err = model.db.Save(sc)  //line 148
	id = sc.ID
	return
}

nkbai avatar Feb 22 '18 03:02 nkbai

model.db is return from storm.Open

nkbai avatar Feb 22 '18 03:02 nkbai

Can you provide a working example please so i can try to reproduce ? Also, what version of Storm are you using ?

asdine avatar Feb 22 '18 18:02 asdine

commit 68fc73b635f890fe7ba2f3b15ce80c85b28a744f of master this error occurs occasionally ,i cannot make sure how to reproduce this error.

nkbai avatar Feb 23 '18 02:02 nkbai

I can't reproduce it either, are you sure your have the latest bbolt and storm version ?

asdine avatar Mar 10 '18 12:03 asdine