Skip to content

Panic with slice bounds out of range #965

@sakky016

Description

@sakky016

When the size of data to be stored in cache is large, I get below issue:

panic: runtime error: slice bounds out of range [::498451638] with length 268435455
goroutine 68 [running]:
go.etcd.io/bbolt/internal/common.UnsafeByteSlice(...)
        /go/pkg/mod/go.etcd.io/bbolt@v1.4.0/internal/common/unsafe.go:26
go.etcd.io/bbolt/internal/common.WriteInodeToPage({0xc0001fc600?, 0x2, 0xc000a60d50?}, 0xc0f0ff8000)
        /go/pkg/mod/go.etcd.io/bbolt@v1.4.0/internal/common/inode.go:81 +0x305
go.etcd.io/bbolt.(*node).write(0xc03b9e6000?, 0x1db5d?)
        /go/pkg/mod/go.etcd.io/bbolt@v1.4.0/node.go:199 +0x79
go.etcd.io/bbolt.(*node).spill(0xc0009fe150)
        /go/pkg/mod/go.etcd.io/bbolt@v1.4.0/node.go:334 +0x26a
go.etcd.io/bbolt.(*node).spill(0xc0009fe070)
        /go/pkg/mod/go.etcd.io/bbolt@v1.4.0/node.go:306 +0x9b
go.etcd.io/bbolt.(*node).spill(0xc0009fe000)
        /go/pkg/mod/go.etcd.io/bbolt@v1.4.0/node.go:306 +0x9b
go.etcd.io/bbolt.(*Bucket).spill(0xc000956000)
        /go/pkg/mod/go.etcd.io/bbolt@v1.4.0/bucket.go:786 +0x365
go.etcd.io/bbolt.(*Bucket).spill(0xc03b9e6018)
        /go/pkg/mod/go.etcd.io/bbolt@v1.4.0/bucket.go:753 +0x105
go.etcd.io/bbolt.(*Tx).Commit(0xc03b9e6000)
        /go/pkg/mod/go.etcd.io/bbolt@v1.4.0/tx.go:204 +0x2db
go.etcd.io/bbolt.(*DB).Update(0x4132920?, 0xc000b54b00)
        /go/pkg/mod/go.etcd.io/bbolt@v1.4.0/db.go:915 +0xca

Looks like this was already fixed with: boltdb/bolt#315

Any plans to have this incorporated in bbolt?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions